diff options
author | Charles Li <charles_li@playstation.sony.com> | 2015-11-11 19:34:47 +0000 |
---|---|---|
committer | Charles Li <charles_li@playstation.sony.com> | 2015-11-11 19:34:47 +0000 |
commit | 542f04cc4d53cf3effd96a633205adbb022dc245 (patch) | |
tree | c0b928779c175c4f57339986a512dc4cabf3bf20 /clang/test/SemaCXX/convert-to-bool.cpp | |
parent | 99f23473a18ccdcdaeb50883da15aa606b8f1ddf (diff) | |
download | bcm5719-llvm-542f04cc4d53cf3effd96a633205adbb022dc245.tar.gz bcm5719-llvm-542f04cc4d53cf3effd96a633205adbb022dc245.zip |
[Lit Test] Updated 26 Lit tests to be C++11 compatible.
Expected diagnostics have been expanded to vary by C++ dialect.
RUN line has also been expanded to: default, C++98/03 and C++11.
llvm-svn: 252785
Diffstat (limited to 'clang/test/SemaCXX/convert-to-bool.cpp')
-rw-r--r-- | clang/test/SemaCXX/convert-to-bool.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/convert-to-bool.cpp b/clang/test/SemaCXX/convert-to-bool.cpp index b52f11c93d3..117b50899b7 100644 --- a/clang/test/SemaCXX/convert-to-bool.cpp +++ b/clang/test/SemaCXX/convert-to-bool.cpp @@ -1,4 +1,7 @@ // 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 + struct ConvToBool { operator bool() const; }; @@ -8,7 +11,10 @@ struct ConvToInt { }; struct ExplicitConvToBool { - explicit operator bool(); // expected-warning{{explicit conversion functions are a C++11 extension}} + explicit operator bool(); +#if __cplusplus <= 199711L // C++03 or earlier modes + // expected-warning@-2{{explicit conversion functions are a C++11 extension}} +#endif }; void test_conv_to_bool(ConvToBool ctb, ConvToInt cti, ExplicitConvToBool ecb) { @@ -39,7 +45,10 @@ void test_conv_to_bool(ConvToBool ctb, ConvToInt cti, ExplicitConvToBool ecb) { void accepts_bool(bool) { } // expected-note{{candidate function}} struct ExplicitConvToRef { - explicit operator int&(); // expected-warning{{explicit conversion functions are a C++11 extension}} + explicit operator int&(); +#if (__cplusplus <= 199711L) // C++03 or earlier modes + // expected-warning@-2{{explicit conversion functions are a C++11 extension}} +#endif }; void test_explicit_bool(ExplicitConvToBool ecb) { @@ -56,7 +65,10 @@ void test_explicit_conv_to_ref(ExplicitConvToRef ecr) { struct A { }; struct B { }; struct C { - explicit operator A&(); // expected-warning{{explicit conversion functions are a C++11 extension}} + explicit operator A&(); +#if __cplusplus <= 199711L // C++03 or earlier modes +// expected-warning@-2{{explicit conversion functions are a C++11 extension}} +#endif operator B&(); // expected-note{{candidate}} }; |