summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-11-08 01:09:16 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-11-08 01:09:16 +0000
commit19b66a5e32306f661886f5e7a95cf77f113826ed (patch)
treece2d7cafbd2a30b586fee8f102a3fddcebed7e10 /clang/lib/Parse/ParseDecl.cpp
parent865da3cae0acc9c6be3fc453609dd125a7771037 (diff)
downloadbcm5719-llvm-19b66a5e32306f661886f5e7a95cf77f113826ed.tar.gz
bcm5719-llvm-19b66a5e32306f661886f5e7a95cf77f113826ed.zip
In a declarator, consider an identifier a constructor only if it is followed by '('.
Previously: class C { int C; // Declarator::SetConstructor was called here. }; llvm-svn: 58880
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 2b18be02a3d..39d3acc0f9e 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1363,7 +1363,8 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
// Determine whether this identifier is a C++ constructor name or
// a normal identifier.
if (getLang().CPlusPlus &&
- Actions.isCurrentClassName(*Tok.getIdentifierInfo(), CurScope))
+ Actions.isCurrentClassName(*Tok.getIdentifierInfo(), CurScope) &&
+ NextToken().is(tok::l_paren))
D.SetConstructor(Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope),
Tok.getIdentifierInfo(), Tok.getLocation());
else
OpenPOWER on IntegriCloud