https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64666

--- Comment #7 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Jason Merrill from comment #6)
> > but
> > anyway, even with -std=c++14 -pedantic-errors, no message at all is given
> > for the program in my earlier comment.
> 
> I don't see the syntax error in your earlier comment, S()=1 is a C++14
> constant expression.

The relevant production in the grammar, [expr.const]p1, is:

  constant-expression:
    conditional-expression

This doesn't allow assignment-expressions unless parenthesised. It's also
echoed by [expr.const]p2:

  A conditional-expression e is a core constant expression unless [...]

and there is nothing that would allow other types of expressions to qualify as
core constant expressions.

Reply via email to