This is needed to ensure the type casts are parsed properly. Fixes
PR23101.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236337
91177308-0d34-0410-b5e6-
96231b3b80d8
InMessageExpressionRAIIObject InMessage(*this, false);
Result = ParseExpression(MaybeTypeCast);
+ if (!getLangOpts().CPlusPlus && MaybeTypeCast && Result.isUsable()) {
+ // Correct typos in non-C++ code earlier so that implicit-cast-like
+ // expressions are parsed correctly.
+ Result = Actions.CorrectDelayedTyposInExpr(Result);
+ }
ExprType = SimpleExpr;
if (isFoldOperator(Tok.getKind()) && NextToken().is(tok::ellipsis))
_Generic(hello, int : banana)(); // expected-error-re {{use of undeclared identifier 'hello'{{$}}}}
_Generic(arg, int : bandana)(); // expected-error {{use of undeclared identifier 'bandana'; did you mean 'banana'?}}
}
+
+typedef long long __m128i __attribute__((__vector_size__(16)));
+int PR23101(__m128i __x) {
+ return foo((__v2di)__x); // expected-warning {{implicit declaration of function 'foo'}} \
+ // expected-error {{use of undeclared identifier '__v2di'}}
+}