https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81073
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org --- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- The testcase in comment 1 works on trunk and current 7 branch. The original testcase looks ill-formed to me; [dcl.constexpr] says that a constexpr function can't define a variable with static storage duration, and I think the same applies to statement-expressions, for the same reason: when we optimize to a constant value, we no longer have the declaration, which leads to link errors like this.