forked from OSchip/llvm-project
Force the correction of delayed typos in casts in non-C++ code.
Fixes PR21656, which is fallout from r222551 caused by an untested/missed code path. llvm-svn: 222694
This commit is contained in:
parent
074bbb698d
commit
13da33fdfe
|
@ -5299,6 +5299,12 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
|
|||
if (getLangOpts().CPlusPlus) {
|
||||
// Check that there are no default arguments (C++ only).
|
||||
CheckExtraCXXDefaultArguments(D);
|
||||
} else {
|
||||
// Make sure any TypoExprs have been dealt with.
|
||||
ExprResult Res = CorrectDelayedTyposInExpr(CastExpr);
|
||||
if (!Res.isUsable())
|
||||
return ExprError();
|
||||
CastExpr = Res.get();
|
||||
}
|
||||
|
||||
checkUnusedDeclAttributes(D);
|
||||
|
|
|
@ -4,3 +4,8 @@
|
|||
// than in C++ and may exhibit different behavior as a result.
|
||||
|
||||
__typeof__(struct F*) var[invalid]; // expected-error-re {{use of undeclared identifier 'invalid'{{$}}}}
|
||||
|
||||
void PR21656() {
|
||||
float x;
|
||||
x = (float)arst; // expected-error-re {{use of undeclared identifier 'arst'{{$}}}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue