This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58541] [c++11] Bogus "error: redeclaration ... differs in âconstexprâ"


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58541

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-05-13
                 CC|                            |msebor at gcc dot gnu.org
             Blocks|                            |55004
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.3, 5.3.0, 6.1.0, 7.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  There is no requirement that the namespace-scope definition of a
static constexpr class member say its constexpr.  Today's trunk (7.0) fails
with the following error.  All supported versions of GCC fail to compile the
test case.  If I'm reading the logs right, the error was introduced in r166013.

$ cat xx.cpp && gcc -S -Wall -Wextra -Wpedantic -o/dev/null -std=c++11 xx.cpp
struct X {
  static constexpr const char x[] = "x";
};

const char X::x[];

xx.cpp:5:17: error: âconstexprâ needed for in-class initialization of static
data member âconst char X::x [2]â of non-integral type [-fpermissive]
 const char X::x[];
                 ^


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]