[Bug c++/57673] New: pack sizeof ... groups ellipsis with preceding expression
potswa at mac dot com
gcc-bugzilla@gcc.gnu.org
Sat Jun 22 09:23:00 GMT 2013
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 );
};
More information about the Gcc-bugs
mailing list