[Bug c++/94034] [10 Regression] Broken diagnostic: 'result_decl' not supported by dump_expr

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 9 18:41:52 GMT 2020


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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #6)
> So I suppose my comment on Paolo's patch was wrong, and this is only a
> diagnostic quality issue after all.

Ah, there is a constexpr issue to fix: if we add constructors to A, we should
get guaranteed RVO, but still see the same bogus error.

struct A {
  A() = default; A(const A&);
  A *ap = this;
};
constexpr A foo() { return {}; }
static constexpr A a = foo(); // works without 'constexpr'
int main() {
  if (&a != a.ap)
    __builtin_abort();
}


More information about the Gcc-bugs mailing list