[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

llvm-svn: 177330
This commit is contained in:
Argyrios Kyrtzidis 2013-03-18 22:23:49 +00:00
parent 7ee730414d
commit ca370b0d1f
2 changed files with 14 additions and 0 deletions

View File

@ -253,6 +253,7 @@ void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) {
!D->isModulePrivate() && !D->isModulePrivate() &&
!CXXRecordDecl::classofKind(D->getKind()) && !CXXRecordDecl::classofKind(D->getKind()) &&
!D->getIntegerTypeSourceInfo() && !D->getIntegerTypeSourceInfo() &&
!D->getMemberSpecializationInfo() &&
D->getDeclName().getNameKind() == DeclarationName::Identifier) D->getDeclName().getNameKind() == DeclarationName::Identifier)
AbbrevToUse = Writer.getDeclEnumAbbrev(); AbbrevToUse = Writer.getDeclEnumAbbrev();

View 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>();
}