[cfe-commits] r58880 - /cfe/trunk/lib/Parse/ParseDecl.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Fri Nov 7 17:09:16 PST 2008
Author: akirtzidis
Date: Fri Nov 7 19:09:16 2008
New Revision: 58880
URL: http://llvm.org/viewvc/llvm-project?rev=58880&view=rev
Log:
In a declarator, consider an identifier a constructor only if it is followed by '('.
Previously:
class C {
int C; // Declarator::SetConstructor was called here.
};
Modified:
cfe/trunk/lib/Parse/ParseDecl.cpp
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=58880&r1=58879&r2=58880&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Nov 7 19:09:16 2008
@@ -1363,7 +1363,8 @@
// 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
More information about the cfe-commits
mailing list