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

            Bug ID: 23849
           Summary: Implement CWG 1579: Return by converting move
                    constructor
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

New rules for implicit move on return for C++14:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579

Here is a test to detect if the rules are implemented.  This should not compile
in C++11 and should compile in C++14:

struct X
{
    X() = default;
    X(X&&) = default;
};

struct Y
{
    Y() = default;
    Y(Y&&) = default;
    Y(X&&) {}
};

Y
test()
{
    X x;
    return x;
}

int
main()
{
    auto y = test();
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to