This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49988] constexpr on ctor invokes improper initialization
- From: "faisalv at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 5 Aug 2011 14:00:14 +0000
- Subject: [Bug c++/49988] constexpr on ctor invokes improper initialization
- Auto-submitted: auto-generated
- References: <bug-49988-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49988
--- Comment #1 from Faisal Vali <faisalv at yahoo dot com> 2011-08-05 13:59:55 UTC ---
Also, changing the parameter to a pointer to an array makes the code work
correctly:
struct A {
char data[3];
template<int ... I>
constexpr
// NOTE: now it is a pointer to an array - not just a pointer to char
A(const char (*s)[3], X<I...> x) : data{ (*s)[I]...} { }
};