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

Richard Smith <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Fixed By Commit(s)|                            |21e8bb83253e1a2f4b6fad9b53c
                   |                            |afe8c530a38e2,
                   |                            |8153dee37272a73b1ed74ac1bc1
                   |                            |2422fac8ef033
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Richard Smith <[email protected]> ---
Simpler testcase:

struct WithMutable {
    mutable int val_{0};
};

constexpr void createOnHeap() {
    WithMutable* var = new WithMutable{};
    var->val_ = 1;
    delete var;
}

Clang was not treating heap allocations as "lifetime started within the current
evaluation" for the purpose of determining whether 'mutable' prevents the
subobject from being used in the constant expression.

Fixed and backported to 12.0 release branch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to