swift
102e2d4a - [cxx-interop] Fix codegen for base member accesses

Commit
17 days ago
[cxx-interop] Fix codegen for base member accesses The code path inserted a manual lvalue to rvalue conversion. This conversion triggered a bitwise copy operation that should not be used for non-trivial types (a CXXConstructExpr is required instead). Instead of manually trying to do the casts, let's rely on Clang's sema to figure out the right casts to instert. Also, the original code used an rvalue reference as the return type for the synthesized getter. This triggered some compilation errors in sema's buildReturnStmt. Returning an lvalue reference solved those errors and is more in line with wath we actually want to do here (since we do not really need the getter/setter to produce an rvalue reference, we do not want to move out of the field). rdar://136757628
Author
Gabor Horvath
Parents
Loading