[llvm-bugs] [Bug 48026] New: Rejects valid direct initialization from prvalue (private destructor)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 30 13:08:03 PDT 2020


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

            Bug ID: 48026
           Summary: Rejects valid direct initialization from prvalue
                    (private destructor)
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: leni536 at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

clang version 10.0.1 (https://github.com/llvm/llvm-project.git
ef32c611aa214dea855364efd7ba451ec5ec3f74)

options: -std=c++17 -O2 -pedantic-errors

clang++ rejects the following well-formed program:

struct A {
    private:
    ~A();

    public:
    static A f();
};

A* foo() {
    return new A(A::f());
}

https://godbolt.org/z/hffYq7

On the return line no destructor is invoked or potentially invoked.

-- 
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/20201030/027a85ed/attachment.html>


More information about the llvm-bugs mailing list