http://llvm.org/bugs/show_bug.cgi?id=6999
Summary: [C++ CodeGen] Reimplement synthesis of implicit copy
assignment operators
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Blocks: 6023
terfin:clang dgregor$ cat t.cpp
template<typename T>
CodeGen is picking the wrong copy-assignment operator for bases/members when it
synthesizes the implicit copy assignment operator. Here's an example (distilled
from Boost.Spirit) where we fail to link because CodeGen tries to call the
const copy-assignment operator when it should call the non-const one.
struct X {
X &operator=(const X&) {
T* a = 1;
return *this;
}
X &operator=(X &) { return *this; }
};
struct Y {
Y &operator=(Y &) { return *this; }
};
struct Z : X<int>, Y { };
void test_Z(Z z1, Z z2) {
z1 = z2;
}
terfin:clang dgregor$ clang++ t.cpp
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
"__ZN1XIiEaSERKS0_", referenced from:
__ZN1ZaSERS_ in cc-kOxAc3.o
The plan is to implement the generation of copy-assignment operators entirely
in Sema, synthesizing a body that CodeGen can translate like any other function
body.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs