summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-27 01:46:12 +0000
committerChris Lattner <sabre@nondot.org>2009-04-27 01:46:12 +0000
commit9a845896712365f3f1371eb28a7ea1d7e773d09c (patch)
treea1d8e27a318825fe05d5968db4e062503d727533 /clang/test/Preprocessor
parent05c1d372b770f812930915663e4fd8e315234808 (diff)
downloadbcm5719-llvm-9a845896712365f3f1371eb28a7ea1d7e773d09c.tar.gz
bcm5719-llvm-9a845896712365f3f1371eb28a7ea1d7e773d09c.zip
Change our silencing of C typedef redefinition handling to what we had
before r69391: typedef redefinition is an error by default, but if *either* the old or new definition are from a system header, we silence it. llvm-svn: 70177
Diffstat (limited to 'clang/test/Preprocessor')
-rw-r--r--clang/test/Preprocessor/line-directive.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/Preprocessor/line-directive.c b/clang/test/Preprocessor/line-directive.c
index 53e9ab7b5de..ed9a6c40e5d 100644
--- a/clang/test/Preprocessor/line-directive.c
+++ b/clang/test/Preprocessor/line-directive.c
@@ -41,12 +41,14 @@
# 192 "glomp.h" // not a system header.
typedef int x; // expected-note {{previous definition is here}}
-typedef int x; // expected-warning {{redefinition of typedef 'x' is invalid in C}}
+typedef int x; // expected-error {{redefinition of typedef 'x' is invalid in C}}
# 192 "glomp.h" 3 // System header.
typedef int y; // ok
typedef int y; // ok
+typedef int q; // q is in system header.
+
#line 42 "blonk.h" // doesn't change system headerness.
typedef int z; // ok
@@ -60,8 +62,9 @@ typedef int z1; // ok
# 42 "blonk.h" // DOES change system headerness.
typedef int w; // expected-note {{previous definition is here}}
-typedef int w; // expected-warning {{redefinition of typedef 'w' is invalid in C}}
+typedef int w; // expected-error {{redefinition of typedef 'w' is invalid in C}}
+typedef int q; // original definition in system header, should not diagnose.
// This should not produce an "extra tokens at end of #line directive" warning,
// because #line is allowed to contain expanded tokens.
OpenPOWER on IntegriCloud