[BOLT] Add --pad-funcs-before=func:n (#117924)
[llvm-project.git] / clang / test / CXX / drs / cwg18xx.cpp
blob0fd2cd6b2d870c01339944798b98b1f4825eafda
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 // 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,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,cxx17 -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-cxx23,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-cxx23,since-cxx11,since-cxx14 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
9 #if __cplusplus == 199711L
10 #define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
11 // cxx98-error@-1 {{variadic macros are a C99 feature}}
12 #endif
14 namespace cwg1800 { // cwg1800: 2.9
15 struct A { union { int n; }; };
16 static_assert(__is_same(__decltype(&A::n), int A::*), "");
17 } // namespace cwg1800
19 namespace cwg1801 { // cwg1801: 2.8
20 static union {
21 int i;
24 template <int &> struct S {}; // #cwg1801-S
25 S<i> V; // #cwg1801-S-i
26 // cxx98-14-error@-1 {{non-type template argument does not refer to any declaration}}
27 // cxx98-14-note@#cwg1801-S {{template parameter is declared here}}
28 // cxx17-error@#cwg1801-S-i {{non-type template argument refers to subobject '.i'}}
31 namespace cwg1802 { // cwg1802: 3.1
32 #if __cplusplus >= 201103L
33 // Using a Wikipedia example of surrogate pair:
34 // https://en.wikipedia.org/wiki/UTF-16#Examples
35 constexpr char16_t a[3] = u"\U00010437";
36 static_assert(a[0] == 0xD801, "");
37 static_assert(a[1] == 0xDC37, "");
38 static_assert(a[2] == 0x0, "");
39 #endif
40 } // namespace cwg1802
42 namespace cwg1803 { // cwg1803: 2.9
43 #if __cplusplus >= 201103L
44 struct A {
45 enum E : int;
46 enum E : int {};
47 enum class EC;
48 enum class EC {};
49 enum struct ES;
50 enum struct ES {};
52 #endif
53 } // namespace cwg1803
55 namespace cwg1804 { // cwg1804: 2.7
56 template <typename, typename>
57 struct A {
58 void f1();
60 template <typename V>
61 void f2(V);
63 class B {
64 void f3();
67 template <typename>
68 class C {
69 void f4();
73 template <typename U>
74 struct A<int, U> {
75 void f1();
77 template <typename V>
78 void f2(V);
80 class B {
81 void f3();
84 template <typename>
85 class C {
86 void f4();
90 class D {
91 int i;
93 template <typename, typename>
94 friend struct A;
97 template <typename U>
98 struct A<double, U> {
99 void f1();
101 template <typename V>
102 void f2(V);
104 class B {
105 void f3();
108 template <typename>
109 class C {
110 void f4();
114 template <typename U>
115 void A<int, U>::f1() {
116 D d;
117 d.i = 0;
120 template <typename U>
121 void A<double, U>::f1() {
122 D d;
123 d.i = 0;
126 template <typename U>
127 template <typename V>
128 void A<int, U>::f2(V) {
129 D d;
130 d.i = 0;
133 template <typename U>
134 template <typename V>
135 void A<double, U>::f2(V) {
136 D d;
137 d.i = 0;
140 template <typename U>
141 void A<int, U>::B::f3() {
142 D d;
143 d.i = 0;
146 template <typename U>
147 void A<double, U>::B::f3() {
148 D d;
149 d.i = 0;
152 template <typename U>
153 template <typename V>
154 void A<int, U>::C<V>::f4() {
155 D d;
156 d.i = 0;
159 template <typename U>
160 template <typename V>
161 void A<double, U>::C<V>::f4() {
162 D d;
163 d.i = 0;
165 } // namespace cwg1804
167 // cwg1807 is in cwg1807.cpp
169 namespace cwg1812 { // cwg1812: no
170 // NB: dup 1710
171 #if __cplusplus >= 201103L
172 template <typename T> struct A {
173 using B = typename T::C<int>;
174 // since-cxx11-error@-1 {{use 'template' keyword to treat 'C' as a dependent template name}}
176 #endif
177 } // namespace cwg1812
179 namespace cwg1813 { // cwg1813: 7
180 struct B { int i; };
181 struct C : B {};
182 struct D : C {};
183 struct E : D { char : 4; };
185 static_assert(__is_standard_layout(B), "");
186 static_assert(__is_standard_layout(C), "");
187 static_assert(__is_standard_layout(D), "");
188 static_assert(!__is_standard_layout(E), "");
190 struct Q {};
191 struct S : Q {};
192 struct T : Q {};
193 struct U : S, T {};
195 static_assert(__is_standard_layout(Q), "");
196 static_assert(__is_standard_layout(S), "");
197 static_assert(__is_standard_layout(T), "");
198 static_assert(!__is_standard_layout(U), "");
201 namespace cwg1814 { // cwg1814: yes
202 #if __cplusplus >= 201103L
203 void test() {
204 auto lam = [](int x = 42) { return x; };
206 #endif
209 namespace cwg1815 { // cwg1815: 20
210 #if __cplusplus >= 201402L
211 struct A { int &&r = 0; };
212 A a = {};
214 struct B { int &&r = 0; }; // #cwg1815-B
215 // since-cxx14-error@-1 {{reference member 'r' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object}}
216 // since-cxx14-note@#cwg1815-B {{initializing field 'r' with default member initializer}}
217 // since-cxx14-note@#cwg1815-b {{in implicit default constructor for 'cwg1815::B' first required here}}
218 B b; // #cwg1815-b
220 #if __cplusplus >= 201703L
221 struct C { const int &r = 0; };
222 constexpr C c = {}; // OK, since cwg1815
223 static_assert(c.r == 0);
225 constexpr int f() {
226 A a = {}; // OK, since cwg1815
227 return a.r;
229 static_assert(f() == 0);
230 #endif
231 #endif
234 // cwg1818 is in cwg1818.cpp
236 namespace cwg1820 { // cwg1820: 3.5
237 typedef int A;
238 typedef int cwg1820::A;
239 // expected-warning@-1 {{extra qualification on member 'A'}}
240 // expected-error@-2 {{typedef declarator cannot be qualified}}
242 namespace B {
243 typedef int cwg1820::A;
244 // expected-error@-1 {{cannot define or redeclare 'A' here because namespace 'B' does not enclose namespace 'cwg1820'}}
245 // expected-error@-2 {{typedef declarator cannot be qualified}}
248 class C1 {
249 typedef int cwg1820::A;
250 // expected-error@-1 {{non-friend class member 'A' cannot have a qualified name}}
251 // expected-error@-2 {{typedef declarator cannot be qualified}}
254 template <typename>
255 class C2 {
256 typedef int cwg1820::A;
257 // expected-error@-1 {{non-friend class member 'A' cannot have a qualified name}}
258 // expected-error@-2 {{typedef declarator cannot be qualified}}
261 void d1() {
262 typedef int cwg1820::A;
263 // expected-error@-1 {{definition or redeclaration of 'A' not allowed inside a function}}
264 // expected-error@-2 {{typedef declarator cannot be qualified}}
267 template<typename>
268 void d2() {
269 typedef int cwg1820::A;
270 // expected-error@-1 {{definition or redeclaration of 'A' not allowed inside a function}}
271 // expected-error@-2 {{typedef declarator cannot be qualified}}
274 #if __cplusplus >= 201103L
275 auto e = [] {
276 typedef int cwg1820::A;
277 // expected-error@-1 {{definition or redeclaration of 'A' not allowed inside a function}}
278 // expected-error@-2 {{typedef declarator cannot be qualified}}
280 #endif
281 } // namespace cwg1820
283 namespace cwg1821 { // cwg1821: 2.9
284 struct A {
285 template <typename> struct B {
286 void f();
288 template <typename T> void B<T>::f(){};
289 // expected-error@-1 {{non-friend class member 'f' cannot have a qualified name}}
291 struct C {
292 void f();
294 void C::f() {}
295 // expected-error@-1 {{non-friend class member 'f' cannot have a qualified name}}
297 } // namespace cwg1821
299 namespace cwg1822 { // cwg1822: yes
300 #if __cplusplus >= 201103L
301 double a;
302 auto x = [] (int a) {
303 static_assert(__is_same(decltype(a), int), "should be resolved to lambda parameter");
305 #endif
308 namespace cwg1824 { // cwg1824: 2.7
309 template<typename T>
310 struct A {
311 T t;
314 struct S {
315 A<S> f() { return A<S>(); }
317 } // namespace cwg1824
319 namespace cwg1832 { // cwg1832: 3.0
320 enum E { // #cwg1832-E
321 a = static_cast<int>(static_cast<E>(0))
322 // expected-error@-1 {{'E' is an incomplete type}}
323 // expected-note@#cwg1832-E {{definition of 'cwg1832::E' is not complete until the closing '}'}}
326 #if __cplusplus >= 201103L
327 enum E2: decltype(static_cast<E2>(0), 0) {};
328 // expected-error@-1 {{unknown type name 'E2'}}
329 enum class E3: decltype(static_cast<E3>(0), 0) {};
330 // expected-error@-1 {{unknown type name 'E3'}}
331 #endif
332 } // namespace cwg1832
334 namespace cwg1837 { // cwg1837: 3.3
335 #if __cplusplus >= 201103L
336 template <typename T>
337 struct Fish { static const bool value = true; };
339 struct Other {
340 int p();
341 auto q() -> decltype(p()) *;
344 class Outer {
345 friend auto Other::q() -> decltype(this->p()) *;
346 // since-cxx11-error@-1 {{invalid use of 'this' outside of a non-static member function}}
347 int g();
348 int f() {
349 extern void f(decltype(this->g()) *);
350 struct Inner {
351 static_assert(Fish<decltype(this->g())>::value, "");
352 // since-cxx11-error@-1 {{invalid use of 'this' outside of a non-static member function}}
353 enum { X = Fish<decltype(this->f())>::value };
354 // since-cxx11-error@-1 {{invalid use of 'this' outside of a non-static member function}}
355 struct Inner2 : Fish<decltype(this->g())> { };
356 // since-cxx11-error@-1 {{invalid use of 'this' outside of a non-static member function}}
357 friend void f(decltype(this->g()) *);
358 // since-cxx11-error@-1 {{invalid use of 'this' outside of a non-static member function}}
359 friend auto Other::q() -> decltype(this->p()) *;
360 // since-cxx11-error@-1 {{invalid use of 'this' outside of a non-static member function}}
362 return 0;
366 struct A {
367 int f();
368 bool b = [] {
369 // since-cxx11-warning@-1 {{address of lambda function pointer conversion operator will always evaluate to 'true'}}
370 struct Local {
371 static_assert(sizeof(this->f()) == sizeof(int), "");
375 #endif
378 namespace cwg1862 { // cwg1862: no
379 template<class T>
380 struct A {
381 struct B {
382 void e();
385 void f();
387 struct D {
388 void g();
391 T h();
393 template<T U>
394 T i();
397 template<>
398 struct A<int> {
399 struct B {
400 void e();
403 int f();
405 struct D {
406 void g();
409 template<int U>
410 int i();
413 template<>
414 struct A<float*> {
415 int* h();
418 class C {
419 int private_int;
421 template<class T>
422 friend struct A<T>::B;
423 // expected-warning@-1 {{dependent nested name specifier 'A<T>::' for friend class declaration is not supported; turning off access control for 'C'}}
425 template<class T>
426 friend void A<T>::f();
427 // expected-warning@-1 {{dependent nested name specifier 'A<T>::' for friend class declaration is not supported; turning off access control for 'C'}}
429 // FIXME: this is ill-formed, because A<T>​::​D does not end with a simple-template-id
430 template<class T>
431 friend void A<T>::D::g();
432 // expected-warning@-1 {{dependent nested name specifier 'A<T>::D::' for friend class declaration is not supported; turning off access control for 'C'}}
434 template<class T>
435 friend int *A<T*>::h();
436 // expected-warning@-1 {{dependent nested name specifier 'A<T *>::' for friend class declaration is not supported; turning off access control for 'C'}}
438 template<class T>
439 template<T U>
440 friend T A<T>::i();
441 // expected-warning@-1 {{dependent nested name specifier 'A<T>::' for friend class declaration is not supported; turning off access control for 'C'}}
444 C c;
446 template<class T>
447 void A<T>::B::e() { (void)c.private_int; }
448 void A<int>::B::e() { (void)c.private_int; }
450 template<class T>
451 void A<T>::f() { (void)c.private_int; }
452 int A<int>::f() { (void)c.private_int; return 0; }
454 // FIXME: both definition of 'D::g' are not friends, so they don't have access to 'private_int'
455 template<class T>
456 void A<T>::D::g() { (void)c.private_int; }
457 void A<int>::D::g() { (void)c.private_int; }
459 template<class T>
460 T A<T>::h() { (void)c.private_int; }
461 int* A<float*>::h() { (void)c.private_int; return 0; }
463 template<class T>
464 template<T U>
465 T A<T>::i() { (void)c.private_int; }
466 template<int U>
467 int A<int>::i() { (void)c.private_int; }
468 } // namespace cwg1862
470 namespace cwg1872 { // cwg1872: 9
471 #if __cplusplus >= 201103L
472 template<typename T> struct A : T {
473 constexpr int f() const { return 0; }
475 struct X {};
476 struct Y { virtual int f() const; };
477 struct Z : virtual X {};
479 constexpr int x = A<X>().f();
480 constexpr int y = A<Y>().f();
481 // cxx11-17-error@-1 {{constexpr variable 'y' must be initialized by a constant expression}}
482 // cxx11-17-note@-2 {{cannot evaluate call to virtual function in a constant expression in C++ standards before C++20}}
483 #if __cplusplus >= 202002L
484 static_assert(y == 0);
485 #endif
486 // Note, this is invalid even though it would not use virtual dispatch.
487 constexpr int y2 = A<Y>().A<Y>::f();
488 // cxx11-17-error@-1 {{constexpr variable 'y2' must be initialized by a constant expression}}
489 // cxx11-17-note@-2 {{cannot evaluate call to virtual function in a constant expression in C++ standards before C++20}}
490 #if __cplusplus >= 202002L
491 static_assert(y == 0);
492 #endif
493 constexpr int z = A<Z>().f();
494 // since-cxx11-error@-1 {{constexpr variable 'z' must be initialized by a constant expression}}a
495 #if __cplusplus < 202302L
496 // since-cxx11-note@-3 {{non-literal type 'A<Z>' cannot be used in a constant expression}}
497 #else
498 // since-cxx23-note@-5 {{cannot construct object of type 'A<cwg1872::Z>' with virtual base class in a constant expression}}
499 #endif
500 #endif
503 namespace cwg1878 { // cwg1878: 18
504 #if __cplusplus >= 201402L
505 #if __cplusplus >= 202002L
506 template <typename T>
507 concept C = true;
508 #endif
510 struct S {
511 template <typename T>
512 operator auto() const { return short(); }
513 // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}}
514 template <typename T>
515 operator const auto() const { return int(); }
516 // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}}
517 template <typename T>
518 operator const auto&() const { return char(); }
519 // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}}
520 template <typename T>
521 operator const auto*() const { return long(); }
522 // since-cxx14-error@-1 {{'auto' not allowed in declaration of conversion function template}}
523 template <typename T>
524 operator decltype(auto)() const { return unsigned(); }
525 // since-cxx14-error@-1 {{'decltype(auto)' not allowed in declaration of conversion function template}}
526 #if __cplusplus >= 202002L
527 template <typename T>
528 operator C auto() const { return float(); }
529 // since-cxx20-error@-1 {{'auto' not allowed in declaration of conversion function template}}
530 template <typename T>
531 operator C decltype(auto)() const { return double(); }
532 // since-cxx20-error@-1 {{'decltype(auto)' not allowed in declaration of conversion function template}}
533 #endif
535 #endif
538 namespace cwg1881 { // cwg1881: 7
539 struct A { int a : 4; };
540 struct B : A { int b : 3; };
541 static_assert(__is_standard_layout(A), "");
542 static_assert(!__is_standard_layout(B), "");
544 struct C { int : 0; };
545 struct D : C { int : 0; };
546 static_assert(__is_standard_layout(C), "");
547 static_assert(!__is_standard_layout(D), "");
550 // cwg1884 is in cwg1884.cpp
552 namespace cwg1890 { // cwg1890: no drafting 2018-06-04
553 // FIXME: current consensus for CWG2335 is that the examples are well-formed.
554 namespace ex1 {
555 #if __cplusplus >= 201402L
556 struct A {
557 struct B {
558 auto foo() { return 0; } // #cwg1890-foo
560 decltype(B().foo()) x;
561 // since-cxx14-error@-1 {{function 'foo' with deduced return type cannot be used before it is defined}}
562 // since-cxx14-note@#cwg1890-foo {{'foo' declared here}}
564 #endif
565 } // namespace ex1
567 namespace ex2 {
568 #if __cplusplus >= 201103L
569 struct Bar {
570 struct Baz {
571 int a = 0;
573 static_assert(__is_constructible(Baz), "");
574 // since-cxx11-error@-1 {{static assertion failed due to requirement '__is_constructible(cwg1890::ex2::Bar::Baz)'}}
576 #endif
577 } // namespace ex2
578 } // namespace cwg1890
580 void cwg1891() { // cwg1891: 4
581 #if __cplusplus >= 201103L
582 int n;
583 auto a = []{}; // #cwg1891-a
584 auto b = [=]{ return n; }; // #cwg1891-b
585 typedef decltype(a) A;
586 typedef decltype(b) B;
588 static_assert(!__has_trivial_constructor(A), "");
589 // since-cxx20-error@-1 {{failed}}
590 static_assert(!__has_trivial_constructor(B), "");
592 // C++20 allows default construction for non-capturing lambdas (P0624R2).
593 A x;
594 // cxx11-17-error@-1 {{no matching constructor for initialization of 'A' (aka '(lambda at}}
595 // cxx11-17-note@#cwg1891-a {{candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided}}
596 // cxx11-17-note@#cwg1891-a {{candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided}}
597 B y;
598 // since-cxx11-error@-1 {{no matching constructor for initialization of 'B' (aka '(lambda at}}
599 // since-cxx11-note@#cwg1891-b {{candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided}}
600 // since-cxx11-note@#cwg1891-b {{candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided}}
602 // C++20 allows assignment for non-capturing lambdas (P0624R2).
603 a = a;
604 // cxx11-17-error-re@-1 {{{{object of type '\(lambda at .+\)' cannot be assigned because its copy assignment operator is implicitly deleted}}}}
605 // cxx11-17-note@#cwg1891-a {{lambda expression begins here}}
606 a = static_cast<A&&>(a);
607 // cxx11-17-error-re@-1 {{{{object of type '\(lambda at .+\)' cannot be assigned because its copy assignment operator is implicitly deleted}}}}
608 // cxx11-17-note@#cwg1891-a {{lambda expression begins here}}
609 b = b;
610 // since-cxx11-error-re@-1 {{{{object of type '\(lambda at .+\)' cannot be assigned because its copy assignment operator is implicitly deleted}}}}
611 // since-cxx11-note@#cwg1891-b {{lambda expression begins here}}
612 b = static_cast<B&&>(b);
613 // since-cxx11-error-re@-1 {{{{object of type '\(lambda at .+\)' cannot be assigned because its copy assignment operator is implicitly deleted}}}}
614 // since-cxx11-note@#cwg1891-b {{lambda expression begins here}}
615 #endif
618 namespace cwg1894 { // cwg1894: 3.8
619 // NB: reusing part of cwg407 test
620 namespace A {
621 struct S {};
623 namespace B {
624 typedef int S;
626 namespace E {
627 typedef A::S S;
628 using A::S;
629 struct S s;
631 namespace F {
632 typedef A::S S;
634 namespace G {
635 using namespace A;
636 using namespace F;
637 struct S s;
639 namespace H {
640 using namespace F;
641 using namespace A;
642 struct S s;
646 namespace cwg1898 { // cwg1898: 2.7
647 void e(int) {} // #cwg1898-e
648 void e(int) {}
649 // expected-error@-1 {{redefinition of 'e'}}
650 // expected-note@#cwg1898-e {{previous definition is here}}
652 void e2(int) {}
653 void e2(long) {} // OK, different type
655 void f(int) {} // #cwg1898-f
656 void f(const int) {}
657 // expected-error@-1 {{redefinition of 'f'}}
658 // expected-note@#cwg1898-f {{previous definition is here}}
660 void g(int) {} // #cwg1898-g
661 void g(volatile int) {}
662 // since-cxx20-warning@-1 {{volatile-qualified parameter type 'volatile int' is deprecated}}
663 // expected-error@-2 {{redefinition of 'g'}}
664 // expected-note@#cwg1898-g {{previous definition is here}}
666 void h(int *) {} // #cwg1898-h
667 void h(int[]) {}
668 // expected-error@-1 {{redefinition of 'h'}}
669 // expected-note@#cwg1898-h {{previous definition is here}}
671 void h2(int *) {} // #cwg1898-h2
672 void h2(int[2]) {}
673 // expected-error@-1 {{redefinition of 'h2'}}
674 // expected-note@#cwg1898-h2 {{previous definition is here}}
676 void h3(int (*)[2]) {} // #cwg1898-h3
677 void h3(int [3][2]) {}
678 // expected-error@-1 {{redefinition of 'h3'}}
679 // expected-note@#cwg1898-h3 {{previous definition is here}}
681 void h4(int (*)[2]) {}
682 void h4(int [3][3]) {} // OK, differ in non-top-level extent of array
684 void i(int *) {}
685 void i(const int *) {} // OK, pointee cv-qualification is not discarded
687 void i2(int *) {} // #cwg1898-i2
688 void i2(int * const) {}
689 // expected-error@-1 {{redefinition of 'i2'}}
690 // expected-note@#cwg1898-i2 {{previous definition is here}}
692 void j(void(*)()) {} // #cwg1898-j
693 void j(void()) {}
694 // expected-error@-1 {{redefinition of 'j'}}
695 // expected-note@#cwg1898-j {{previous definition is here}}
697 void j2(void(int)) {} // #cwg1898-j2
698 void j2(void(const int)) {}
699 // expected-error@-1 {{redefinition of 'j2'}}
700 // expected-note@#cwg1898-j2 {{previous definition is here}}
702 struct A {
703 void k(int) {} // #cwg1898-k
704 void k(int) {}
705 // expected-error@-1 {{class member cannot be redeclared}}
706 // expected-note@#cwg1898-k {{previous definition is here}}
709 struct B : A {
710 void k(int) {} // OK, shadows A::k
713 void l() {}
714 void l(...) {}
716 #if __cplusplus >= 201103L
717 template <typename T>
718 void m(T) {}
719 template <typename... Ts>
720 void m(Ts...) {}
722 template <typename T, typename U>
723 void m2(T, U) {}
724 template <typename... Ts, typename U>
725 void m2(Ts..., U) {}
726 #endif
727 } // namespace cwg1898