// Try to correct any TypoExprs in the initialization arguments.
for (size_t Idx = 0; Idx < Args.size(); ++Idx) {
ExprResult Res = CorrectDelayedTyposInExpr(
- Args[Idx], VDecl, /*RecoverUncorrectedTypos=*/false,
+ Args[Idx], VDecl, /*RecoverUncorrectedTypos=*/true,
[this, Entity, Kind](Expr *E) {
InitializationSequence Init(*this, Entity, Kind, MultiExprArg(E));
return Init.Failed() ? ExprError() : E;
// CHECK-NEXT: |-UnresolvedLookupExpr {{.*}} 'some_func'
// CHECK-NEXT: `-RecoveryExpr {{.*}} contains-errors
s = some_func(undef1);
- // CHECK: `-VarDecl {{.*}} invalid var 'int'
- // FIXME: preserve the broken call.
+
+ // CHECK: VarDecl {{.*}} var 'int'
+ // CHECK-NEXT: `-CallExpr {{.*}} '<dependent type>' contains-errors
+ // CHECK-NEXT: |-UnresolvedLookupExpr {{.*}} 'some_func'
+ // CHECK-NEXT: `-RecoveryExpr {{.*}} contains-errors
int var = some_func(undef1);
}
// CHECK-NEXT: `-UnresolvedLookupExpr {{.*}} 'invalid'
Bar b6 = Bar{invalid()};
- // CHECK: `-RecoveryExpr {{.*}} 'Bar' contains-errors
+ // CHECK: RecoveryExpr {{.*}} 'Bar' contains-errors
// CHECK-NEXT: `-IntegerLiteral {{.*}} 'int' 1
Bar(1);
+
+ // CHECK: `-VarDecl {{.*}} var1
+ // CHECK-NEXT: `-BinaryOperator {{.*}} '<dependent type>' contains-errors
+ // CHECK-NEXT: |-RecoveryExpr {{.*}} '<dependent type>' contains-errors
+ // CHECK-NEXT: `-IntegerLiteral {{.*}} 'int' 1
+ int var1 = undef + 1;
}
void InitializerForAuto() {
// CHECK: `-VarDecl {{.*}} invalid a 'auto'
}
namespace PR21905 {
-int (*a) () = (void)Z; // expected-error-re {{use of undeclared identifier 'Z'{{$}}}}
+int (*a)() = (void)Z; // expected-error-re {{use of undeclared identifier 'Z'{{$}}}} \
+ // expected-error {{cannot initialize a variable of type 'int (*)()' with an rvalue of type 'void'}}
}
namespace PR21947 {