]> granicus.if.org Git - clang/commit
In Parser::isCXXDeclarationSpecifier, consider a non-type identifier
authorKaelyn Uhrain <rikka@google.com>
Thu, 19 Apr 2012 23:17:45 +0000 (23:17 +0000)
committerKaelyn Uhrain <rikka@google.com>
Thu, 19 Apr 2012 23:17:45 +0000 (23:17 +0000)
commit434ed260eb28cacd1b87fc2429dfee66d61dfcf0
tree09ddd4d4c0de232e620774c0b139138d761e2169
parent0c5d0a80528c7f0bc110dd7f72e5ba52d37155e0
In Parser::isCXXDeclarationSpecifier, consider a non-type identifier
followed by an identifier as declaration specificer (except for ObjC).
This allows e.g. an out-of-line C++ member function definitions to be
recognized as functions and not as variable declarations if the type
name for the first parameter is not recognized as a type--say, when there
is a function name shadowing an enum type name and the parameter is
missing the "enum" keyword needed to distinguish the two.

Note that returning TPResult::Error() instead of TPResult::True()
appears to have the same end result, while TPResult::Ambiguous()
results in a crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155163 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Parse/ParseTentative.cpp
test/FixIt/fixit.cpp