summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2016-12-01 17:52:39 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2016-12-01 17:52:39 +0000
commit8a36ace5b12358a23b2d91ab197d4a7812561a59 (patch)
tree0dea2ee88e933c3dadc02ffe789d4b739b5a0acb /clang/test
parentc962c6ac3bfd3eee9f54d2f9533e289ca094cc8a (diff)
downloadbcm5719-llvm-8a36ace5b12358a23b2d91ab197d4a7812561a59.tar.gz
bcm5719-llvm-8a36ace5b12358a23b2d91ab197d4a7812561a59.zip
[TableGen] Ignore fake args for parsing-related arg counts.
We should complain about the following: ``` void foo() __attribute__((unavailable("a", "b"))); ``` Instead, we currently just ignore "b". (...We also end up ignoring "a", because we assume elsewhere that this attribute can only have 1 or 0 args.) This happens because `unavailable` has a fake enum arg, and `AttributeList::{getMinArgs,getMaxArgs}` include fake args in their counts. llvm-svn: 288388
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/attr-unavailable-message.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Sema/attr-unavailable-message.c b/clang/test/Sema/attr-unavailable-message.c
index 400a2c63288..415cb2f079a 100644
--- a/clang/test/Sema/attr-unavailable-message.c
+++ b/clang/test/Sema/attr-unavailable-message.c
@@ -1,6 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar: //6734520
+void tooManyArgs() __attribute__((unavailable("a", "b"))); // expected-error {{'unavailable' attribute takes no more than 1 argument}}
+
int foo(int) __attribute__((__unavailable__("USE IFOO INSTEAD"))); // expected-note {{'foo' has been explicitly marked unavailable here}}
double dfoo(double) __attribute__((__unavailable__("NO LONGER"))); // expected-note 2 {{'dfoo' has been explicitly marked unavailable here}}
OpenPOWER on IntegriCloud