Don't look through casts when looking for the underlying decl for a function
call; the standard doesn't expect us to, and the program could be doing something crazy. Fixes PR5882. llvm-svn: 92166
This commit is contained in:
parent
11c7b15148
commit
e14b1997db
|
@ -3373,7 +3373,7 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
|
|||
// Also, in C++, keep track of whether we should perform argument-dependent
|
||||
// lookup and whether there were any explicitly-specified template arguments.
|
||||
|
||||
Expr *NakedFn = Fn->IgnoreParenCasts();
|
||||
Expr *NakedFn = Fn->IgnoreParens();
|
||||
if (isa<UnresolvedLookupExpr>(NakedFn)) {
|
||||
UnresolvedLookupExpr *ULE = cast<UnresolvedLookupExpr>(NakedFn);
|
||||
return BuildOverloadedCallExpr(Fn, ULE, LParenLoc, Args, NumArgs,
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: %clang_cc1 -emit-llvm-only %s -verify
|
||||
// PR5882
|
||||
|
||||
int q_sk_num(void *a);
|
||||
typedef int (*fptr)(double);
|
||||
void a() { ((fptr)q_sk_num)(0); }
|
Loading…
Reference in New Issue