forked from OSchip/llvm-project
Fix Parser::isCXXConditionDeclaration to properly resolve declarations.
llvm-svn: 57111
This commit is contained in:
parent
37e560cde1
commit
2534620b4e
|
@ -259,11 +259,9 @@ bool Parser::isCXXConditionDeclaration() {
|
|||
// declarator
|
||||
TPR = TryParseDeclarator(false/*mayBeAbstract*/);
|
||||
|
||||
PA.Revert();
|
||||
|
||||
// In case of an error, let the declaration parsing code handle it.
|
||||
if (TPR == TPR_error)
|
||||
return true;
|
||||
TPR = TPR_true;
|
||||
|
||||
if (TPR == TPR_ambiguous) {
|
||||
// '='
|
||||
|
@ -275,6 +273,8 @@ bool Parser::isCXXConditionDeclaration() {
|
|||
TPR = TPR_false;
|
||||
}
|
||||
|
||||
PA.Revert();
|
||||
|
||||
assert(TPR == TPR_true || TPR == TPR_false);
|
||||
return TPR == TPR_true;
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ void f() {
|
|||
typeof(int[])(f) = { 1, 2 }; // expected-warning {{statement was disambiguated as declaration}}
|
||||
void(b)(int);
|
||||
int(d2) __attribute__(()); // expected-warning {{statement was disambiguated as declaration}}
|
||||
if (int(a)=1) {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue