[PATCH] D119537: [clangd] Treat 'auto' params as deduced if there's a single instantiation.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 11 08:30:14 PST 2022


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/AST.cpp:508
+    int ParamIndex = paramIndex(*FTD, *Auto.getDecl());
+    if (ParamIndex < 0)
+      return true;
----------------
avogelsgesang wrote:
> out of curiosity: when would this happen?
I think it probably can't happen.
In principle there may be several sets of implicit TTPs in scope (generic lambda nested in generic lambda) but `auto` would always refer to the immediately enclosing set.

Added an assert, but I lack the courage to make this `llvm_unreachable()` and crash horribly in production if I'm wrong :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119537



More information about the cfe-commits mailing list