public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57673] New: pack sizeof ... groups ellipsis with preceding expression
@ 2013-06-22  9:23 potswa at mac dot com
  2013-06-22 10:05 ` [Bug c++/57673] " potswa at mac dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: potswa at mac dot com @ 2013-06-22  9:23 UTC (permalink / raw)
  To: gcc-bugs

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 );
};


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-31 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-22  9:23 [Bug c++/57673] New: pack sizeof ... groups ellipsis with preceding expression potswa at mac dot com
2013-06-22 10:05 ` [Bug c++/57673] " potswa at mac dot com
2013-07-30 15:30 ` paolo.carlini at oracle dot com
2013-07-30 16:47 ` paolo.carlini at oracle dot com
2013-07-30 22:39 ` paolo.carlini at oracle dot com
2013-07-31 14:07 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).