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

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 25 22:10:15 PST 2023


================
@@ -1724,6 +1724,36 @@ 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; }
+      // FIXME: Undesired hint `x = y: y`. This builds a PseudoObjectExpr too.
+      void PutX(int y) { x = $one[[y]]; }
----------------
HighCommander4 wrote:

While it may not be ill-formed, I think the fact that this causes an infinite recursion at runtime is a distraction for someone reading the test.

I would suggest instead something like:

```
void PutX(int y) {}

// FIXME: Undesired hint `x = y: y`. This builds a PseudoObjectExpr too.
void SomeOtherFunction(int y) { x = $one[[y]]; }
```

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


More information about the cfe-commits mailing list