Test: struct Data { const char* const& name; }; constexpr Data d = { "" }; Using g++ (GCC) 4.9.0 20140122 (experimental): g++ -c -std=c++11 t.cc t.cc:2:25: error: 'const Data{(* & _ZGRL1d0)}' is not a constant expression constexpr Data d = { "" }; ^
This is already fixed in mainline. I'm addding the testcase and closing the bug.
Author: paolo Date: Fri Aug 29 12:24:17 2014 New Revision: 214724 URL: https://gcc.gnu.org/viewcvs?rev=214724&root=gcc&view=rev Log: 2014-08-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59938 * g++.dg/cpp0x/constexpr-59938.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-59938.C Modified: trunk/gcc/testsuite/ChangeLog
Done.