[LLVMbugs] [Bug 21493] New: Compilation error when initializing in an agreggate containing a deleted copy constructor using initializer list from a template function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 5 13:44:48 PST 2014


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

            Bug ID: 21493
           Summary: Compilation error when initializing in an agreggate
                    containing a deleted copy constructor using
                    initializer list from  a template function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ogoffart at kde.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This valid code:

struct X  { X(int);  X(const X&) = delete; };
struct A { X v; };
template <typename T> void id() { A s{ {0 } }; }
int main() { id<A>(); }

does not compile:

test.cc:3:43: error: call to deleted constructor of 'X'
template <typename T> void id() {  A s  { {0 }  }; }
                                          ^~~~
test.cc:4:14: note: in instantiation of function template specialization
'id<A>' requested here
int main() { id<A>(); }
             ^
test.cc:1:22: note: 'X' has been explicitly marked deleted here
struct X  { X(int);  X(const X&) = delete; };

-- 
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/20141105/bf3ce690/attachment.html>


More information about the llvm-bugs mailing list