@@ -642,46 +642,69 @@ namespace H {
642642}
643643
644644namespace cwg1898 { // cwg1898: 2.7
645- void e (int ) {} // #cwg1898-e-int
645+ void e (int ) {} // #cwg1898-e
646646void e (int ) {}
647647// expected-error@-1 {{redefinition of 'e'}}
648- // expected-note@#cwg1898-e-int {{previous definition is here}}
649- void e (long ) {}
648+ // expected-note@#cwg1898-e {{previous definition is here}}
650649
651- void f (int ) {} // #cwg1898-f-int
650+ void e2 (int ) {}
651+ void e2 (long ) {} // OK, different type
652+
653+ void f (int ) {} // #cwg1898-f
652654void f (const int ) {}
653655// expected-error@-1 {{redefinition of 'f'}}
654- // expected-note@#cwg1898-f-int {{previous definition is here}}
656+ // expected-note@#cwg1898-f {{previous definition is here}}
655657
656- void g (int ) {} // #cwg1898-g-int
658+ void g (int ) {} // #cwg1898-g
657659void g (volatile int ) {}
658660// since-cxx20-warning@-1 {{volatile-qualified parameter type 'volatile int' is deprecated}}
659661// expected-error@-2 {{redefinition of 'g'}}
660- // expected-note@#cwg1898-g-int {{previous definition is here}}
662+ // expected-note@#cwg1898-g {{previous definition is here}}
661663
662- void h (int *) {} // #cwg1898-h-int
664+ void h (int *) {} // #cwg1898-h
663665void h (int []) {}
664666// expected-error@-1 {{redefinition of 'h'}}
665- // expected-note@#cwg1898-h-int {{previous definition is here}}
667+ // expected-note@#cwg1898-h {{previous definition is here}}
668+
669+ void h2 (int *) {} // #cwg1898-h2
670+ void h2 (int [2 ]) {}
671+ // expected-error@-1 {{redefinition of 'h2'}}
672+ // expected-note@#cwg1898-h2 {{previous definition is here}}
673+
674+ void h3 (int (*)[2]) {} // #cwg1898-h3
675+ void h3 (int [3 ][2 ]) {}
676+ // expected-error@-1 {{redefinition of 'h3'}}
677+ // expected-note@#cwg1898-h3 {{previous definition is here}}
678+
679+ void h4 (int (*)[2]) {}
680+ void h4 (int [3 ][3 ]) {} // OK, differ in non-top-level extent of array
666681
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}}
682+ void i (int *) {}
683+ void i (const int *) {} // OK, pointee cv-qualification is not discarded
671684
672- void j (void (*)()) {} // #cwg1898-j-int
685+ void i2 (int *) {} // #cwg1898-i2
686+ void i2 (int * const ) {}
687+ // expected-error@-1 {{redefinition of 'i2'}}
688+ // expected-note@#cwg1898-i2 {{previous definition is here}}
689+
690+ void j (void (*)()) {} // #cwg1898-j
673691void j (void ()) {}
674692// expected-error@-1 {{redefinition of 'j'}}
675- // expected-note@#cwg1898-j-int {{previous definition is here}}
693+ // expected-note@#cwg1898-j {{previous definition is here}}
694+
695+ void j2 (void (int )) {} // #cwg1898-j2
696+ void j2 (void (const int )) {}
697+ // expected-error@-1 {{redefinition of 'j2'}}
698+ // expected-note@#cwg1898-j2 {{previous definition is here}}
676699
677700struct A {
678- void k (int ) {} // #cwg1898-k-int
701+ void k (int ) {} // #cwg1898-k
679702 void k (int ) {}
680703 // expected-error@-1 {{class member cannot be redeclared}}
681- // expected-note@#cwg1898-k-int {{previous definition is here}}
704+ // expected-note@#cwg1898-k {{previous definition is here}}
682705};
683706
684707struct B : A {
685- void k (int ) {}
708+ void k (int ) {} // OK, shadows A::k
686709};
687710} // namespace cwg1898
0 commit comments