Skip to content
Commit f7d563c7 authored by Akira Hatanaka's avatar Akira Hatanaka
Browse files

[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

llvm-svn: 287410
parent eb4a0cb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment