Run clang-tidy over toolchain code. (#3105)

Amongst other changes, this removes the implicit StringRef cast in
formatter code due to google-explicit-constructor. Only one line of code
relied on the implicit cast, and style says "Do not define implicit
conversions."
(https://google.github.io/styleguide/cppguide.html#Implicit_Conversions).

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2023-08-16 15:21:58 +00:00
committed by GitHub
co-authored by Richard Smith
parent fa857e42be
commit 09242eeebd
6 changed files with 24 additions and 23 deletions
+2 -1
View File
@@ -640,8 +640,9 @@ auto SemanticsContext::GetUnqualifiedType(SemanticsTypeId type_id)
-> SemanticsTypeId {
SemanticsNode type_node =
semantics_ir_->GetNode(semantics_ir_->GetTypeAllowBuiltinTypes(type_id));
if (type_node.kind() == SemanticsNodeKind::ConstType)
if (type_node.kind() == SemanticsNodeKind::ConstType) {
return type_node.GetAsConstType();
}
return type_id;
}