This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66895] New: Array to pointer decay in list initialization
- From: "sbergman at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Jul 2015 06:54:32 +0000
- Subject: [Bug c++/66895] New: Array to pointer decay in list initialization
- Auto-submitted: auto-generated
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({{""}}); }
> ^