[llvm-bugs] [Bug 47474] New: Destroying delete requires accessible destructor

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 9 05:31:28 PDT 2020


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

            Bug ID: 47474
           Summary: Destroying delete requires accessible destructor
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin 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

>From StackOverflow (https://stackoverflow.com/q/63797383/2069064):

#include <new>

struct S {
    void operator delete(S* p, std::destroying_delete_t);

private:
    ~S();
};

void f() {
    delete new S;
}

This fails to compile on clang, which requires the destructor of S to be
accessible. But nothing here invokes the destructor of S (presumably the
destroying delete would), so this should compile fine.

-- 
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/20200909/ba491f6c/attachment.html>


More information about the llvm-bugs mailing list