简体   繁体   English

使用 \\n 而不是 endl 和 -std=c++2a 时奇怪的 clangd 崩溃

[英]Strange clangd crash when using \n instead of endl with -std=c++2a

This is the reference source file这是参考源文件

#include <iostream>
int main() {
    int x = 7;
    std::cout << x << '\n';
}

If I open a line before the line with cout and write std:: I correctly see YCM's semantic cmpletion popup;如果我带有cout的行之前打开一行并写入std::我正确地看到 YCM 的语义 cmpletion 弹出窗口; if I do the same after the line with cout , I get a ResponseAbortedException: Response Aborted error.如果我cout之后做同样的事情,我会得到一个ResponseAbortedException: Response Aborted错误。

:YcmDebugInfo gives :YcmDebugInfo给出

Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_fiumsvcv.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.8.6
-- Server has Clang support compiled in: True
-- Clang version: clang version 10.0.0 (https://github.com/ycm-core/llvm 038587147cf2f97d1c3e677042f69560c65b5bea)
-- Extra configuration file found and loaded
-- Extra configuration path: /home/enrico/.ycm_extra_conf.py
-- C-family completer debug information:
--   Clangd not running
--   Clangd executable: ['/home/enrico/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-cross-file-rename', '-header-insertion-decorators=0', '-resource-dir=/home/enrico/.vim/plugged/YouCom
pleteMe/third_party/ycmd/third_party/clang/lib/clang/10.0.0', '-limit-results=500']
--   Clangd logfiles:
--     /tmp/clangd_stderryqofwzop.log
--   Clangd Server State: Dead
--   Clangd Project Directory: /home/enrico
--   Clangd Settings: {}
--   Clangd Compilation Command: ['clang-tool', '-x', 'c++', '-std=c++2a', '-Wall', '-Wextra', '-Werror', '/home/enrico/deleteme.cpp']
-- Server running at: http://127.0.0.1:42807
-- Server process ID: 25037
-- Server logfiles:
--   /tmp/ycmd_42807_stdout_9pmpk9zp.log
--   /tmp/ycmd_42807_stderr_iat9y0gn.log

This is a screencast of the issue.这是该问题的截屏视频

My suggestions:我的建议:

  • Upgrade to a newer clangd.升级到更新的 clangd。 The latest released version is 11, and there are even newer weekly snapshot releases available on Github .最新发布的版本是 11, Github上甚至还有更新的每周快照版本。

  • If the crash persists, run clangd with --log=verbose , and file a clangd issue with the log attached.如果崩溃仍然存在,请使用--log=verbose运行 clangd,并提交带有附加日志的clangd 问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM