mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fix outstanding clang-tidy errors. (#3654)
Recent runs of `clang-tidy` for me started showing more errors, and this is a collection of changes to address them. First, I've systematically applied the disabling tag to all C++ rules under //explorer/... with `buildozer` so we don't spend time analyzing this code or reporting errors from it. Not sure this was strictly necessary, but it seemed like a nice consistency improvement. Next, I disabled a buggy check for missing `default` cases in `switch`es. It seems to get confused by the fancy conversions in our `enum_base.h`. We don't miss much with this as the Clang compiler warnings for `switch` catch most of our actual bugs. I also removed the local disabling of this now that it is turned off centrally. Lastly, I added error checking to two file descriptor manipulating calls in the `file_test` infrastructure. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
c1a894fca7
commit
13de9e9d06
@@ -288,9 +288,6 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
|
||||
-> SemIR::ConstantId {
|
||||
// TODO: Ensure we have test coverage for each of these cases that can result
|
||||
// in a constant, once those situations are all reachable.
|
||||
|
||||
// clang warns on unhandled enum values; clang-tidy is incorrect here.
|
||||
// NOLINTNEXTLINE(bugprone-switch-missing-default-case)
|
||||
switch (inst.kind()) {
|
||||
// These cases are constants if their operands are.
|
||||
case SemIR::AddrOf::Kind:
|
||||
|
||||
Reference in New Issue
Block a user