[LLVMbugs] [Bug 15735] New: list-initialization of array new-expression requires declared default constructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 12 04:11:41 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15735

            Bug ID: 15735
           Summary: list-initialization of array new-expression requires
                    declared default constructor
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ed at catmur.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

struct S { S(int) {} S() = delete; };
int main() { new S[5] { 0, 1, 2, 3, 4 }; }

source.cpp:2:23: error: call to deleted constructor of 'S'
int main() { new S[5] { 0, 1, 2, 3, 4 }; }
                      ^
source.cpp:1:20: note: function has been explicitly marked deleted here
struct S { S(int) {} S() = delete; };
                     ^

If a default constructor is declared non-deleted and accessible the code
compiles, even though it is not called (it does not need to be defined).

g++ compiles this 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/20130412/a524e703/attachment.html>


More information about the llvm-bugs mailing list