[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 08:17:29 PST 2023


================
@@ -1724,6 +1724,33 @@ TEST(InlayHints, RestrictRange) {
               ElementsAre(labelIs(": int"), labelIs(": char")));
 }
 
+TEST(ParameterHints, PseudoObjectExpr) {
+  Annotations Code(R"cpp(
+    struct S {
+      __declspec(property(get=GetX, put=PutX)) int x[];
+      int GetX(int y, int z) { return 42 + y; }
+      void PutX(int y) { x = $one[[y]]; } // FIXME: Undesired `x = y: y` for this ill-formed expression.
----------------
zyn0217 wrote:

It's nice to wipe out these extra hints if it won't take too many steps. The AST shows,
```
`-PseudoObjectExpr 'void'
  |- (Syntactic) BinaryOperator
  `- (Semantic) CXXMemberCallExpr 'void'
```
I wonder if it is possible to enumerate all the bad cases we don't want (e.g. Don't walk down the expression if we encounter a `BinaryOperator` in `PseudoObjectExpr`.)

https://github.com/llvm/llvm-project/pull/71366


More information about the cfe-commits mailing list