[clang] [clang] reject initializing constexpr objects with compound literals that contain non-null pointers (PR #230477)

Abdulmalek Almkainzi via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 18 18:09:46 PDT 2026


================
@@ -8584,15 +8613,9 @@ ExprResult InitializationSequence::Perform(Sema &S,
         CheckC23ConstexprInitConversion(S, SourceType, Entity.getType(),
                                         CurInit.get());
 
-        // C23 6.7.1p6: If an object or subobject declared with storage-class
-        // specifier constexpr has pointer, integer, or arithmetic type, any
-        // explicit initializer value for it shall be null, an integer
-        // constant expression, or an arithmetic constant expression,
-        // respectively.
----------------
aalmkainzi wrote:

oh sorry I read your message as "removing".

Well the idea is that this function will be responsible for handling C standard-specific rules. So I thought it was appropriate to move it there.

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


More information about the cfe-commits mailing list