gcc/testsuite/g++.old-deja/g++.law/cvt23.C
raw| 1 | // { dg-do assemble } |
| 2 | // GROUPS passed conversions |
| 3 | // cvt file |
| 4 | // Message-Id: <[email protected]> |
| 5 | // From: [email protected] (Brad Daniels) |
| 6 | // Subject: Bug in g++ 2.4.5: Conversion operators to enumerated types don't wor |
| 7 | // Date: Thu, 5 Aug 93 12:09:09 CDT |
| 8 | |
| 9 | enum bar { AAA, BBB }; |
| 10 | |
| 11 | class foo { |
| 12 | bar a, b; |
| 13 | public: |
| 14 | foo(bar i, bar j) : a(i),b(j) {} |
| 15 | operator const bar() const { return a; } |
| 16 | bar f() { return *this; } |
| 17 | void g(foo &c) { b = c; } |
| 18 | }; |