| 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 | ||
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. |
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 = { "" }; ^