Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/using1.C

raw
1 // Test the CWG 2273 inheritedness tiebreaker doesn't apply to
2 // non-constructors.
3
4 struct A
5 {
6 void f(short,int=0);
7 void g(char,int=0);
8 };
9
10 struct B:A
11 {
12 using A::f;
13 void f(short);
14 using A::g;
15 void g(short);
16 };
17
18 int main()
19 {
20 B().f(1); // { dg-error "ambiguous" }
21 B().f(1,2); // OK, base f can still be called with two args
22 B().g(1); // { dg-error "ambiguous" }
23 }