summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-19 22:47:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-19 22:47:36 +0000
commit404dfb46a9dde63548d59db3295681a1c3a684fc (patch)
treea25b849dd6e65cd375970c1a38b83f9db019ed04 /clang/lib/Sema/DeclSpec.cpp
parent8bc4a0ba147f2bc0508313b6c41bb03fd564cd4e (diff)
downloadbcm5719-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/Sema/DeclSpec.cpp')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 538c16eeb25..c2f16157b8e 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -333,6 +333,12 @@ bool Declarator::isStaticMember() {
getName().OperatorFunctionId.Operator);
}
+bool DeclSpec::hasTagDefinition() const {
+ if (!TypeSpecOwned)
+ return false;
+ return cast<TagDecl>(getRepAsDecl())->isCompleteDefinition();
+}
+
/// getParsedSpecifiers - Return a bitmask of which flavors of specifiers this
/// declaration specifier includes.
///
OpenPOWER on IntegriCloud