[clang-tools-extra] [clangd] Add inlay hints for forwarding direct init (PR #176635)
Mythreya Kuricheti via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 8 13:36:19 PST 2026
MythreyaK wrote:
Apologies for the delay and thank you for the review!
> Wouldn't it make more sense to use a SmallVector<variant<ParmVarDecl, FieldDecl>> and resolve them individually?
I thought of that initially, but I couldn't think of a construct where both `ParmVarDecl` and `FieldDecl` could initialize the same structure. My understanding was that if we resolve the parameter to a `ParmVarDecl`, then the underlying struct has a constructor which prevents the struct from being direct-initialized.
I opted to returning the full `CXXRecordDecl` instead of the individual `FieldDecl`s as it made it easier to inspect the base classes (at the callsite) and drop those members.
> Also, this looks like it would fail if we are also initializing base class fields, e.g.
I believe that is covered in `CXX20AggregateParenInitNoCtorDerived`. Please let me know if that isn't the case!
https://github.com/llvm/llvm-project/pull/176635
More information about the cfe-commits
mailing list