aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/using1.C
blob: d8a045255795c99ef5085d7eb4bd0a2ce5358295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Test the CWG 2273 inheritedness tiebreaker doesn't apply to
// non-constructors.

struct A
{
  void f(short,int=0);
  void g(char,int=0);
};

struct B:A
{
  using A::f;
  void f(short);
  using A::g;
  void g(short);
};

int main()
{
  B().f(1);			// { dg-error "ambiguous" }
  B().f(1,2);			// OK, base f can still be called with two args
  B().g(1);			// { dg-error "ambiguous" }
}