https://bugs.llvm.org/show_bug.cgi?id=37862

            Bug ID: 37862
           Summary: call to implicitly-deleted default constructor
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

The code is as follow:

template<typename T>
struct wrap
{
 wrap() = default;
 wrap(wrap&&) = default; // Line 5
 wrap(const wrap&) = default;

 T t;
};

struct S {
 S() = default;
 S(const S&){}
 S(S&&) = default;
};

typedef wrap<const S> W;

W get() { return W(); } // Line 19

int main() {}

clang++ rejects this code, and produces error messages:

error: call to implicitly-deleted default constructor of 'W' (aka 'wrap<const
S>')
    W get() { return W(); } // Line 19

Indeed, the code comes from a gcc bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53733

A previous version of g++ also rejects the code, but is fixed. 

Please check the problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to