clang-tidy fix for cppcoreguidelines-pro-bounds-constant-array-index generates invalid code
还没有人认领这个 Issue。
评估
调研方向
首先复现 issue 中的 clang-tidy 配置和 C++ 示例,然后将生成的 fix 与 LLVM issues 37858 和 55088 进行比较。跟踪 vscode-cpptools 中的代码分析 fix 路径;完成意味着所报告的数组索引案例不再生成无效代码,包括带有前置 #if/endif 的变体。
由索引模型根据 Issue 内容生成。
描述
With 1.10.1 (currently unreleased), using "C_Cpp.codeAnalysis.clangTidy.config": "{ Checks: 'cppcoreguidelines-pro-bounds-constant-array-index', CheckOptions: [{key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader, value: '<gsl/gsl.h>'}]}"
with code
#include <array>
int func(int i)
{
std::array<int, 2> vvv;
return vvv[i];
}
generates the incorrect code return gsl::at(v, i);.
It's already reported at https://github.com/llvm/llvm-project/issues/37858 .
Bug#2: There's another related bug at https://github.com/llvm/llvm-project/issues/55088 , when there's an #if/endif at the top of the file.
- 主要语言
- TypeScript
- 星标
- 6.2k
- 派生
- 1.7k
- 平均合并
- 14 小时 46 分钟
- 30 天内合并 PR
- 61
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/vscode-cpptools 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries 未关闭bug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 已指派 1 人 ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 条评论 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 64/100
microsoft/vscode-cpptools#14769 ·
-
难度 3/5 1-2 天 新手友好度 68/100
microsoft/vscode-cpptools#14768 · 1 条评论 ·
查看 microsoft/vscode-cpptools 的全部 Issue
相似的 Issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
难度 2/5 1-3 小时 新手友好度 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 76/100
-
code-quality refactoring
难度 2/5 1-3 小时 新手友好度 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
难度 2/5 1-3 小时 新手友好度 74/100
langchain-ai/deepagents#6450 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
vercel/react-tweet#225 ·