From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15291 invoked by alias); 16 Oct 2013 22:13:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 15240 invoked by uid 48); 16 Oct 2013 22:13:18 -0000 From: "ville.voutilainen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58753] Brace-initializing a vector with a direct-initialization NSDMI doesn't work in a template Date: Wed, 16 Oct 2013 22:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ville.voutilainen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg01143.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58753 --- Comment #2 from Ville Voutilainen = --- This snippet #include struct X {X(int) {}}; template =20 class T { std::vector x{0};=20 };=20 int main() { T t; } gives the following: plaatti-reduced.cpp: In constructor =E2=80=98constexpr T::T()=E2=80=99: plaatti-reduced.cpp:6:7: error: converting to =E2=80=98std::vector=E2= =80=99 from initializer list would use explicit constructor =E2=80=98std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp =3D int; _Alloc =3D std::allocator; std::vector<_Tp, _Alloc>::size_type =3D long unsigned int; std::vector<_Tp, _Alloc>::allocator_type =3D std::allocator]=E2=80=99 class T { ^ plaatti-reduced.cpp: In function =E2=80=98int main()=E2=80=99: plaatti-reduced.cpp:13:10: note: synthesized method =E2=80=98constexpr T::T()=E2=80=99 first required here=20 T t; ^ A non-template is still fine, and a copy-initialized brace-NSDMI is still f= ine. >>From gcc-bugs-return-432000-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 16 22:14:58 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 19118 invoked by alias); 16 Oct 2013 22:14:57 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 19067 invoked by uid 48); 16 Oct 2013 22:14:53 -0000 From: "ville.voutilainen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58753] Brace-initializing a vector with a direct-initialization NSDMI doesn't work in a template Date: Wed, 16 Oct 2013 22:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ville.voutilainen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg01144.txt.bz2 Content-length: 395 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58753 --- Comment #3 from Ville Voutilainen --- And, the struct X is not significant, but I tested with just a simple type that can be brace-initialized, and that didn't trigger the error. I haven't yet narrowed it down to initializer_list or anything like that, vector seems to be a surefire way to trigger it.