[llvm] [NFC] Re-enable MSVC C4351 diagnostic (PR #182082)

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 10:11:08 PST 2026


https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/182082

>From MSDN:
https://learn.microsoft.com/en-us/previous-versions/1ywe7hcy(v=vs.140)

This diagnostic is no longer documented in MSDN and from my local testing, the diagnostic is not emitted in our source. I believe we no longer need to disable this diagnostic.

>From 754ba6d9c65e3932d3c61d517c154d53b596c356 Mon Sep 17 00:00:00 2001
From: Aaron Ballman <aaron at aaronballman.com>
Date: Wed, 18 Feb 2026 13:01:52 -0500
Subject: [PATCH] [NFC] Re-enable MSVC C4351 diagnostic

>From MSDN:
https://learn.microsoft.com/en-us/previous-versions/1ywe7hcy(v=vs.140)

This diagnostic is no longer documented in MSDN and from my local
testing, the diagnostic is not emitted in our source. I believe we no
longer need to disable this diagnostic.
---
 llvm/cmake/modules/HandleLLVMOptions.cmake | 1 -
 1 file changed, 1 deletion(-)

diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 8b7c8cd4028bd..b5372eea259f9 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -733,7 +733,6 @@ if (MSVC)
       -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
       -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data'
       -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'
-      -wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized'
       -wd4456 # Suppress 'declaration of 'var' hides local variable'
       -wd4457 # Suppress 'declaration of 'var' hides function parameter'
       -wd4458 # Suppress 'declaration of 'var' hides class member'



More information about the llvm-commits mailing list