[LLVMbugs] [Bug 7245] New: Should not require copy constructor when binding rvalue to reference

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 28 08:00:18 PDT 2010


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

           Summary: Should not require copy constructor when binding
                    rvalue to reference
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jyasskin at google.com
                CC: chandlerc at gmail.com, llvmbugs at cs.uiuc.edu,
                    dgregor at apple.com


Specifically,

struct NonCopyable {
  NonCopyable();
private:
  NonCopyable(const NonCopyable&);
};
void foo(const NonCopyable&);
void bar() {
  foo(NonCopyable());
}

should compile. gcc used to complain about this, but stopped in gcc-4.3 because
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391 convinced them
it was a mistake in C++03 (http://gcc.gnu.org/PR44313). Comeau's online compile
defaults to allowing it, but gives an error if you disable C++0x extensions.
Clang's c++0x mode allows it. And, of course, it's a silly  and inconvenient
restriction.

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