https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86369
Aaron Ballman <aaron at aaronballman dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aaron at aaronballman dot com --- Comment #9 from Aaron Ballman <aaron at aaronballman dot com> --- (In reply to Jason Merrill from comment #8) > (In reply to Nicolas Lesser from comment #1) > > For clarity, b1 shouldn't compile. > > > > [lex.string]p16 says: "whether successive evaluations of a string-literal > > yield the same or a different object is unspecified." > > > > [expr.const]p2 says: "An expression e is a core constant expression unless > > the evaluation of e, [...], would evaluate one of the following expressions: > > [...]; a relational or equality operator where the result is unspecified;" > > I think the second quote refers to places in [expr.eq] that say "the result > is unspecified", not to all instances of unspecified behavior in the > standard. Doesn't [expr.eq] make it unspecified though? [expr.eq]p6 says: "If two operands compare equal, the result is true for the == operator and false for the != operator. If two operands compare unequal, the result is false for the == operator and true for the != operator. Otherwise, the result of each of the operators is unspecified." If it is unspecified whether a subsequent string literal evaluation produces the same object or a different object then it's unspecified whether the two operands will or won't compare equal, so the result of the operators is also unspecified.