aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-17 00:12:27 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-17 00:12:27 +0000
commitcbf97c5a12c4fe8528a8365087e1d81005589288 (patch)
tree5ea4f6ed54add6968f200001659fa7eb1187cb92 /lib/Sema
parent0d5a069f66df09b3308ccfdce84a88170034c657 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index c7cbc41b30..20e755fdae 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/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)) {