mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 08:41:03 +01:00
Clean up clang-tidy issues in explorer. (#2621)
google-readability-function-size and readability-function-size were _both_ triggering on TypeCheckExp. It looks like the Google version may be a subset of the general version, so I've disabled the Google version while keeping the general version and adding a NOLINT for it. I manually removed the `const` in cases like `Nonnull<const VTable* const>` based on the readability-const-return-type warning. i.e., where a return type is a pointer, the `const` isn't meaningful and the tidy check was warning about that. Added a NOLINT for misc-definitions-in-headers on IsRecursivelyTransformable. I think that's the right choice for the `constexpr`, the warning didn't feel accurate and may be getting confused by the templating. I changed the structure of `carbon_files` in the fuzzer because the `new` was causing a warning about exceptions. However, also disabling bugprone-exception-escape because it's what was flagging this and it's not really a helpful warning. Other changes were automated. Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
16f86471e7
commit
7fe8bb308b
@@ -441,7 +441,7 @@ void AlternativeSignature::PrintID(llvm::raw_ostream& out) const {
|
||||
|
||||
auto ChoiceDeclaration::FindAlternative(std::string_view name) const
|
||||
-> std::optional<const AlternativeSignature*> {
|
||||
for (auto* alt : alternatives()) {
|
||||
for (const auto* alt : alternatives()) {
|
||||
if (alt->name() == name) {
|
||||
return alt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user