summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/overloadable.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-18 06:34:51 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-18 06:34:51 +0000
commitb2809a0a1b07fa1ca9dbdab0bba5171adc7db476 (patch)
tree257017e4ce87e40a900a6c7331a010922615ae91 /clang/test/Sema/overloadable.c
parentd7670d9a96afef4e9fad2138b149520608d23741 (diff)
downloadbcm5719-llvm-b2809a0a1b07fa1ca9dbdab0bba5171adc7db476.tar.gz
bcm5719-llvm-b2809a0a1b07fa1ca9dbdab0bba5171adc7db476.zip
Don't allow calls to functions marked "unavailable". There's more work
to do in this area, since there are other places that reference FunctionDecls. Don't allow "overloadable" functions (in C) to be declared without a prototype. llvm-svn: 64897
Diffstat (limited to 'clang/test/Sema/overloadable.c')
-rw-r--r--clang/test/Sema/overloadable.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Sema/overloadable.c b/clang/test/Sema/overloadable.c
index afac7410709..136f8e93d7e 100644
--- a/clang/test/Sema/overloadable.c
+++ b/clang/test/Sema/overloadable.c
@@ -37,4 +37,14 @@ void test_struct(struct X x, struct Y y) {
double *f(int) __attribute__((overloadable)); // expected-error{{conflicting types for 'f'}}
+double promote(float) __attribute__((__overloadable__));
+double promote(double) __attribute__((__overloadable__));
+long double promote(long double) __attribute__((__overloadable__));
+
+void promote() __attribute__((__overloadable__)); // expected-error{{'overloadable' function 'promote' must have a prototype}}
+
+void test_promote(short* sp) {
+ promote(1.0);
+}
+
OpenPOWER on IntegriCloud