From f38dec15e3982982152a8be816c58e1590ed3cb2 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 7 May 2025 09:15:56 -0700 Subject: [PATCH 1/2] [lldb] Use -Wno-documentation-deprecated-sync if available report_fatal_error has been marked "@deprecated" in its comment, but the function itself is not marked with [[deprecated]] yet. This causes warnings like: llvm/include/llvm/Support/ErrorHandling.h:61:6: error: declaration is marked with '@deprecated' command but does not have a deprecation attribute [-Werror,-Wdocumentation-deprecated-sync] llvm/include/llvm/Support/Error.h:738:6: error: declaration is marked with '@deprecated' command but does not have a deprecation attribute [-Werror,-Wdocumentation-deprecated-sync] This patch disables the warning while we migrate away from report_fatal_error. --- lldb/unittests/API/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lldb/unittests/API/CMakeLists.txt b/lldb/unittests/API/CMakeLists.txt index 8bdc806878239..e9fe1fe4a3f6d 100644 --- a/lldb/unittests/API/CMakeLists.txt +++ b/lldb/unittests/API/CMakeLists.txt @@ -16,6 +16,15 @@ if (CXX_SUPPORTS_DOCUMENTATION) PRIVATE -Wdocumentation) endif() +# Apply -Wno-documentation-deprecated-sync while we migrate away from +# report_fatal_error in llvm/include/llvm/Support/ErrorHandling.h +# and llvm/include/llvm/Support/Error.h. +check_cxx_compiler_flag("-Wno-documentation-deprecated-sync" + CXX_SUPPORTS_DOCUMENTATION_DEPRECATED_SYNC) +if (CXX_SUPPORTS_DOCUMENTATION_DEPRECATED_SYNC) + target_compile_options(APITests + PRIVATE -Wno-documentation-deprecated-sync) +endif() if(Python3_RPATH) set_property(TARGET APITests APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}") From 4163a614cf0afd6c954a5f48ec8f3c0fc6222850 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 7 May 2025 10:27:40 -0700 Subject: [PATCH 2/2] Address a comment. --- lldb/unittests/API/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/unittests/API/CMakeLists.txt b/lldb/unittests/API/CMakeLists.txt index e9fe1fe4a3f6d..06ac49244176c 100644 --- a/lldb/unittests/API/CMakeLists.txt +++ b/lldb/unittests/API/CMakeLists.txt @@ -19,9 +19,11 @@ endif() # Apply -Wno-documentation-deprecated-sync while we migrate away from # report_fatal_error in llvm/include/llvm/Support/ErrorHandling.h # and llvm/include/llvm/Support/Error.h. +# Remove this block of code when the migration is complete. +# See https://github.com/llvm/llvm-project/issues/138914. check_cxx_compiler_flag("-Wno-documentation-deprecated-sync" - CXX_SUPPORTS_DOCUMENTATION_DEPRECATED_SYNC) -if (CXX_SUPPORTS_DOCUMENTATION_DEPRECATED_SYNC) + CXX_SUPPORTS_NO_DOCUMENTATION_DEPRECATED_SYNC) +if (CXX_SUPPORTS_NO_DOCUMENTATION_DEPRECATED_SYNC) target_compile_options(APITests PRIVATE -Wno-documentation-deprecated-sync) endif()