@@ -640,3 +640,48 @@ namespace H {
640640 struct S s;
641641}
642642}
643+
644+ namespace cwg1898 { // cwg1898: 2.7
645+ void e (int ) {} // #cwg1898-e-int
646+ void e (int ) {}
647+ // expected-error@-1 {{redefinition of 'e'}}
648+ // expected-note@#cwg1898-e-int {{previous definition is here}}
649+ void e (long ) {}
650+
651+ void f (int ) {} // #cwg1898-f-int
652+ void f (const int ) {}
653+ // expected-error@-1 {{redefinition of 'f'}}
654+ // expected-note@#cwg1898-f-int {{previous definition is here}}
655+
656+ void g (int ) {} // #cwg1898-g-int
657+ void g (volatile int ) {}
658+ // since-cxx20-warning@-1 {{volatile-qualified parameter type 'volatile int' is deprecated}}
659+ // expected-error@-2 {{redefinition of 'g'}}
660+ // expected-note@#cwg1898-g-int {{previous definition is here}}
661+
662+ void h (int *) {} // #cwg1898-h-int
663+ void h (int []) {}
664+ // expected-error@-1 {{redefinition of 'h'}}
665+ // expected-note@#cwg1898-h-int {{previous definition is here}}
666+
667+ void i (int *) {} // #cwg1898-i-int
668+ void i (int [2 ]) {}
669+ // expected-error@-1 {{redefinition of 'i'}}
670+ // expected-note@#cwg1898-i-int {{previous definition is here}}
671+
672+ void j (void (*)()) {} // #cwg1898-j-int
673+ void j (void ()) {}
674+ // expected-error@-1 {{redefinition of 'j'}}
675+ // expected-note@#cwg1898-j-int {{previous definition is here}}
676+
677+ struct A {
678+ void k (int ) {} // #cwg1898-k-int
679+ void k (int ) {}
680+ // expected-error@-1 {{class member cannot be redeclared}}
681+ // expected-note@#cwg1898-k-int {{previous definition is here}}
682+ };
683+
684+ struct B : A {
685+ void k (int ) {}
686+ };
687+ } // namespace cwg1898
0 commit comments