aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-18 22:23:49 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-18 22:23:49 +0000
commit0378433dcdf9a5701207c2a592b10da71ad9ba5d (patch)
tree175903a685476166380bdee3a84024cf0af6be76
parent4882fe02d8d453084da563b9c18eb5545f0783d4 (diff)
[PCH] Fix assertion hit related to enum decls inside templated funtions.
Report and suggested fix by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=13020 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177330 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp1
-rw-r--r--test/PCH/cxx-templates.h13
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index 6c63a149c2..d8b5b91108 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -253,6 +253,7 @@ void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) {
!D->isModulePrivate() &&
!CXXRecordDecl::classofKind(D->getKind()) &&
!D->getIntegerTypeSourceInfo() &&
+ !D->getMemberSpecializationInfo() &&
D->getDeclName().getNameKind() == DeclarationName::Identifier)
AbbrevToUse = Writer.getDeclEnumAbbrev();
diff --git a/test/PCH/cxx-templates.h b/test/PCH/cxx-templates.h
index 3dda059026..00631ddbfb 100644
--- a/test/PCH/cxx-templates.h
+++ b/test/PCH/cxx-templates.h
@@ -246,3 +246,16 @@ struct __mt_alloc {
}
};
}
+
+namespace PR13020 {
+template<typename T>
+void f() {
+ enum E {
+ enumerator
+ };
+
+ T t = enumerator;
+}
+
+template void f<int>();
+}