From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17926 invoked by alias); 22 Jun 2013 09:23:42 -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 17886 invoked by uid 48); 22 Jun 2013 09:23:32 -0000 From: "potswa at mac dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57673] New: pack sizeof ... groups ellipsis with preceding expression Date: Sat, 22 Jun 2013 09:23: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: potswa at mac 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-06/txt/msg01194.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57673 Bug ID: 57673 Summary: pack sizeof ... groups ellipsis with preceding expression Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: potswa at mac dot com In this example, template g compiles without issue but each member in d chokes the parser. The only difference is grouping parentheses, which shouldn't be significant. There may be more than one issue. A left paren seems to get the parser into a good state to accept sizeof ... , but it starts in a bad state at the beginning of an initializer, and seeing a qualified-id puts it into a bad state. (Reversing the order of subexpressions and writing ( sizeof ... ( p ) - i::m ) does not produce an error.) struct i { static constexpr int m = 5; }; template< int ... p > struct g { static constexpr int m = i::m - ( sizeof ... ( p ) ); int n = ( sizeof ... ( p ) ); }; template< int ... p > struct d { static constexpr int m = ( i::m - sizeof ... ( p ) ); int n = sizeof ... ( p ); };