[clang] [Clang] Fix getReturnTypeSourceRange() for trailing return types (PR #219101)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 21:48:52 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 56277 tests passed
* 1545 tests skipped
* 3 tests failed

## Failed Tests
(click on a test name to see its output)

### Clangd Unit Tests
<details>
<summary>Clangd Unit Tests._/ClangdTests_exe/GetDeducedType/KwAutoKwDecltypeExpansion</summary>

```
Script:
--
C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\clangd\unittests\.\ClangdTests.exe --gtest_filter=GetDeducedType.KwAutoKwDecltypeExpansion
--
C:\_work\llvm-project\llvm-project\clang-tools-extra\clangd\unittests\ASTTests.cpp:253
Value of: DeducedType
  Actual: false
Expected: true
Google Test trace:
C:\_work\llvm-project\llvm-project\clang-tools-extra\clangd\unittests\ASTTests.cpp(243):  // auto in function return type with trailing return type
            struct Foo {};
            ^auto test() -> decltype(Foo()) {
              return Foo();
            }
          


```
</details>
<details>
<summary>Clangd Unit Tests._/ClangdTests_exe/Hover/All</summary>

```
Script:
--
C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\clangd\unittests\.\ClangdTests.exe --gtest_filter=Hover.All
--
C:\_work\llvm-project\llvm-project\clang-tools-extra\clangd\unittests\HoverTests.cpp:3354
Value of: H
  Actual: false
Expected: true
Google Test trace:
C:\_work\llvm-project\llvm-project\clang-tools-extra\clangd\unittests\HoverTests.cpp(3338): // simple trailing return type
            ^[[auto]] main() -> int {
              return 0;
            }
          


```
</details>
<details>
<summary>Clangd Unit Tests._/ClangdTests_exe/LocateSymbol/All</summary>

```
Script:
--
C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\clangd\unittests\.\ClangdTests.exe --gtest_filter=LocateSymbol.All
--
C:\_work\llvm-project\llvm-project\clang-tools-extra\clangd\unittests\XRefsTests.cpp:1184
Expected equality of these values:
  Results[0].PreferredDeclaration.range
    Which is: 2:13-2:17
  *WantDecl
    Which is: 1:15-1:18
// auto function return with trailing type
        struct [[Bar]] {};
        ^auto test() -> decltype(Bar()) {
          return Bar();
        }
      

C:\_work\llvm-project\llvm-project\clang-tools-extra\clangd\unittests\XRefsTests.cpp:1189
Expected equality of these values:
  WantDef
    Which is: (1:15-1:18)
  GotDef
    Which is: (2:13-2:17)
// auto function return with trailing type
        struct [[Bar]] {};
        ^auto test() -> decltype(Bar()) {
          return Bar();
        }
      


```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list