[clang] [Clang][Interp] Fix the location of uninitialized base warning (PR #100761)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 10:28:56 PDT 2024


================
@@ -122,19 +124,18 @@ static bool CheckFieldsInitialized(InterpState &S, SourceLocation Loc,
   }
 
   // Check Fields in all bases
-  for (const Record::Base &B : R->bases()) {
+  for (auto [I, B] : llvm::enumerate(R->bases())) {
----------------
Sirraide wrote:

I believe `llvm::enumerate` acts like `std::views::enumerate` and iterates by reference, so you’re supposed to just do `auto [...]`; at least that’s what I recall from the documentation.

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


More information about the cfe-commits mailing list