In a declarator, consider an identifier a constructor only if it is followed by '('.

Previously:

class C {
  int C;  // Declarator::SetConstructor was called here.
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58880 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Argyrios Kyrtzidis 2008-11-08 01:09:16 +00:00
Родитель 1a4d34fea7
Коммит 9916325270
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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