This patch adds the test for the fixed PR. 2015-12-09 Uros Bizjak <ubiz...@gmail.com>
PR c++/68348 PR c++/68464 * g++.dg/pr68348.C: New test. Tested on x86_64-linux-gnu. OK for mainline? Uros.
Index: g++.dg/pr68348.C =================================================================== --- g++.dg/pr68348.C (revision 0) +++ g++.dg/pr68348.C (revision 0) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c++11 -O2" } */ + +struct C { + constexpr C ():w (), x (), y () {} + constexpr double fn () const noexcept; + double w; + double x; + double y; +}; + +constexpr double C::fn () const noexcept { return w; } + +C foo () +{ + C c; + c.fn (); + return c; +}