summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-12-19 02:40:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-12-19 02:40:19 +0000
commitd63db6ef1f23e597277005c9ba177184b0e4065e (patch)
treee442bf91fb59ded8e70b30daccc8ff0dab826b32 /clang/lib/Parse/ParseDecl.cpp
parent5d54689bcaeeca8845c57418ab63d7cdd0a7e38c (diff)
downloadbcm5719-llvm-d63db6ef1f23e597277005c9ba177184b0e4065e.tar.gz
bcm5719-llvm-d63db6ef1f23e597277005c9ba177184b0e4065e.zip
Fix crash-on-invalid if a :: is followed by two or more open parentheses (and then something else).
llvm-svn: 256080
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 4039f2ac2a3..c85ea4a11fe 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -5198,6 +5198,15 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
}
goto PastIdentifier;
}
+
+ if (D.getCXXScopeSpec().isNotEmpty()) {
+ // We have a scope specifier but no following unqualified-id.
+ Diag(PP.getLocForEndOfToken(D.getCXXScopeSpec().getEndLoc()),
+ diag::err_expected_unqualified_id)
+ << /*C++*/1;
+ D.SetIdentifier(nullptr, Tok.getLocation());
+ goto PastIdentifier;
+ }
} else if (Tok.is(tok::identifier) && D.mayHaveIdentifier()) {
assert(!getLangOpts().CPlusPlus &&
"There's a C++-specific check for tok::identifier above");
OpenPOWER on IntegriCloud