diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-17 00:12:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-17 00:12:27 +0000 |
commit | 80b3c5a00e0ba42dc8f0309a906e977c4bcd9120 (patch) | |
tree | a16ff38ecbd8c71a6fb97d17923663463c9b9f92 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | e4a5a90e8d6bc6a5ed0bf5f152a658c680b94867 (diff) | |
download | bcm5719-llvm-80b3c5a00e0ba42dc8f0309a906e977c4bcd9120.tar.gz bcm5719-llvm-80b3c5a00e0ba42dc8f0309a906e977c4bcd9120.zip |
Don't form a null reference when checking for validity of an anonymous
elaborated type specifier in template instantiation: such a specifier is always
valid because it must be specified within the definition of the type.
llvm-svn: 162068
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index c7cbc41b303..20e755fdaee 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -988,12 +988,11 @@ TemplateInstantiator::RebuildElaboratedType(SourceLocation KeywordLoc, SourceLocation TagLocation = KeywordLoc; - // FIXME: type might be anonymous. IdentifierInfo *Id = TD->getIdentifier(); // TODO: should we even warn on struct/class mismatches for this? Seems // like it's likely to produce a lot of spurious errors. - if (Keyword != ETK_None && Keyword != ETK_Typename) { + if (Id && Keyword != ETK_None && Keyword != ETK_Typename) { TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForKeyword(Keyword); if (!SemaRef.isAcceptableTagRedeclaration(TD, Kind, /*isDefinition*/false, TagLocation, *Id)) { |