Bug 59938

Summary: [C++11] Bogus "... is not a constant expression"
Product: gcc Reporter: Paul Pluzhnikov <ppluzhnikov>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: unknown   
Target Milestone: 5.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 55004    

Description Paul Pluzhnikov 2014-01-24 23:54:04 UTC
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 = { "" };
                         ^
Comment 1 Paolo Carlini 2014-08-29 12:18:32 UTC
This is already fixed in mainline. I'm addding the testcase and closing the bug.
Comment 2 paolo@gcc.gnu.org 2014-08-29 12:24:49 UTC
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
Comment 3 Paolo Carlini 2014-08-29 12:25:18 UTC
Done.