ilya-biryukov added a comment.

In https://reviews.llvm.org/D52261#1240143, @yvvan wrote:

> I tried that first but did not I find a way just to copy an expression (we 
> basically need the same expr for such case). Do you know how to properly 
> generate a copy of expression or some other way to get the same expression?


It seems `Sema::ActOnStartCXXMemberReference` only changes expression when 
overloading for C++'s `operator ->` is required, otherwise it keeps the same 
expression. Since C does not have that, we can just leave the expression as is.
So setting `CorrectedLHS = LHS` for C should do the trick (no need to copy the 
expression IIUC, it's fine to use the same pointer for both `CorrectedLHS` and 
`LHS`).


https://reviews.llvm.org/D52261



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to