|
1 |
| -// RUN: %clang_cc1 -std=c++98 -verify=expected %s |
2 |
| -// RUN: %clang_cc1 -std=c++11 -verify=expected %s |
3 |
| -// RUN: %clang_cc1 -std=c++14 -verify=expected %s |
4 |
| -// RUN: %clang_cc1 -std=c++17 -verify=expected %s |
5 |
| -// RUN: %clang_cc1 -std=c++20 -verify=expected,since-cxx20 %s |
6 |
| -// RUN: %clang_cc1 -std=c++23 -verify=expected,since-cxx20,since-cxx23 %s |
7 |
| -// RUN: %clang_cc1 -std=c++2c -verify=expected,since-cxx20,since-cxx23,since-cxx26 %s |
| 1 | +// RUN: %clang_cc1 -std=c++98 -pedantic-errors -verify=expected,cxx98 %s |
| 2 | +// RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected %s |
| 3 | +// RUN: %clang_cc1 -std=c++14 -pedantic-errors -verify=expected %s |
| 4 | +// RUN: %clang_cc1 -std=c++17 -pedantic-errors -verify=expected %s |
| 5 | +// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify=expected,since-cxx20 %s |
| 6 | +// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,since-cxx20,since-cxx23 %s |
| 7 | +// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected,since-cxx20,since-cxx23,since-cxx26 %s |
8 | 8 |
|
9 | 9 | namespace cwg2819 { // cwg2819: 19 tentatively ready 2023-12-01
|
10 | 10 | #if __cpp_constexpr >= 202306L
|
@@ -110,6 +110,26 @@ struct A {
|
110 | 110 |
|
111 | 111 | } // namespace cwg2858
|
112 | 112 |
|
| 113 | +namespace cwg2877 { // cwg2877: no tentatively ready 2024-05-31 |
| 114 | +#if __cplusplus >= 202002L |
| 115 | +enum E { x }; |
| 116 | +void f() { |
| 117 | + int E; |
| 118 | + // FIXME: OK, names ::E |
| 119 | + using enum E; |
| 120 | + // since-cxx20-error@-1 {{unknown type name E}} |
| 121 | +} |
| 122 | +using F = E; |
| 123 | +using enum F; // OK, designates ::E |
| 124 | +template<class T> using EE = T; |
| 125 | +void g() { |
| 126 | + // FIXME: OK, designates ::E |
| 127 | + using enum EE<E>; |
| 128 | + // since-cxx20-error@-1 {{using enum requires an enum or typedef name}} |
| 129 | +} |
| 130 | +#endif |
| 131 | +} // namespace cwg2877 |
| 132 | + |
113 | 133 | namespace cwg2881 { // cwg2881: 19 tentatively ready 2024-04-19
|
114 | 134 |
|
115 | 135 | #if __cplusplus >= 202302L
|
@@ -180,3 +200,64 @@ void f() {
|
180 | 200 |
|
181 | 201 | } // namespace cwg2881
|
182 | 202 |
|
| 203 | +namespace cwg2882 { // cwg2882: 2.7 tentatively ready 2024-05-31 |
| 204 | +struct C { |
| 205 | + operator void() = delete; |
| 206 | + // expected-warning@-1 {{conversion function converting 'cwg2882::C' to 'void' will never be used}} |
| 207 | + // cxx98-error@-2 {{deleted function definitions are a C++11 extension}} |
| 208 | +}; |
| 209 | + |
| 210 | +void f(C c) { |
| 211 | + (void)c; |
| 212 | +} |
| 213 | +} // namespace cwg2882 |
| 214 | + |
| 215 | +namespace cwg2883 { // cwg2883: no tentatively ready 2024-05-31 |
| 216 | +#if __cplusplus >= 201103L |
| 217 | +void f() { |
| 218 | + int x; |
| 219 | + (void)[&] { |
| 220 | + return x; |
| 221 | + }; |
| 222 | +} |
| 223 | +#endif |
| 224 | +#if __cplusplus >= 202002L |
| 225 | +struct A { |
| 226 | + A() = default; |
| 227 | + A(const A &) = delete; // #cwg2883-A-copy-ctor |
| 228 | + constexpr operator int() { return 42; } |
| 229 | +}; |
| 230 | +void g() { |
| 231 | + constexpr A a; |
| 232 | + // FIXME: OK, not odr-usable from a default template argument, and not odr-used |
| 233 | + (void)[=]<typename T, int = a> {}; |
| 234 | + // since-cxx20-error@-1 {{call to deleted constructor of 'const A'}} |
| 235 | + // since-cxx20-note@#cwg2883-A-copy-ctor {{'A' has been explicitly marked deleted here}} |
| 236 | +} |
| 237 | +#endif |
| 238 | +} // namespace cwg2883 |
| 239 | + |
| 240 | +namespace cwg2885 { // cwg2885: 16 tentatively ready 2024-05-31 |
| 241 | +#if __cplusplus >= 202002L |
| 242 | +template <class T> |
| 243 | +struct A { |
| 244 | + A() requires (false) = default; |
| 245 | + A() : t(42) {} |
| 246 | + T t; |
| 247 | +}; |
| 248 | + |
| 249 | +struct B : A<int> {}; |
| 250 | +static_assert(!__is_trivially_constructible(B)); |
| 251 | +#endif |
| 252 | +} // namespace cwg2885 |
| 253 | + |
| 254 | +namespace cwg2886 { // cwg2886: 9 tentatively ready 2024-05-31 |
| 255 | +#if __cplusplus >= 201103L |
| 256 | +struct C { |
| 257 | + C() = default; |
| 258 | + ~C() noexcept(false) = default; |
| 259 | +}; |
| 260 | + |
| 261 | +static_assert(noexcept(C()), ""); |
| 262 | +#endif |
| 263 | +} // namespace cwg2886 |
0 commit comments