gcc/testsuite/g++.dg/cpp0x/initlist42.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | enum Unscoped { }; |
| 4 | enum class Scoped { }; |
| 5 | |
| 6 | Unscoped bar(Unscoped x) { return x; } |
| 7 | Scoped bar(Scoped x) { return x; } |
| 8 | |
| 9 | auto var1u = bar(Unscoped()); // OK |
| 10 | auto var1s = bar(Scoped()); // OK |
| 11 | |
| 12 | auto var2u = bar(Unscoped{}); // #1 Error, but should work |
| 13 | auto var2s = bar(Scoped{}); // #2 Error, but should work |