From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5490 invoked by alias); 31 Oct 2013 13:48:08 -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 5453 invoked by uid 48); 31 Oct 2013 13:48:04 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58940] New: [C++11] Bogus "error: use of deleted function ..." Date: Thu, 31 Oct 2013 13:48: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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg02325.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58940 Bug ID: 58940 Summary: [C++11] Bogus "error: use of deleted function ..." 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/11457051 Using g++ (GCC) 4.9.0 20131028 (experimental) g++ -c -std=c++11 t.cc t.cc: In constructor 'constexpr B::B()': t.cc:7:32: error: use of deleted function 'A< >::A(const A< >&) [with = int]' template < typename X > struct B ^ t.cc:3:5: note: declared here A (A const &) = delete; ^ t.cc: At global scope: t.cc:12:10: note: synthesized method 'constexpr B::B()' first required here B < int >b; ^ Compiles with Clang. Probably same root cause as in PR58930. Test case: // --- template < typename > struct A { A (A const &) = delete; A (int); }; template < typename X > struct B { A < X > a { 0 }; }; B < int >b; // ---