[clang] Force an ICE when reentrantly reading a concept decl (PR #224677)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 11:09:39 PDT 2026


================
@@ -3249,7 +3249,14 @@ class ImplicitConceptSpecializationDecl final
     : public Decl,
       private llvm::TrailingObjects<ImplicitConceptSpecializationDecl,
                                     TemplateArgument> {
-  unsigned NumTemplateArgs;
+  unsigned NumTemplateArgs : 31;
+
+  /// True once setTemplateArguments() has written the trailing array.  False
+  /// between CreateDeserialized(), which publishes NumTemplateArgs over raw
+  /// storage, and setTemplateArguments().  Packed into the spare bits of the
+  /// existing member so that sizeof, the allocation size, and the offset of
+  /// the trailing array are all unchanged.
----------------
cor3ntin wrote:

If we are going to do that, can we use UnsignedOrNone?

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


More information about the cfe-commits mailing list