summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commit1c1a00cf51e5293e596e90d5c29a11c85197d996 (patch)
tree6e9330518b01e932d6838a5eea9e36f53059a5da /clang/test
parent08a375b9542cec2bfb065bc5332d6e7329cbcf20 (diff)
downloadbcm5719-llvm-1c1a00cf51e5293e596e90d5c29a11c85197d996.tar.gz
bcm5719-llvm-1c1a00cf51e5293e596e90d5c29a11c85197d996.zip
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. llvm-svn: 69544
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Preprocessor/macro_paste_bad.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/macro_paste_bad.c b/clang/test/Preprocessor/macro_paste_bad.c
index f70c3b3ba2e..b43d70b0c4e 100644
--- a/clang/test/Preprocessor/macro_paste_bad.c
+++ b/clang/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}}
+
+
OpenPOWER on IntegriCloud