Otherwise, multiple errors such as having unknown identifiers for two
arguments won't be diagnosed properly (e.g. only the first one would
have a diagnostic message if typo correction fails even though both
would be diagnosed if typo correction suggests a replacement).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213003
91177308-0d34-0410-b5e6-
96231b3b80d8
Expr *Data,
ArrayRef<Expr *> Args),
Expr *Data) {
+ bool SawError = false;
while (1) {
if (Tok.is(tok::code_completion)) {
if (Completer)
if (Tok.is(tok::ellipsis))
Expr = Actions.ActOnPackExpansion(Expr.get(), ConsumeToken());
- if (Expr.isInvalid())
- return true;
-
- Exprs.push_back(Expr.get());
+ if (Expr.isInvalid()) {
+ SkipUntil(tok::comma, tok::r_paren, StopBeforeMatch);
+ SawError = true;
+ } else {
+ Exprs.push_back(Expr.get());
+ }
if (Tok.isNot(tok::comma))
- return false;
+ return SawError;
// Move to the next argument, remember where the comma was.
CommaLocs.push_back(ConsumeToken());
}
int x3 = __alignof int; // expected-error {{expected parentheses around type name in __alignof expression}}
int x4 = _Alignof int; // expected-error {{expected parentheses around type name in _Alignof expression}}
}
+
+void callee(double, double);
+void test8() {
+ callee(foobar, // expected-error {{use of undeclared identifier 'foobar'}}
+ fizbin); // expected-error {{use of undeclared identifier 'fizbin'}}
+}
// Test that GNU C extension __builtin_types_compatible_p() is not available in C++ mode.
int f() {
- return __builtin_types_compatible_p(int, const int); // expected-error{{}}
+ return __builtin_types_compatible_p(int, const int); // expected-error{{expected '(' for function-style cast or type construction}} \
+ // expected-error{{expected expression}}
}
if (TestClass.setterOnly) { // expected-error {{no getter method for read from property}}
TestClass.setterOnly = 1;
}
- func(TestClass.setterOnly + 1, x); // expected-error {{no getter method for read from property}}
+ func(TestClass.setterOnly + 1, x); // expected-error {{no getter method for read from property}} \
+ // expected-error {{use of undeclared identifier 'x'}}
int i = TestClass.setterOnly + 1; // expected-error {{no getter method for read from property}}
return TestClass.setterOnly + 1; // expected-error {{no getter method for read from property}}
}