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

* [Bug c++/57673] pack sizeof ... groups ellipsis with preceding expression
  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 ` potswa at mac dot com
  2013-07-30 15:30 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: potswa at mac dot com @ 2013-06-22 10:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57673

--- Comment #1 from David Krauss <potswa at mac dot com> ---
Oops, g::m does not need to be static constexpr to produce an error; the
specifiers should be removed to produce a minimal test.


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

* [Bug c++/57673] pack sizeof ... groups ellipsis with preceding expression
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-30 15:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57673

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-07-30
     Ever confirmed|0                           |1

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
With current mainline and 4_8-branch, I can only reproduce the problem with
d::n, not that with d::m. g is in any case fine.


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

* [Bug c++/57673] pack sizeof ... groups ellipsis with preceding expression
  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
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-30 16:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57673

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
   Target Milestone|---                         |4.9.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/57673] pack sizeof ... groups ellipsis with preceding expression
  2013-06-22  9:23 [Bug c++/57673] New: pack sizeof ... groups ellipsis with preceding expression potswa at mac dot com
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-30 22:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57673

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.


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

* [Bug c++/57673] pack sizeof ... groups ellipsis with preceding expression
  2013-06-22  9:23 [Bug c++/57673] New: pack sizeof ... groups ellipsis with preceding expression potswa at mac dot com
                   ` (3 preceding siblings ...)
  2013-07-30 22:39 ` paolo.carlini at oracle dot com
@ 2013-07-31 14:07 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-31 14:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57673

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nmm1 at cam dot ac.uk

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 58037 has been marked as a duplicate of this bug. ***


^ 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).