diff options
| author | Larisse Voufo <lvoufo@google.com> | 2013-06-15 20:17:46 +0000 |
|---|---|---|
| committer | Larisse Voufo <lvoufo@google.com> | 2013-06-15 20:17:46 +0000 |
| commit | 0f1394c86eb68f0390fee4bef987e9ea4451a757 (patch) | |
| tree | 0415b7d9e4db92250a883e5434b4de44fa5d0118 /clang/test/SemaCXX/cxx98-compat-pedantic.cpp | |
| parent | c5f290f6c6159d1a90974455af5738c8109e2159 (diff) | |
| download | bcm5719-llvm-0f1394c86eb68f0390fee4bef987e9ea4451a757.tar.gz bcm5719-llvm-0f1394c86eb68f0390fee4bef987e9ea4451a757.zip | |
Updated the support for contextual conversion tweaks (n3323) with a previously overlooked part: implicitly converting array sizes to size_t, rather than contextually converting them to some unique type.
llvm-svn: 184048
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat-pedantic.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx98-compat-pedantic.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat-pedantic.cpp b/clang/test/SemaCXX/cxx98-compat-pedantic.cpp index 0b18ae4f221..d1bb437df59 100644 --- a/clang/test/SemaCXX/cxx98-compat-pedantic.cpp +++ b/clang/test/SemaCXX/cxx98-compat-pedantic.cpp @@ -1,10 +1,10 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat-pedantic -verify %s -// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat -Werror %s +// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat-pedantic -verify %s -DCXX1Y2 +// RUN: %clang_cc1 -fsyntax-only -std=c++1y -DCXX1Y -Wc++98-compat -Werror %s -DCXX1Y2 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat-pedantic -verify %s // RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -Werror %s // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Werror %s -// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++98-compat-pedantic -verify %s -Wno-c++98-c++11-compat-pedantic +// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++98-compat-pedantic -verify %s -Wno-c++98-c++11-compat-pedantic -DCXX1Y2 // -Wc++98-compat-pedantic warns on C++11 features which we accept without a // warning in C++98 mode. @@ -32,7 +32,12 @@ void *FnVoidPtr = (void*)&dlsym; // expected-warning {{cast between pointer-to-f struct ConvertToInt { operator int(); }; -int *ArraySizeConversion = new int[ConvertToInt()]; // expected-warning {{implicit conversion from array size expression of type 'ConvertToInt' to integral type 'int' is incompatible with C++98}} +int *ArraySizeConversion = new int[ConvertToInt()]; +#ifdef CXX1Y2 +// expected-warning@-2 {{implicit conversion from array size expression of type 'ConvertToInt' to integral type 'unsigned long' is incompatible with C++98}} +#else +// expected-warning@-4 {{implicit conversion from array size expression of type 'ConvertToInt' to integral type 'int' is incompatible with C++98}} +#endif template<typename T> class ExternTemplate {}; extern template class ExternTemplate<int>; // expected-warning {{extern templates are incompatible with C++98}} |

