[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:12 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 88181 tests passed
* 1657 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
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:2:12 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:2:12 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:2:12 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:2:12 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC1 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 9
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:8:30 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC2 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:8:30 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC2 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 10
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:8:30 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC2 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:8:30 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC2 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 26
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:25:22 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:25:22 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 27
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:25:22 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:25:22 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 35
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:32:29 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:32:29 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 36
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:32:29 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++14 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:32:29 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# note: command had no output on stdout or stderr
# RUN: at line 42
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:38:39 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC5 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -fsyntax-only -std=c++98 -code-completion-at=/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp:38:39 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeCompletion/ctor-initializer.cpp -o -
# .---command stderr------------
# | /home/gha/actions-runner/_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 : {
# |       |                             ^
# | /home/gha/actions-runner/_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: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-CC5 /home/gha/actions-runner/_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