summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-03-12 14:28:38 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-03-12 14:28:38 +0000
commite4812148e13cbde16b24adaa261c42bdad52d80b (patch)
tree19af8e140b339a48791a787ba6140e260ac13d15 /clang/test/Sema
parente9f931f974ca72725836427f7f0d9f80ac7dee14 (diff)
downloadbcm5719-llvm-e4812148e13cbde16b24adaa261c42bdad52d80b.tar.gz
bcm5719-llvm-e4812148e13cbde16b24adaa261c42bdad52d80b.zip
Use Sema's PrintingPolicy when diagnosing DeclSpecs.
Sema overrides ASTContext's policy on the first emitted diagnostic (doesn't matter if it's ignored or not). This means changing the order of diagnostic emission in Sema suddenly changes the text of diagnostic emitted from the parser. In the test case -Wmissing-prototypes (ignored) was the culprit, use 'int main' to suppress that warning so we see when this regresses. Also move it into Sema/ as it's not testing any C++. llvm-svn: 232039
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/pr9812.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Sema/pr9812.c b/clang/test/Sema/pr9812.c
new file mode 100644
index 00000000000..14bc6c810e8
--- /dev/null
+++ b/clang/test/Sema/pr9812.c
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#define bool _Bool
+int main(int argc, char** argv)
+{
+ bool signed; // expected-error {{'bool' cannot be signed or unsigned}} expected-warning {{declaration does not declare anything}}
+
+ return 0;
+}
+#undef bool
+
+typedef int bool;
+
+int test2(int argc, char** argv)
+{
+ bool signed; // expected-error {{'type-name' cannot be signed or unsigned}} expected-warning {{declaration does not declare anything}}
+ _Bool signed; // expected-error {{'_Bool' cannot be signed or unsigned}} expected-warning {{declaration does not declare anything}}
+
+ return 0;
+}
+
OpenPOWER on IntegriCloud