From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16558 invoked by alias); 7 Jan 2015 09:12:02 -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 16521 invoked by uid 48); 7 Jan 2015 09:11:58 -0000 From: "roman.kurc at wp dot pl" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64519] New: variadic template as the first argument Date: Wed, 07 Jan 2015 09:12: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: roman.kurc at wp 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 attachments.created 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: 2015-01/txt/msg00359.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64519 Bug ID: 64519 Summary: variadic template as the first argument Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: roman.kurc at wp dot pl Created attachment 34392 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34392&action=edit sample code It seems that passing an empty argument to a variadic template results in assigning void type to the argument. Such a behavior can be seen in the following cases: static_assert( std::is_same< decltype(B::test()), B::CharA<3> >::value == false, "test( ) should evaluate to fun( )" ); test( TA... args ) is called with no parameters then I::template sfinae_2(args...,0) and args... gets void type. The same happens in calls presented below and it does not matter if template is instantinated or only its type is deduced. static_assert( (sizeof(B::test()) == sizeof(B::CharA<1>)), "test( ) should evaluate to fun ()" ); static_assert( std::is_same< decltype(B::test()), B::CharA<1> >::value, "test() should evaluate to fun()" );