[llvm-bugs] [Bug 38203] New: use of deleted function

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 17 18:39:16 PDT 2018


            Bug ID: 38203
           Summary: use of deleted function
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The code is as follow:

struct Z { };

struct A {
 operator Z &&() const = delete; // It is deleted.
 operator Z();

void zip() {
 Z &&x = A();

clang++ accepts the code, but g++ rejects it:

error: use of deleted function 'A::operator Z&&() const'
  Z &&x = A();

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/20180718/f4412d3f/attachment.html>

More information about the llvm-bugs mailing list