[clang] [clang-tools-extra] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 19 13:01:45 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 9ebb618d03cb29c37e3178428dcf52e1ac4f1cc2 e42e46a1f1a2606a207c897263be64e266d9a702 --extensions cpp,c,h -- clang-tools-extra/clangd/unittests/ASTTests.cpp clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp clang-tools-extra/clangd/unittests/ParsedASTTests.cpp clang-tools-extra/clangd/unittests/QualityTests.cpp clang-tools-extra/clangd/unittests/RenameTests.cpp clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp clang-tools-extra/clangd/unittests/SemanticSelectionTests.cpp clang-tools-extra/clangd/unittests/SymbolInfoTests.cpp clang-tools-extra/clangd/unittests/XRefsTests.cpp clang-tools-extra/clangd/unittests/tweaks/DefineInlineTests.cpp clang-tools-extra/clangd/unittests/tweaks/ExpandDeducedTypeTests.cpp clang-tools-extra/clangd/unittests/tweaks/ExtractVariableTests.cpp clang-tools-extra/test/clang-tidy/checkers/abseil/Inputs/absl/strings/internal-file.h clang-tools-extra/test/clang-tidy/checkers/boost/use-to-string.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-coro.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-rethrow.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/fold-init-type.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/inc-dec-in-conditions-bitint-no-crash.c clang-tools-extra/test/clang-tidy/checkers/bugprone/spuriously-wake-up-functions.c clang-tools-extra/test/clang-tidy/checkers/bugprone/spuriously-wake-up-functions.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/stringview-nullptr.cpp clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-string-compare.cpp clang-tools-extra/test/clang-tidy/checkers/fuchsia/default-arguments-calls.cpp clang-tools-extra/test/clang-tidy/checkers/fuchsia/multiple-inheritance.cpp clang-tools-extra/test/clang-tidy/checkers/google/runtime-int-std.cpp clang-tools-extra/test/clang-tidy/checkers/google/upgrade-googletest-case.cpp clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-transform-values.cpp clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-values.cpp clang-tools-extra/test/clang-tidy/checkers/misc/unused-parameters.cpp clang-tools-extra/test/clang-tidy/checkers/misc/use-internal-linkage-func.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/Inputs/use-auto/containers.h clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-bind.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-c++20.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-main.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-three-arg-main.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-basic.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default-copy.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/use-override.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp clang-tools-extra/test/clang-tidy/checkers/modernize/use-trailing-return-type.cpp clang-tools-extra/test/clang-tidy/checkers/performance/Inputs/unnecessary-value-param/header-fixed.h clang-tools-extra/test/clang-tidy/checkers/performance/Inputs/unnecessary-value-param/header.h clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-string-concatenation.cpp clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-header.cpp clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/global-style1/header.h clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/global-style2/header.h clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type-macros.cpp clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp clang-tools-extra/test/clang-tidy/checkers/readability/convert-member-functions-to-static.cpp clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp clang-tools-extra/test/clang-tidy/checkers/readability/implicit-bool-conversion.cpp clang-tools-extra/test/clang-tidy/checkers/readability/named-parameter.cpp clang-tools-extra/test/clang-tidy/checkers/readability/redundant-declaration.c clang-tools-extra/test/clang-tidy/checkers/readability/redundant-declaration.cpp clang-tools-extra/test/clang-tidy/checkers/readability/static-accessed-through-instance.cpp clang-tools-extra/test/clang-tidy/checkers/readability/suspicious-call-argument.cpp clang-tools-extra/test/clang-tidy/infrastructure/duplicate-fixes-of-alias-checkers.cpp clang/test/CodeGen/armv7k-abi.c clang/test/Index/warning-flags.c compiler-rt/test/hwasan/TestCases/libc_thread_freeres.c compiler-rt/test/ubsan/TestCases/Misc/Posix/diag-stacktrace.cpp compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clangd/unittests/tweaks/DefineInlineTests.cpp b/clang-tools-extra/clangd/unittests/tweaks/DefineInlineTests.cpp
index 4e5e5a37ba..5ec12396ae 100644
--- a/clang-tools-extra/clangd/unittests/tweaks/DefineInlineTests.cpp
+++ b/clang-tools-extra/clangd/unittests/tweaks/DefineInlineTests.cpp
@@ -937,8 +937,9 @@ TEST_F(DefineInlineTest, AddInline) {
   apply(R"cpp(#include "a.h"
               const int fo^o() { return 0; })cpp",
         &EditedFiles);
-  EXPECT_THAT(EditedFiles, testing::ElementsAre(FileWithContents(
-                               testPath("a.h"), "inline const int foo(){ return 0; }")));
+  EXPECT_THAT(EditedFiles,
+              testing::ElementsAre(FileWithContents(
+                  testPath("a.h"), "inline const int foo(){ return 0; }")));
 
   // No double inline.
   ExtraFiles["a.h"] = "inline void foo();";

``````````

</details>


https://github.com/llvm/llvm-project/pull/123470


More information about the cfe-commits mailing list