aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/conv12.C
blob: e6af05481d79c4937e90fb8c6faaef5a4a4653f1 (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
// PR c++/51079

#if __cplusplus > 199711L
struct C1
{
  template <class T>
  operator T() = delete;	// { dg-message "declared here" "" { target c++11 } }
  operator bool() { return false; }
} c1;

int ic1 = c1;			// { dg-error "deleted" "" { target c++11 } }
int ac1 = c1 + c1;		// { dg-error "deleted" "" { target c++11 } }
#endif

struct C2
{
private:
  template <class T>
  operator T();			// { dg-error "private" }
public:
  operator bool() { return false; }
} c2;

int ic2 = c2;			// { dg-error "" }
int ac2 = c2 + c2;		// { dg-error "" }