[clang] [clang-tools-extra] [clangd] Fix clangd crash when code completion EOF is reached while skipping a function body (PR #203716)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 13 10:23:11 PDT 2026


github-actions[bot] wrote:

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

* 54029 tests passed
* 1317 tests skipped
* 1 test failed

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

### Clang
<details>
<summary>Clang.CodeCompletion/ctor-initializer.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:2:12 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC1 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++98 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:2:12' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC1 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:2:12 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC1 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++14 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:2:12' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC1 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 9
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:8:30 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC2 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++98 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:8:30' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC2 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 10
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:8:30 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC2 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++14 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:8:30' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC2 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 26
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:25:22 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC3 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++98 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:25:22' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC3 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 27
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:25:22 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC3 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++14 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:25:22' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC3 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 35
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:32:29 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC3 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++98 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:32:29' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC3 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 36
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:32:29 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC3 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++14 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:32:29' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC3 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 42
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:38:39 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-CC5 C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fsyntax-only -std=c++98 '-code-completion-at=C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:38:39' 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp' -o -
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:32:29: error: expected class member or base class name
# |    32 | Derived::Derived(int) try : {
# |       |                             ^
# | C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp:32:23: error: cannot use 'try' with exceptions disabled
# |    32 | Derived::Derived(int) try : {
# |       |                       ^
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-CC5 'C:\_work\llvm-project\llvm-project\clang\test\CodeCompletion\ctor-initializer.cpp'
# note: command had no output on stdout or stderr

--

```
</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/203716


More information about the cfe-commits mailing list