|
1 | 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 %s |
6 | | -// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected %s |
7 | | -// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected %s |
| 2 | +// RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected,since-cxx11 %s |
| 3 | +// RUN: %clang_cc1 -std=c++14 -pedantic-errors -verify=expected,since-cxx11 %s |
| 4 | +// RUN: %clang_cc1 -std=c++17 -pedantic-errors -verify=expected,since-cxx11 %s |
| 5 | +// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify=expected,since-cxx11,since-cxx20 %s |
| 6 | +// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,since-cxx11,since-cxx20,since-cxx23 %s |
| 7 | +// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected,since-cxx11,since-cxx20,since-cxx23,since-cxx26 %s |
| 8 | + |
| 9 | +// cxx98-no-diagnostics |
8 | 10 |
|
9 | 11 | namespace cwg2913 { // cwg2913: 20 |
10 | 12 |
|
@@ -35,21 +37,25 @@ struct A { |
35 | 37 | } // namespace cwg2915 |
36 | 38 |
|
37 | 39 | namespace cwg2917 { // cwg2917: 20 review 2024-07-30 |
| 40 | +#if __cplusplus >= 201103L |
38 | 41 | template <typename> |
39 | 42 | class Foo; |
40 | 43 |
|
41 | | -template<class ...> // cxx98-error {{variadic templates are a C++11 extension}} |
| 44 | +template<class ...> |
42 | 45 | struct C { |
43 | 46 | struct Nested { }; |
44 | 47 | }; |
45 | 48 |
|
46 | 49 | struct S { |
47 | 50 | template <typename> |
48 | | - friend class Foo, int; // expected-error {{a friend declaration that befriends a template must contain exactly one type-specifier}} |
| 51 | + friend class Foo, int; |
| 52 | + // since-cxx11-error@-1 {{a friend declaration that befriends a template must contain exactly one type-specifier}} |
49 | 53 |
|
50 | | - template <typename ...Ts> // cxx98-error {{variadic templates are a C++11 extension}} |
51 | | - friend class C<Ts>::Nested...; // expected-error {{friend declaration expands pack 'Ts' that is declared it its own template parameter list}} |
| 54 | + template <typename ...Ts> |
| 55 | + friend class C<Ts>::Nested...; |
| 56 | + // since-cxx11-error@-1 {{friend declaration expands pack 'Ts' that is declared it its own template parameter list}} |
52 | 57 | }; |
| 58 | +#endif |
53 | 59 | } // namespace cwg2917 |
54 | 60 |
|
55 | 61 | #if __cplusplus > 202302L |
|
0 commit comments