diff options
author | John McCall <rjmccall@apple.com> | 2011-08-10 04:12:23 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-08-10 04:12:23 +0000 |
commit | a19950edd94c1b80e73c9f45d821b125bd0ee72f (patch) | |
tree | f83d1f0b3455212c3673400eddeb8940ed59c10b /test/SemaCXX/unknown-anytype.cpp | |
parent | e7d002041dc60521f237b4219fd4167d1fe67aa7 (diff) | |
download | clang-a19950edd94c1b80e73c9f45d821b125bd0ee72f.tar.gz |
Change an assert into a check. I'm pretty sure there was a point
in time when this assert was valid, but it's not valid now.
Also teach this code to correctly introduce function-to-pointer
decay.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137201 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/unknown-anytype.cpp')
-rw-r--r-- | test/SemaCXX/unknown-anytype.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/unknown-anytype.cpp b/test/SemaCXX/unknown-anytype.cpp index b0a2981f47..ba52122bc4 100644 --- a/test/SemaCXX/unknown-anytype.cpp +++ b/test/SemaCXX/unknown-anytype.cpp @@ -34,3 +34,14 @@ namespace test3 { ((void(void)) foo)(); // expected-error {{variable 'foo' with unknown type cannot be given a function type}} } } + +// rdar://problem/9899447 +namespace test4 { + extern __unknown_anytype test0(...); + extern __unknown_anytype test1(...); + + void test() { + void (*fn)(int) = (void(*)(int)) test0; + int x = (int) test1; // expected-error {{function 'test1' with unknown type must be given a function type}} + } +} |