* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / explicit2.C
blob715855cfe98893b2f349bcfd4ab52c28c0e1a54c
1 // Test for explicit conversion ops in various conversion situations.
2 // { dg-do compile { target c++11 } }
4 typedef void (*pfn)();
6 struct A
8   explicit operator int() const;
9   explicit operator pfn() const;
12 int main()
14   A a;
15   int i = a;                    // { dg-error "" }
16   const int &ir = a;            // { dg-error "" }
17   a();                          // { dg-error "" }
18   a + 1;                        // { dg-message "" } (error and note on same line)
20   int j (a);
21   (int)a;
22   static_cast<int>(a);
25 struct B
27   int i;
28   B(const A& a): i(a) { }