diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/initlist42.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist42.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist42.C b/gcc/testsuite/g++.dg/cpp0x/initlist42.C new file mode 100644 index 000000000..e63959deb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist42.C @@ -0,0 +1,13 @@ +// { dg-options -std=c++0x } + +enum Unscoped { }; +enum class Scoped { }; + +Unscoped bar(Unscoped x) { return x; } +Scoped bar(Scoped x) { return x; } + +auto var1u = bar(Unscoped()); // OK +auto var1s = bar(Scoped()); // OK + +auto var2u = bar(Unscoped{}); // #1 Error, but should work +auto var2s = bar(Scoped{}); // #2 Error, but should work |