Bug 59938 - [C++11] Bogus "... is not a constant expression"
Summary: [C++11] Bogus "... is not a constant expression"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: constexpr
  Show dependency treegraph
 
Reported: 2014-01-24 23:54 UTC by Paul Pluzhnikov
Modified: 2014-08-29 12:25 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.