mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Update files and clang-tidy config to pass with clang-tidy-20 (#4691)
Disables three new warnings because they lean more towards style conflicts than fixes. I've brought these up on #style. Other than that, mostly fixing basic issues, and things that clang-tidy-20 seems to fire where clang-tiday-16 didn't. One particular curious case is `llvm::StringLiteral::data()` uses, which are flagged as not strictly null-terminated; I'm switching to `const char*` in those spots which matches `llvm::formatv`'s format argument, but feels worse. I'm removing `run_clang_tidy.py` here because I'm observing it give fewer warnings than `bazel build --config=clang-tidy -k //toolchain/...`. The latter matches how we enforce in GitHub actions (and also caches results, and suppresses output for files that have no issues), so I'm dropping the bespoke script.
This commit is contained in:
@@ -610,6 +610,7 @@ template <const DispatchTableT& Table>
|
||||
auto BasicDispatch(ssize_t& index, const char* text, char* buffer) -> void {
|
||||
*buffer = text[index];
|
||||
++index;
|
||||
// NOLINTNEXTLINE(readability-avoid-return-with-void-value): For musttail.
|
||||
[[clang::musttail]] return Table[static_cast<unsigned char>(text[index])](
|
||||
index, text, buffer);
|
||||
}
|
||||
@@ -620,6 +621,7 @@ auto SpecializedDispatch(ssize_t& index, const char* text, char* buffer)
|
||||
CARBON_CHECK(C == text[index]);
|
||||
*buffer = C;
|
||||
++index;
|
||||
// NOLINTNEXTLINE(readability-avoid-return-with-void-value): For musttail.
|
||||
[[clang::musttail]] return Table[static_cast<unsigned char>(text[index])](
|
||||
index, text, buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user