https://bugs.llvm.org/show_bug.cgi?id=44932
Bug ID: 44932
Summary: Different interpretation between GCC and clang in
resolution of DR1579
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: har...@gigawatt.nl
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk
Hi,
struct A { A(); A(const A &); A(A &&); };
struct B { B(A); };
B f() { A a; return a; }
GCC will use A's move constructor, clang will use A's copy constructor. The
literal text of the standard leaves some room for interpretation, IMO, as it
only says the treating of a as an rvalue applies to the selection of B's
constructor, and GCC and clang agree on which of B's constructors gets called,
but I would think that GCC's behaviour is probably what's intended.
Seen in clang 9, but appears to still apply to current trunk.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs