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++/71424] New: std::initializer_list<T[N]>


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

            Bug ID: 71424
           Summary: std::initializer_list<T[N]>
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

This was posted by Peter Dimov in c++std-core-22683, and doesn't seem to have
found its way to our bugzilla.

#include <initializer_list>

void f( std::initializer_list<double[2]> list )
{
}

int main()
{
   f( { { 1.0, 2.0 }, { 3.0, 4.0 } } );
}

clang++ and EDG accept it, g++ rejects it with:

array must be initialized with a brace-enclosed initializer

Apparently the error message used to be

could not convert â{{1.0e+0, 2.0e+0}, {3.0e+0, 4.0e+0}}â to
âstd::initializer_list<double [2]>â

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