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++/49988] constexpr on ctor invokes improper initialization


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]...} { }

};


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