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

            Bug ID: 66895
           Summary: Array to pointer decay in list initialization
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com
  Target Milestone: ---

> $ cat test.cc
> #include <cstddef>
> #include <initializer_list>
> struct S {
>     template<std::size_t N> S(char const (&)[N]);
> };
> struct T { S s; };
> void f(std::initializer_list<T>);
> void g() { f({{""}}); }

> $ g++ -std=c++11 -fsyntax-only test.cc
> test.cc: In function ‘void g()’:
> test.cc:8:20: error: could not convert ‘(const char*)""’ from ‘const char*’ 
> to ‘S’
>  void g() { f({{""}}); }
>                     ^

Reply via email to