From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21648 invoked by alias); 20 Nov 2012 07:18:31 -0000 Received: (qmail 19060 invoked by uid 48); 20 Nov 2012 07:18:05 -0000 From: "lucdanton at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55408] New: ICE for member template definition with non-type variadic parameter Date: Tue, 20 Nov 2012 07:18: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lucdanton at free dot fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-11/txt/msg01880.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55408 Bug #: 55408 Summary: ICE for member template definition with non-type variadic parameter Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: lucdanton@free.fr Created attachment 28740 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28740 Reproducible testcase $ g++-snapshot --version g++-snapshot (Debian 20120915-1) 4.8.0 20120915 (experimental) [trunk revision 191353] When attempting to compile this program: struct foo { template void bar(); }; template void foo::bar() {} int main() { extern int i; foo {}.bar<&i>(); } GCC complains: main.cpp: In function 'int main()': main.cpp:12:21: internal compiler error: Segmentation fault foo {}.bar<&i>(); ^ Some casual investigating suggests that this happens every time the definition for a member template is exactly the same as its declaration save for the fact that a non-type parameter is made variadic. Otherwise, e.g. if the parameter in question is a type or template parameter in the declaration or if the template is declared taking int and defined taking long... then GCC correctly reports that the definition doesn't have a match.