diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-15 21:29:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-15 21:29:55 +0000 |
commit | 8f0a7e7845f619575f8af0b0bf46d027b20a0b63 (patch) | |
tree | 35d7456dfe830c00b981f0558369333035e7d56b /lib/Parse/ParseDecl.cpp | |
parent | 827adaff666e53ae2f2db994bcd62ebe1ff5b9ce (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index dcc96cb861..36e3013701 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/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()) { |