]> granicus.if.org Git - clang/commit
When we see 'Class(X' or 'Class::Class(X' and we suspect that it names a
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 27 Mar 2012 00:56:56 +0000 (00:56 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 27 Mar 2012 00:56:56 +0000 (00:56 +0000)
commit412e0cc52ea644d804dcfa87194800371f91a977
tree7c9a8dca0fd0aeb248eda1974a9499c6c0edc355
parent3f718609f41921180f09ccc6e73fe8742667608e
When we see 'Class(X' or 'Class::Class(X' and we suspect that it names a
constructor, but X is not a known typename, check whether the tokens could
possibly match the syntax of a declarator before concluding that it isn't
a constructor. If it's definitely ill-formed, assume it is a constructor.

Empirical evidence suggests that this pattern is much more often a
constructor with a typoed (or not-yet-declared) type name than any of the
other possibilities, so the extra cost of the check is not expected to be
problematic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153488 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Parse/ParseDecl.cpp
test/Parser/cxx-class.cpp
test/SemaCXX/copy-assignment.cpp