diff options
Diffstat (limited to 'clang/test/SemaCXX/explicit.cpp')
| -rw-r--r-- | clang/test/SemaCXX/explicit.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/explicit.cpp b/clang/test/SemaCXX/explicit.cpp index a3902e5d10f..58760d347f0 100644 --- a/clang/test/SemaCXX/explicit.cpp +++ b/clang/test/SemaCXX/explicit.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s + namespace Constructor { struct A { A(int); @@ -34,6 +36,21 @@ B &&b3(0); // expected-error {{could not bind}} B b4{0}; B &&b5 = {0}; // expected-error {{chosen constructor is explicit}} B &&b6{0}; + +struct S { + template <bool b = true> + explicit S(); +}; + +struct T : S { + // T(); +}; + +struct U : T { + U(); +}; +U::U() {} + } namespace Conversion { @@ -183,7 +200,8 @@ namespace Conversion { const int ©List7 = {b}; const int ©List8 = {n}; // expected-error {{no viable conversion}} } - + +#if __cplusplus < 201707L void testNew() { // 5.3.4p6: @@ -200,7 +218,8 @@ namespace Conversion { new int[i]; new int[ni]; // expected-error {{array size expression of type 'NotInt' requires explicit conversion to type 'int'}} } - +#endif + void testDelete() { // 5.3.5pp2: |

