summaryrefslogtreecommitdiff
path: root/clang/test/Parser/diagnose_if.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Parser/diagnose_if.cpp')
-rw-r--r--clang/test/Parser/diagnose_if.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Parser/diagnose_if.cpp b/clang/test/Parser/diagnose_if.cpp
new file mode 100644
index 000000000000..52059804c9ef
--- /dev/null
+++ b/clang/test/Parser/diagnose_if.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -fsyntax-only -fcxx-exceptions -verify
+
+void t1() __attribute__((__diagnose_if__(baz))) try {} catch(...) {}
+// expected-error@-1 {{use of undeclared identifier 'baz'}}
+
+struct A {
+ A();
+};
+
+A::A() __attribute__((__diagnose_if__(baz))) :;
+// expected-error@-1 {{expected class member or base class name}}
+// expected-error@-2 {{use of undeclared identifier 'baz'}}