summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-05-15 21:29:55 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-05-15 21:29:55 +0000
commitfe904f0c9c8d367552d83d2aaa1e2f27d4a365f5 (patch)
treeead7d7590c7d9a4ebefd67aa09da22cbd7d4f8ae /clang/lib/Parse/ParseDecl.cpp
parent5604c98fec8c1d86fafd81a9291390b381273619 (diff)
downloadbcm5719-llvm-fe904f0c9c8d367552d83d2aaa1e2f27d4a365f5.tar.gz
bcm5719-llvm-fe904f0c9c8d367552d83d2aaa1e2f27d4a365f5.zip
If we see a declaration which is either missing a type or has a malformed type,
and the thing we have has a scope specifier, and we're in a context that doesn't allow declaring a qualified name, then the error is a malformed type, not a missing type. llvm-svn: 156856
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index dcc96cb8614..36e30137019 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1707,7 +1707,10 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
}
}
- if (DSC != DSC_type_specifier && DSC != DSC_trailing) {
+ // Determine whether this identifier could plausibly be the name of something
+ // being declared (with a missign type).
+ if (DSC != DSC_type_specifier && DSC != DSC_trailing &&
+ (!SS || DSC == DSC_top_level || DSC == DSC_class)) {
// Look ahead to the next token to try to figure out what this declaration
// was supposed to be.
switch (NextToken().getKind()) {
OpenPOWER on IntegriCloud