From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3873 invoked by alias); 6 Jan 2015 20:37:47 -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 3853 invoked by uid 48); 6 Jan 2015 20:37:41 -0000 From: "freddie_chopin at op dot pl" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64514] New: Error in template instantiation in GCC 4.9, works fine in GCC 4.8 Date: Tue, 06 Jan 2015 20:37: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: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: freddie_chopin at op dot pl 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: 2015-01/txt/msg00328.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64514 Bug ID: 64514 Summary: Error in template instantiation in GCC 4.9, works fine in GCC 4.8 Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: freddie_chopin at op dot pl The test code below works perfectly fine with GCC 4.8 (and 4.7): --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- #include template struct Functor { template struct Inner { float operator()() const { return (object.*function)(args...); } }; }; class Object { public: float someFunction() { return {}; } float someFunctionWithArgument(int) { return {}; } }; Object object; Functor::Inner<&Object::someFunction> functor1; Functor::Inner<&Object::someFunctionWithArgument, 1> functor2; int main() { } --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- However with GCC 4.9 it fails with a rather unhelpful message at the point = of instantiation of functor1: --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- $ g++ -std=3Dc++11 test.cpp=20 test.cpp: In instantiation of =E2=80=98struct Functor= =E2=80=99: test.cpp:33:24: required from here test.cpp:7:9: error: wrong number of template arguments (2, should be 1) struct Inner ^ test.cpp:7:9: error: provided for =E2=80=98template template struct Functor::Inner=E2=80=99 test.cpp:7:9: error: wrong number of template arguments (2, should be 1) test.cpp:7:9: error: provided for =E2=80=98template template struct Functor::Inner=E2=80=99 test.cpp:33:26: error: =E2=80=98Inner=E2=80=99 in =E2=80=98struct Functor=E2=80=99 does not name a template type Functor::Inner<&Object::someFunction> functor1; ^ --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- If I comment the line with functor1 instantiation, everything else (functor= 2) works fine. At the stackoverflow question I asked ( http://stackoverflow.com/questions/27802404/error-in-template-instantiation= -in-gcc-4-9-works-fine-in-gcc-4-8?noredirect=3D1#comment44015634_27802404 ) it was reported that clang 3.5 and Visual Studio 2015 Preview accept this code, while intel 14 errors out (with an unreported message) and solaris st= udio 12.4 crashes. Is there something wrong with this code (which was working for me for over 2 years with older versions) or maybe this is a regression? >>From gcc-bugs-return-472335-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jan 06 20:45:12 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 16897 invoked by alias); 6 Jan 2015 20:45:11 -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 16405 invoked by uid 55); 6 Jan 2015 20:45:06 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64489] A simple struct wrapping a const int is not trivially copyable Date: Tue, 06 Jan 2015 20:45: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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ville.voutilainen at gmail dot com 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: 2015-01/txt/msg00329.txt.bz2 Content-length: 495 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64489 --- Comment #2 from Jason Merrill --- Author: jason Date: Tue Jan 6 20:44:32 2015 New Revision: 219265 URL: https://gcc.gnu.org/viewcvs?rev=219265&root=gcc&view=rev Log: PR c++/64489 * class.c (check_field_decls): Make copy assignment operators complex only in c++98 mode. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/testsuite/g++.dg/ext/is_trivially_constructible1.C