summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/pr11159.C
blob: ed4107a230ba02f1a986e48e59c8ef6dcd4fa188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// PR c++/11159 : erroneous warning in copy ctor with virtual inheritance
// { dg-do compile }
// { dg-options "-Wall -Wextra" }
struct A
{
  A ();
};

struct B : virtual A
{
  B ();
};

struct C : virtual A
{
  C ();
};

struct D : B, C
{
  D (D const&){}
};

template <typename Base>
struct E : Base
{
  E ();

  E (E const &)
    : Base ()
  {
  };
};

E<C> foo;
E<C> bar (foo);