From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22101 invoked by alias); 4 Dec 2013 19:31: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 21354 invoked by uid 48); 4 Dec 2013 19:30:08 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59389] New: [C++11] bogus error:=?UTF-8?Q?=20call=20of=20overloaded=20=E2=80=98Foo?=()=?UTF-8?Q?=E2=80=99=20is=20ambiguous?= Date: Wed, 04 Dec 2013 19:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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-12/txt/msg00319.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59389 Bug ID: 59389 Summary: [C++11] bogus error: call of overloaded =E2=80=98Foo()=E2=80= =99 is ambiguous Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Google ref: b/11997192 Using current trunk: g++ (GCC) 4.9.0 20131204 (experimental) // --- cut --- #include #include #include struct Foo { Foo(const std::map>&); }; int main() { Foo foo2({{"abc", {"aaa", "bbb"}}}); // OK Foo foo1({{"abc", {"aaa"}}}); // Error. } // --- cut --- g++ -c -std=3Dc++11 t.cc t.cc: In function 'int main()': t.cc:12:30: error: call of overloaded 'Foo()' is ambiguous Foo foo1({{"abc", {"aaa"}}}); // Error. ^ t.cc:12:30: note: candidates are: t.cc:6:3: note: Foo::Foo(const std::map, std::vector > >&) Foo(const std::map>&); ^ t.cc:5:8: note: constexpr Foo::Foo(const Foo&) struct Foo { ^ t.cc:5:8: note: constexpr Foo::Foo(Foo&&) >>From gcc-bugs-return-436665-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Dec 04 19:35:35 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 25237 invoked by alias); 4 Dec 2013 19:35:34 -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 25219 invoked by uid 48); 4 Dec 2013 19:35:31 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59389] [C++11] bogus error:=?UTF-8?Q?=20call=20of=20overloaded=20=E2=80=98Foo?=()=?UTF-8?Q?=E2=80=99=20is=20ambiguous?= Date: Wed, 04 Dec 2013 19:35: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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google dot com X-Bugzilla-Status: RESOLVED 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: bug_status resolution 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-12/txt/msg00320.txt.bz2 Content-length: 911 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59389 Paul Pluzhnikov changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Paul Pluzhnikov --- Hmm, Clang also rejects this test: t.cc:12:7: error: call to constructor of 'Foo' is ambiguous Foo foo1({{"abc", {"aaa"}}}); // Error. ^ ~~~~~~~~~~~~~~~~~~ t.cc:5:8: note: candidate is the implicit move constructor struct Foo { ^ t.cc:5:8: note: candidate is the implicit copy constructor t.cc:6:3: note: candidate constructor Foo(const std::map>&); ^ 1 error generated. I must have over-reduced the original.