forked from OSchip/llvm-project
Ensure that any TypoExprs in the arguments to bultins with custom type
checking are handled before the custom type checking is performed. Fixes PR21669. llvm-svn: 222797
This commit is contained in:
parent
371417db34
commit
443d61d62a
|
@ -4752,8 +4752,12 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
|
|||
VK_RValue, RParenLoc);
|
||||
|
||||
// Bail out early if calling a builtin with custom typechecking.
|
||||
if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID))
|
||||
return CheckBuiltinFunctionCall(FDecl, BuiltinID, TheCall);
|
||||
if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) {
|
||||
ExprResult Res = CorrectDelayedTyposInExpr(TheCall);
|
||||
if (!Res.isUsable() || !isa<CallExpr>(Res.get()))
|
||||
return Res;
|
||||
return CheckBuiltinFunctionCall(FDecl, BuiltinID, cast<CallExpr>(Res.get()));
|
||||
}
|
||||
|
||||
retry:
|
||||
const FunctionType *FuncT;
|
||||
|
|
|
@ -93,3 +93,12 @@ void f(NestedNode *node) {
|
|||
NestedNode *next = node->Next(); // expected-error-re {{no member named 'Next' in 'initializerCorrections::NestedNode'{{$}}}}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR21669 {
|
||||
void f(int *i) {
|
||||
// Check that arguments to a builtin with custom type checking are corrected
|
||||
// properly, since calls to such builtins bypass much of the normal code path
|
||||
// for building and checking the call.
|
||||
__atomic_load(i, i, something_something); // expected-error-re {{use of undeclared identifier 'something_something'{{$}}}}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue