Skip to content

[lldb] Use -Wno-documentation-deprecated-sync if available #138909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2025

Conversation

kazutakahirata
Copy link
Contributor

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.

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.
@kazutakahirata kazutakahirata requested a review from nikic May 7, 2025 16:43
@llvmbot llvmbot added the lldb label May 7, 2025
@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/138909.diff

1 Files Affected:

  • (modified) lldb/unittests/API/CMakeLists.txt (+9)
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}")

@kazutakahirata kazutakahirata merged commit 47218ea into llvm:main May 7, 2025
6 of 9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_warning_lldb branch May 7, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants