[LLVMbugs] [Bug 10315] New: [C++0x] "Call to deleted constructor" with move assignment operator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 9 07:02:48 PDT 2011


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

           Summary: [C++0x] "Call to deleted constructor" with move
                    assignment operator
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: matti.niemenmaa+llvmbugs at iki.fi
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


clang++ 2.9 and g++ 4.6.1 accept the code below (reduced from "#include
<boost/thread.hpp>" with Boost 1.46.1), but clang++ trunk (r134813) doesn't. My
guess is that trunk is the one getting it wrong here:

$ cat foo.cc
struct shared_ptr {
    shared_ptr& operator=(shared_ptr&&) { return *this; }
};
struct tss_data_node {
    shared_ptr sp;
    tss_data_node(shared_ptr p) : sp(p) {}
};

$ g++ -std=c++0x -fsyntax-only foo.cc
$ clang++ -std=c++0x -fsyntax-only foo.cc
$ bin/clang++ -std=c++0x -fsyntax-only foo.cc
foo.cc:6:32: error: call to deleted constructor of 'shared_ptr'
        tss_data_node(shared_ptr p) : sp(p) {}
                                      ^  ~
foo.cc:1:8: note: function has been explicitly marked deleted here
struct shared_ptr {
       ^
1 error generated.

$ g++ --version
g++ (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang++ --version
clang version 2.9 (tags/RELEASE_29/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ bin/clang++ --version
clang version 3.0 ()
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
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.



More information about the llvm-bugs mailing list