]> granicus.if.org Git - clang/commitdiff
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177330 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 6c63a149c2b692b5f1e8e6e12f6542d80cadfadc..d8b5b9110846c8401252dd2ef8bcd86c88042dc6 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 3dda05902644c8ce4d0573bbcccdd4c094234a97..00631ddbfb937b55f15b10af4f2bbaf61f789102 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>();
+}