aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted37.C
blob: 1926f2eb4cc403eec67c80b8f237c7bfefbc0de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// DR 1402
// { dg-do compile { target c++11 } }

struct A
{
  A& operator=(A&&);
};

struct B: virtual A { B& operator=(B&&) = default; }; // { dg-warning "virtual base" }
struct C: virtual A { };			      // { dg-warning "virtual base" }

int main()
{
  B b1, b2;
  b2 = static_cast<B&&>(b1);

  C c1, c2;
  c2 = static_cast<C&&>(c1);
}