summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/new-array-size-conv.cpp
diff options
context:
space:
mode:
authorCharles Li <charles_li@playstation.sony.com>2015-11-11 19:34:47 +0000
committerCharles Li <charles_li@playstation.sony.com>2015-11-11 19:34:47 +0000
commit542f04cc4d53cf3effd96a633205adbb022dc245 (patch)
treec0b928779c175c4f57339986a512dc4cabf3bf20 /clang/test/SemaCXX/new-array-size-conv.cpp
parent99f23473a18ccdcdaeb50883da15aa606b8f1ddf (diff)
downloadbcm5719-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/new-array-size-conv.cpp')
-rw-r--r--clang/test/SemaCXX/new-array-size-conv.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/new-array-size-conv.cpp b/clang/test/SemaCXX/new-array-size-conv.cpp
index c987c2820ad..dbdd4bd8951 100644
--- a/clang/test/SemaCXX/new-array-size-conv.cpp
+++ b/clang/test/SemaCXX/new-array-size-conv.cpp
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -pedantic -verify -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -pedantic -verify -std=c++11 %s
struct ValueInt
{
@@ -20,8 +22,15 @@ struct TwoValueInts : ValueInt, IndirectValueInt { }; // expected-warning{{direc
void test() {
- (void)new int[ValueInt(10)]; // expected-warning{{implicit conversion from array size expression of type 'ValueInt' to integral type 'int' is a C++11 extension}}
- (void)new int[ValueEnum()]; // expected-warning{{implicit conversion from array size expression of type 'ValueEnum' to enumeration type 'E' is a C++11 extension}}
+ (void)new int[ValueInt(10)];
+#if __cplusplus <= 199711L // C++03 or earlier modes
+ // expected-warning@-2{{implicit conversion from array size expression of type 'ValueInt' to integral type 'int' is a C++11 extension}}
+#endif
+
+ (void)new int[ValueEnum()];
+#if __cplusplus <= 199711L
+// expected-warning@-2{{implicit conversion from array size expression of type 'ValueEnum' to enumeration type 'E' is a C++11 extension}}
+#endif
(void)new int[ValueBoth()]; // expected-error{{ambiguous conversion of array size expression of type 'ValueBoth' to an integral or enumeration type}}
(void)new int[TwoValueInts()]; // expected-error{{ambiguous conversion of array size expression of type 'TwoValueInts' to an integral or enumeration type}}
OpenPOWER on IntegriCloud