llvm/llvm-project

clang-include-cleaner - replaces chrono with bits/chrono

Open

#68,213 创建于 2023年10月4日

在 GitHub 查看
 (12 评论) (3 反应) (0 负责人)C++ (10,782 fork)batch import
clang-include-cleanergood first issuehelp wanted

仓库指标

Star
 (26,378 star)
PR 合并指标
 (平均合并 1天 2小时) (30 天内合并 1,000 个 PR)

描述

Issues found:

a)

+#include <bits/basic_string.h>
+#include <string>

b)

-#include <chrono>
+#include <bits/chrono.h>

Tested version from LLVM 17.0.2

misc-include-cleaner provide more information:

160   - DiagnosticName:  misc-include-cleaner
161     DiagnosticMessage:
162       Message:         'no header providing "std::operator""s" is directly included'
163       FilePath:        'some-file.cpp'
164       FileOffset:      982
165       Replacements:
166         - FilePath:        'some-file.cpp'
167           Offset:          52
168           Length:          0
169           ReplacementText: "#include <bits/basic_string.h>\n"

And:

304   - DiagnosticName:  misc-include-cleaner
305     DiagnosticMessage:
306       Message:         'no header providing "std::chrono::ceil" is directly included'
307       FilePath:        'some-file.cpp'
308       FileOffset:      3133
309       Replacements:
310         - FilePath:        'some-file.cpp'
311           Offset:          43
312           Length:          0
313           ReplacementText: "#include <bits/chrono.h>\n"

When <chrono> is already included.

贡献者指南