[Sema] Don't allow applying address-of operator to a call to a function
with __unknown_anytype return type.
When the following code is compiled, Sema infers that the type of
__unknown_anytype is double:
extern __unknown_anytype func();
double *d = (double*)&func();
This triggers an assert in CodeGenFunction::EmitCallExprLValue because
it doesn't expect to see a call to a function with a non-reference
scalar return type.
This commit prevents the assert by making VisitUnaryAddrOf error out if
the address-of operator is applied to a call to a function with
__unknown_anytype return type.
rdar://problem/20287610
Differential revision: https://reviews.llvm.org/D26808
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287410 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit ba16adfcc9d59b27fed49f6cfd839be35b10674a)
3 files changed