|
1 | 1 | // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected,cxx98-14,cxx98 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
|
2 | 2 | // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify=expected,cxx98-14,cxx11-17,since-cxx11 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
|
3 |
| -// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify=expected,cxx98-14,cxx11-17,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
4 |
| -// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx17,cxx11-17,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
5 |
| -// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx17,since-cxx20,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
6 |
| -// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx17,since-cxx20,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
7 |
| -// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected,since-cxx17,since-cxx20,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
| 3 | +// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx14,cxx98-14,cxx11-17,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
| 4 | +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx14,since-cxx17,cxx11-17,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
| 5 | +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx14,since-cxx17,since-cxx20,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
| 6 | +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx14,since-cxx17,since-cxx20,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
| 7 | +// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected,since-cxx14,since-cxx17,since-cxx20,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors |
8 | 8 |
|
9 | 9 | #if __cplusplus == 199711L
|
10 | 10 | #define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
|
@@ -319,6 +319,41 @@ namespace dr1872 { // dr1872: 9
|
319 | 319 | #endif
|
320 | 320 | }
|
321 | 321 |
|
| 322 | +namespace dr1878 { // dr1878: 18 |
| 323 | +#if __cplusplus >= 201402L |
| 324 | +#if __cplusplus >= 202002L |
| 325 | +template <typename T> |
| 326 | +concept C = true; |
| 327 | +#endif |
| 328 | + |
| 329 | +struct S { |
| 330 | + template <typename T> |
| 331 | + operator auto() const { return short(); } |
| 332 | + // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}} |
| 333 | + template <typename T> |
| 334 | + operator const auto() const { return int(); } |
| 335 | + // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}} |
| 336 | + template <typename T> |
| 337 | + operator const auto&() const { return char(); } |
| 338 | + // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}} |
| 339 | + template <typename T> |
| 340 | + operator const auto*() const { return long(); } |
| 341 | + // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}} |
| 342 | + template <typename T> |
| 343 | + operator decltype(auto)() const { return unsigned(); } |
| 344 | + // since-cxx14-error@-1 {{'decltype(auto)' not allowed in declaration of conversion function template}} |
| 345 | +#if __cplusplus >= 202002L |
| 346 | + template <typename T> |
| 347 | + operator C auto() const { return float(); } |
| 348 | + // since-cxx20-error@-1 {{'auto' not allowed in declaration of conversion function template}} |
| 349 | + template <typename T> |
| 350 | + operator C decltype(auto)() const { return double(); } |
| 351 | + // since-cxx20-error@-1 {{'decltype(auto)' not allowed in declaration of conversion function template}} |
| 352 | +#endif |
| 353 | +}; |
| 354 | +#endif |
| 355 | +} |
| 356 | + |
322 | 357 | namespace dr1881 { // dr1881: 7
|
323 | 358 | struct A { int a : 4; };
|
324 | 359 | struct B : A { int b : 3; };
|
|
0 commit comments