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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to