[PATCH] D52261: [Sema] Generate completion fix-its for C code as well
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 20 06:50:00 PDT 2018
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
More information about the cfe-commits
mailing list