diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-18 07:07:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-18 07:07:28 +0000 |
commit | 965acbb321e94e36aa5365126eee46b97745fdbb (patch) | |
tree | b90c16f0aedbfca9146e07251c896cd22d9fd9c6 /test/Sema/overloadable.c | |
parent | c6c16af963eddc3e9b75b5d2614d069e1162fe27 (diff) |
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
Diffstat (limited to 'test/Sema/overloadable.c')
-rw-r--r-- | test/Sema/overloadable.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Sema/overloadable.c b/test/Sema/overloadable.c index 136f8e93d7..22ced49b61 100644 --- a/test/Sema/overloadable.c +++ b/test/Sema/overloadable.c @@ -42,9 +42,12 @@ 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 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}} } |