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:
@@ -76,11 +76,13 @@ class NodeExtractor {
|
||||
std::tuple<U...>* /*type*/) -> std::optional<T>;
|
||||
|
||||
// Split out trace logic. The noinline saves a few seconds on compilation.
|
||||
// TODO: Switch format to `llvm::StringLiteral` if
|
||||
// `llvm::StringLiteral::c_str` is added.
|
||||
template <typename... ArgT>
|
||||
[[clang::noinline]] auto MaybeTrace(llvm::StringLiteral format,
|
||||
ArgT... args) const -> void {
|
||||
[[clang::noinline]] auto MaybeTrace(const char* format, ArgT... args) const
|
||||
-> void {
|
||||
if (trace_) {
|
||||
*trace_ << llvm::formatv(format.data(), args...);
|
||||
*trace_ << llvm::formatv(format, args...);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user