[llvm-bugs] [Bug 47805] By-value function parameter changes are rolled back prior to destructor call during constant evaluation

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 14 23:17:29 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47805

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Fixed By Commit(s)|                            |f7f2e4261a98b2da519d58e7f67
                   |                            |94b013cda7a4b
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Turns out we were effectively making an (as if trivial) copy from the argument
in the caller to the parameter in the callee, and only destroying the source of
that copy. For example, this also failed:

  struct B { B *p = this; };
  constexpr bool g(B b) { return &b == b.p; }
  static_assert(g({}));

That's all now fixed, thanks for the report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201015/c7dbd452/attachment.html>


More information about the llvm-bugs mailing list