[clang] [Clang] [C++26] Implement P1306R5 Expansion Statements (PR #165195)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 26 23:01:09 PDT 2025
================
@@ -0,0 +1,584 @@
+//===-- SemaExpand.cpp - Semantic Analysis for Expansion Statements--------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements semantic analysis for C++26 expansion statements,
+// aka 'template for'.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/AST/DeclCXX.h"
+#include "clang/AST/DynamicRecursiveASTVisitor.h"
+#include "clang/AST/ExprCXX.h"
+#include "clang/AST/StmtCXX.h"
+#include "clang/Lex/Preprocessor.h"
+#include "clang/Sema/Lookup.h"
+#include "clang/Sema/Overload.h"
+#include "clang/Sema/Sema.h"
+
+#include <clang/Sema/EnterExpressionEvaluationContext.h>
+#include <clang/Sema/Template.h>
+
+using namespace clang;
+using namespace sema;
+
+namespace {
+struct IterableExpansionStmtData {
+ enum class State {
+ NotIterable,
+ Error,
+ Ok,
+ };
+
+ DeclStmt *RangeDecl{};
+ DeclStmt *BeginDecl{};
+ DeclStmt *EndDecl{};
+ Expr *Initializer{};
----------------
Sirraide wrote:
I think I managed to find most of the places where I did that and changed them to `= nullptr`.
https://github.com/llvm/llvm-project/pull/165195
More information about the cfe-commits
mailing list