[Mlir-commits] [mlir] [mlir][ExecutionEngine] Fix dead -Wno-c++98-compat-extra-semi guard (PR #204524)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jun 18 01:29:19 PDT 2026


https://github.com/bogdan-petkovic created https://github.com/llvm/llvm-project/pull/204524

`check_cxx_compiler_flag` stores its result in `CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG`, but the guarding `if()`
checked `CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG` (without `_NO_`), which is never set. The condition was therefore always false and the `-Wno-c++98-compat-extra-semi` suppression for `mlir_rocm_runtime` was never applied.

The sibling flag checks in the same block (`-Wno-return-type-c-linkage`, `-Wno-nested-anon-types`, `-Wno-gnu-anonymous-struct`) already use matching variable names, so this aligns the typo'd guard with the established pattern.

No test is included, this is a build-system-only (CMake) change to a warning-suppression guard and is not unit-testable.

>From 364d5f509664458a272492a399741b40a69748a5 Mon Sep 17 00:00:00 2001
From: bogdan-petkovic <bpetkovi at amd.com>
Date: Thu, 18 Jun 2026 03:21:22 -0500
Subject: [PATCH] [mlir][ExecutionEngine] Fix dead -Wno-c++98-compat-extra-semi
 guard

check_cxx_compiler_flag stores its result in
CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG, but the guarding if()
checked CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG (without _NO_), which
is never set. The condition was always false, so the suppression was
never applied. The sibling flag checks in the same block already use
matching variable names.

Signed-off-by: bogdan-petkovic <bpetkovi at amd.com>
---
 mlir/lib/ExecutionEngine/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt
index 2176ccaa6031f..87af4724f159a 100644
--- a/mlir/lib/ExecutionEngine/CMakeLists.txt
+++ b/mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -414,7 +414,7 @@ if(LLVM_ENABLE_PIC)
     # Supress compiler warnings from HIP headers
     check_cxx_compiler_flag(-Wno-c++98-compat-extra-semi
       CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG)
-    if (CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG)
+    if (CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG)
       target_compile_options(mlir_rocm_runtime PRIVATE
         "-Wno-c++98-compat-extra-semi")
     endif()



More information about the Mlir-commits mailing list