diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-19 22:47:36 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-19 22:47:36 +0000 |
commit | 404dfb46a9dde63548d59db3295681a1c3a684fc (patch) | |
tree | a25b849dd6e65cd375970c1a38b83f9db019ed04 /clang/lib/Parse/ParseDeclCXX.cpp | |
parent | 8bc4a0ba147f2bc0508313b6c41bb03fd564cd4e (diff) | |
download | bcm5719-llvm-404dfb46a9dde63548d59db3295681a1c3a684fc.tar.gz bcm5719-llvm-404dfb46a9dde63548d59db3295681a1c3a684fc.zip |
PR9547: If we're parsing a simple-declaration that contains a tag definition,
and we see an ill-formed declarator that would probably be well-formed if the
tag definition were just missing a semicolon, use that as the diagnostic
instead of producing some other mysterious error.
llvm-svn: 195163
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index bf615f02bab..382ed043abf 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -2077,6 +2077,14 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, ParseDeclarationSpecifiers(DS, TemplateInfo, AS, DSC_class, &CommonLateParsedAttrs); + // If we had a free-standing type definition with a missing semicolon, we + // may get this far before the problem becomes obvious. + if (DS.hasTagDefinition() && + TemplateInfo.Kind == ParsedTemplateInfo::NonTemplate && + DiagnoseMissingSemiAfterTagDefinition(DS, AS, DSC_class, + &CommonLateParsedAttrs)) + return; + MultiTemplateParamsArg TemplateParams( TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->data() : 0, TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->size() : 0); |