https://github.com/higher-performance created https://github.com/llvm/llvm-project/pull/172910
Given that both `-Wreturn-type` and `-Wdangling` are already warnings and not hard errors, it makes sense for this diagnostic to behave similarly. This allows suppressing benign occurrences of the error in external headers whose source code is not in the user's direct control, such as in `std::function_ref`-like classes. >From 2256d72e88fc3fe21e6e9d92a48b938fd70a30a1 Mon Sep 17 00:00:00 2001 From: higher-performance <[email protected]> Date: Thu, 18 Dec 2025 16:50:59 -0500 Subject: [PATCH] [clang] Make error for [[clang::coro_wrapper]] be downgradable to a warning Given that both -Wreturn-type and -Wdangling are already warnings and not hard errors, it makes sense for this diagnostic to behave similarly. This allows suppressing benign occurrences of the error in external headers whose source code is not in the user's direct control, such as in std::function_ref-like classes. --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index a8fd17ecd2bdd..596fd52e69677 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -12731,10 +12731,10 @@ def err_conflicting_aligned_options : Error < def err_coro_invalid_addr_of_label : Error< "the GNU address of label extension is not allowed in coroutines" >; -def err_coroutine_return_type : Error< +def warn_coroutine_return_type : Warning< "function returns a type %0 marked with [[clang::coro_return_type]] but is neither a coroutine nor a coroutine wrapper; " - "non-coroutines should be marked with [[clang::coro_wrapper]] to allow returning coroutine return type" ->; + "non-coroutines should be marked with [[clang::coro_wrapper]] to allow returning coroutine return type">, + DefaultError; def warn_coroutine_type_aware_allocator_ignored : Warning < "type aware %0 will not be used for coroutine allocation">, InGroup<CoroTypeAwareAllocationFunction>; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
