[LLVMbugs] [Bug 12482] New: Copy constructors of types with members with rvalue references

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 6 08:44:22 PDT 2012


             Bug #: 12482
           Summary: Copy constructors of types with members with rvalue
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm-bugs at quasiparticle.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I don't know exactly whether this is a bug or not, bug g++ accepts it, and I
feel that clang++ should to. Currently, clang rejects this:

struct bar {};

struct tuple {
    struct entry { bar&& member; };

    entry members;

    tuple() : members { bar() } {}

    tuple(const tuple& other) = default;

int main()
    tuple t;

with errors:

% clang++ -std=c++11 -pedantic -ofoo baz.cpp && ./foo
baz.cpp:10:2: error: the parameter for this
      explicitly-defaulted copy constructor is const, but a
      member or base requires it to be non-const
        tuple(const tuple& other) = default;
1 error generated.

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