[PCH] Fix assertion hit related to enum decls inside templated funtions.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 18 Mar 2013 22:23:49 +0000 (22:23 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 18 Mar 2013 22:23:49 +0000 (22:23 +0000)
Report and suggested fix by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=13020

llvm-svn: 177330

clang/lib/Serialization/ASTWriterDecl.cpp
clang/test/PCH/cxx-templates.h

index 6c63a14..d8b5b91 100644 (file)
@@ -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();
 
index 3dda059..00631dd 100644 (file)
@@ -246,3 +246,16 @@ struct __mt_alloc {
   }
 };
 }
+
+namespace PR13020 {
+template<typename T>
+void f() {
+ enum E {
+   enumerator
+ };
+
+ T t = enumerator;
+}
+
+template void f<int>();
+}