[clang-tools-extra] [clang-tidy][NFC] Fix invalid example in use-trailing-return-type docs (PR #249496)

via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 12:56:15 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tidy

Author: Valgarður (probablynotval)

<details>
<summary>Changes</summary>

`noexcept` must come before the trailing return type, so the current example doesn't compile.

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


1 Files Affected:

- (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.rst (+1-1) 


``````````diff
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.rst
index f74158bd630907..d3122de05d8453 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.rst
@@ -23,7 +23,7 @@ transforms to:
 .. code-block:: c++
 
   auto f1() -> int;
-  inline auto f2(int arg) -> int noexcept;
+  inline auto f2(int arg) noexcept -> int;
   virtual auto f3() const && -> float = delete;
   auto lambda = []() -> void {};
 

``````````

</details>


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


More information about the cfe-commits mailing list