diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2017-01-09 22:43:16 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2017-01-09 22:43:16 +0000 |
commit | 7490caa65f86ab51944be20cf00b4a7cf175670a (patch) | |
tree | dac0f901ddd798e4344602aa3df763deb15c1c63 | |
parent | 9a6a1cb410520ec5f246ef757d6eb7135403e1e7 (diff) |
Add a test for diagnose_if.
Forgot to add this file as a part of r291418.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291493 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaCXX/diagnose_if-ext.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/diagnose_if-ext.cpp b/test/SemaCXX/diagnose_if-ext.cpp new file mode 100644 index 0000000000..d5625b5013 --- /dev/null +++ b/test/SemaCXX/diagnose_if-ext.cpp @@ -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 |