r291493 - Add a test for diagnose_if.
George Burgess IV via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 9 14:43:16 PST 2017
Author: gbiv
Date: Mon Jan 9 16:43:16 2017
New Revision: 291493
URL: http://llvm.org/viewvc/llvm-project?rev=291493&view=rev
Log:
Add a test for diagnose_if.
Forgot to add this file as a part of r291418.
Added:
cfe/trunk/test/SemaCXX/diagnose_if-ext.cpp
Added: cfe/trunk/test/SemaCXX/diagnose_if-ext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/diagnose_if-ext.cpp?rev=291493&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/diagnose_if-ext.cpp (added)
+++ cfe/trunk/test/SemaCXX/diagnose_if-ext.cpp Mon Jan 9 16:43:16 2017
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -Wpedantic -fsyntax-only %s -verify
+
+void foo() __attribute__((diagnose_if(1, "", "error"))); // expected-warning{{'diagnose_if' is a clang extension}}
+void foo(int a) __attribute__((diagnose_if(a, "", "error"))); // expected-warning{{'diagnose_if' is a clang extension}}
+// FIXME: When diagnose_if gets a CXX11 spelling, this should be enabled.
+#if 0
+[[clang::diagnose_if(a, "", "error")]] void foo(double a);
+#endif
More information about the cfe-commits
mailing list