Skip to content

Commit 2bd18fb

Browse files
Endilllpaulhuggett
authored andcommitted
[clang][NFC] Stop testing CWG2917 in C++98 mode
1 parent 5c7e77f commit 2bd18fb

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

clang/test/CXX/drs/cwg29xx.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// 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
810

911
namespace cwg2913 { // cwg2913: 20
1012

@@ -35,21 +37,25 @@ struct A {
3537
} // namespace cwg2915
3638

3739
namespace cwg2917 { // cwg2917: 20 review 2024-07-30
40+
#if __cplusplus >= 201103L
3841
template <typename>
3942
class Foo;
4043

41-
template<class ...> // cxx98-error {{variadic templates are a C++11 extension}}
44+
template<class ...>
4245
struct C {
4346
struct Nested { };
4447
};
4548

4649
struct S {
4750
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}}
4953

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}}
5257
};
58+
#endif
5359
} // namespace cwg2917
5460

5561
#if __cplusplus > 202302L

0 commit comments

Comments
 (0)