[clang] [Clang] Implement consteval blocks for C++26 (PR #188665)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 15:49:13 PDT 2026


================
@@ -180,7 +180,7 @@ bool randomizeStructureLayout(const ASTContext &Context, RecordDecl *RD,
     ++TotalNumFields;
     if (auto *FD = dyn_cast<FieldDecl>(D))
       RandomizedFields.push_back(FD);
-    else if (isa<StaticAssertDecl>(D) || isa<IndirectFieldDecl>(D))
+    else if (isa<StaticAssertDecl, ConstevalBlockDecl, IndirectFieldDecl>(D))
----------------
Sirraide wrote:

I have no idea why `StaticAssertDecl` is there either in that case; I was candidly just grepping for every occurrence of that in the codebase and adding `ConstevalBlockDecl` next to it because they can essentially appear in the same contexts (in C++; C allows static asserts in a few more places that C++ doesn’t)

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


More information about the cfe-commits mailing list