commit | 0378433dcdf9a5701207c2a592b10da71ad9ba5d | [log] [tgz] |
---|---|---|
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | Mon Mar 18 22:23:49 2013 +0000 |
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | Mon Mar 18 22:23:49 2013 +0000 |
tree | 175903a685476166380bdee3a84024cf0af6be76 | |
parent | 4882fe02d8d453084da563b9c18eb5545f0783d4 [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
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 6c63a14..d8b5b91 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -253,6 +253,7 @@ !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 3dda059..00631dd 100644 --- a/test/PCH/cxx-templates.h +++ b/test/PCH/cxx-templates.h
@@ -246,3 +246,16 @@ } }; } + +namespace PR13020 { +template<typename T> +void f() { + enum E { + enumerator + }; + + T t = enumerator; +} + +template void f<int>(); +}