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

             Bug #: 11410
           Summary: Confusing diagnostic when trailing array element tries
                    to call deleted default constructor
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


$ cat test.cc
struct DeletedDefaultConstructor {
    DeletedDefaultConstructor() = delete;
    int v;
};

void foo() {
    DeletedDefaultConstructor ddc[3] = {{1}, {2}};
}
$ clang++ -fsyntax-only -std=c++0x test.cc
test.cc:7:40: error: call to deleted constructor of 'DeletedDefaultConstructor'
    DeletedDefaultConstructor ddc[3] = {{1}, {2}};
                                       ^
test.cc:2:5: note: function has been explicitly marked deleted here
    DeletedDefaultConstructor() = delete;
    ^
1 error generated.



I think the error message should
 a) point at the trailing '}' in the array definition, not the leading one, and
 b) mention that the initializer list was shorter than the array, so it was
generating implicit calls to the default constructor to initialize the rest of
the elements.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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