================ @@ -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. + }; + + int printf(const char *Format, ...); + + int main() { + S s; + __builtin_dump_struct(&s, printf); // Not `Format: __builtin_dump_struct()` + printf($Param[["Hello, %d"]], 42); // Normal calls are not affected. + return s.x[ $two[[1]] ][ $three[[2]] ]; // `x[y: 1][z: 2]` ---------------- HighCommander4 wrote:
Thanks, this is an interesting use case for not just skipping the semantic forms of all PseudoObjectExprs (which was my initial thought) Since it's not obvious that this builds a PseudoObjectExpr, can you please add a comment: ``` // This builds a PseudoObjectExpr, but here it's useful for show the // arguments from the semantic form. ``` https://github.com/llvm/llvm-project/pull/71366 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits