summaryrefslogtreecommitdiff
path: root/test/Preprocessor/macro_paste_bad.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-19 20:29:42 +0000
committerChris Lattner <sabre@nondot.org>2009-04-19 20:29:42 +0000
commit332ee08e2fe78fde281e0868ec039b546cb6e0f4 (patch)
tree7f9edd49ac0a8e977449dcc1aa2dc01c67fc9587 /test/Preprocessor/macro_paste_bad.c
parentf22f77f4e9149499a987e2363a0be01d0bc2d426 (diff)
downloadclang-332ee08e2fe78fde281e0868ec039b546cb6e0f4.tar.gz
move token paste poisoning diagnostics to after the instantiation loc
for a token is set, this makes the diagnostic "expanded from stack" work for this diagnostic. Add a testcase for PR3918. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor/macro_paste_bad.c')
-rw-r--r--test/Preprocessor/macro_paste_bad.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Preprocessor/macro_paste_bad.c b/test/Preprocessor/macro_paste_bad.c
index f70c3b3ba2..b43d70b0c4 100644
--- a/test/Preprocessor/macro_paste_bad.c
+++ b/test/Preprocessor/macro_paste_bad.c
@@ -18,3 +18,16 @@ XYZ
#define i ## // expected-error {{'##' cannot appear at start of macro expansion}}
#define j() ## // expected-error {{'##' cannot appear at start of macro expansion}}
+// Invalid token pasting.
+// PR3918
+
+// When pasting creates poisoned identifiers, we error.
+#pragma GCC poison BLARG
+BLARG // expected-error {{attempt to use a poisoned identifier}}
+#define XX BL ## ARG
+XX // expected-error {{attempt to use a poisoned identifier}}
+
+#define VA __VA_ ## ARGS__
+int VA; // expected-warning {{__VA_ARGS__ can only appear in the expansion of a C99 variadic macro}}
+
+