scw added inline comments.

================
Comment at: clang/unittests/Tooling/StencilTest.cpp:410
+  StringRef Id = "id";
+  testExpr(Id, Snippet, access(Id, "field"), "(*x).field");
+}
----------------
ymandel wrote:
> Hmm. Looks like we could use smart pointer support in tooling::buildAddressOf 
> as well.  If you're interested, the code is at
> clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp line 94
> but I understand if you want to stop here. :)
I don't think this particular output "(*x).field" is from `buildAddressOf`. 
Instead, it's in `buildDot` where `*x` is `x.operator*()` instead of 
`UO_Deref`. Yes, there's potential improvement but at least it's correct output 
comparing to this change which fixes "x->->field" so I'm leaving it along just 
adding the test case to highlight the potential.

As for `buildAddressOf`, we shouldn't change `&*x` to `x` when `x` is a smart 
pointer -- the types don't match and may result in ill-typed expressions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100450/new/

https://reviews.llvm.org/D100450

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

Reply via email to