summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/explicit5.C
blob: 88a47071db12edb1d3bde8774db7a816923d1474 (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
// test for extension of DR 899 to handle template ctors
// { dg-options "-std=c++0x" }
// { dg-do run }

int r = 1;

struct C {
  C() { }
  template <class T = int> C(C&, T = 0) { r = 0; }
};

C c;

struct A
{
  explicit operator C&() const { return c; }
};

int main()
{
  A a;
  C c2 (a);

  return r;
}