[PATCH] D128095: [clang] Improve diagnostics for expansion length mismatch

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 29 17:12:59 PDT 2022


mizvekov added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplateVariadic.cpp:860
+    } else if (const auto *ND = Unexpanded[I].first.get<const NamedDecl *>();
+               isa<VarDecl>(ND)) {
+      // Function parameter pack or init-capture pack.
----------------
erichkeane wrote:
> This pattern with the init + condition is a little awkward here... any reason to not just use the cast around the 'ND" and just use the VD in the use below? or is there a good reason to split it up like this?
> 
> Same with the above case.
No very strong reason than that just from my different perception this looked fine :)

Minor advantage that we don't make the variable a VarDecl pointer if we don't need to access it as such.

But no strong preference here, I can have another look tomorrow.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128095



More information about the cfe-commits mailing list