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

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 10:27:23 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())) {
----------------
tbaederr wrote:

Does `auto &[I, B]` work here? What about `const auto &`?

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


More information about the cfe-commits mailing list