Allow "overloadable" functions in C to be declared as variadic without
any named parameters, e.g., this is accepted in C:
void f(...) __attribute__((overloadable));
although this would be rejected:
void f(...);
To do this, moved the checking of the "ellipsis without any named
arguments" condition from the parser into Sema (where it belongs anyway).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64902 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/overloadable.c b/test/Sema/overloadable.c
index 136f8e9..22ced49 100644
--- a/test/Sema/overloadable.c
+++ b/test/Sema/overloadable.c
@@ -42,9 +42,12 @@
long double promote(long double) __attribute__((__overloadable__));
void promote() __attribute__((__overloadable__)); // expected-error{{'overloadable' function 'promote' must have a prototype}}
+void promote(...) __attribute__((__overloadable__, __unavailable__)); // \
+ // expected-note{{unavailable function is declared here}}
void test_promote(short* sp) {
promote(1.0);
+ promote(sp); // expected-error{{call to function 'promote' that has been intentionally made unavailable}}
}