diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C new file mode 100644 index 000000000..faa8a3603 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg2.C @@ -0,0 +1,44 @@ +// PR c++/46368 +// { dg-options "-std=c++0x" } + +class A; + +class B +{ + A foo (); + A bar (); +}; + +class C +{ +}; + +struct D +{ + D (C); +}; + +struct A : D +{ + A (const C & n) : D (n) {} +}; + +A baz (const char *, A = C ()); + +A +B::foo () +{ + try + { + baz ("foo"); + } + catch (...) + { + } +} + +A +B::bar () +{ + baz ("bar"); +} |