diff options
author | Charles Li <charles.li@sony.com> | 2017-02-24 22:22:05 +0000 |
---|---|---|
committer | Charles Li <charles.li@sony.com> | 2017-02-24 22:22:05 +0000 |
commit | 9ea0817c5ac5fa59bb56dc78eb335f074e33a2c8 (patch) | |
tree | e6b5c665e6b2a8b5808ebbfe2dcf96a96652d3cb /clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp | |
parent | 018d13597acdcfcec0144076a9d546dcdd30803b (diff) | |
download | bcm5719-llvm-9ea0817c5ac5fa59bb56dc78eb335f074e33a2c8.tar.gz bcm5719-llvm-9ea0817c5ac5fa59bb56dc78eb335f074e33a2c8.zip |
[Test] Make Lit tests C++11 compatible #9
[Test] Make Lit tests C++11 compatible #9
Differential Revision: https://reviews.llvm.org/D20710
llvm-svn: 296184
Diffstat (limited to 'clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp')
-rw-r--r-- | clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp b/clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp index 223500eac48..29fd15e3957 100644 --- a/clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp +++ b/clang/test/SemaTemplate/value-dependent-null-pointer-constant.cpp @@ -1,17 +1,30 @@ -// RUN: %clang_cc1 -fsyntax-only %s +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s template<typename T, int N> struct X0 { const char *f0(bool Cond) { return Cond? "honk" : N; +#if __cplusplus >= 201103L +// expected-error@-2 {{incompatible operand types ('const char *' and 'int')}} +#else +// expected-no-diagnostics +#endif } const char *f1(bool Cond) { return Cond? N : "honk"; +#if __cplusplus >= 201103L +// expected-error@-2 {{incompatible operand types ('int' and 'const char *')}} +#endif } bool f2(const char *str) { return str == N; +#if __cplusplus >= 201103L +// expected-error@-2 {{comparison between pointer and integer ('const char *' and 'int')}} +#endif } }; |