From 2a39e837798f5f959765cd23323f58d4336e30a2 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 21 May 2024 17:22:47 +0200 Subject: [PATCH] Fix a new C-style cast `clang-tidy` error in #3963. (#3965) This isn't *technically* a C-style cast, but a function-style cast. And newer versions of `clang-tidy` no longer fire on this code, so it is a little sad to have to work around. But the version on our build bots seems old enough to still hit this issue (and possibly some others). Our merge queue also doesn't seem to catch these reliably, but that's for a separate PR. --- toolchain/parse/handle_decl_scope_loop.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain/parse/handle_decl_scope_loop.cpp b/toolchain/parse/handle_decl_scope_loop.cpp index b79a60a77c9b..1c6f1f4c9f7a 100644 --- a/toolchain/parse/handle_decl_scope_loop.cpp +++ b/toolchain/parse/handle_decl_scope_loop.cpp @@ -187,7 +187,8 @@ static auto ResolveAmbiguousTokenAsDeclaration(Context& context, case Lex::TokenKind::Package: // `package.foo` is an expression; any other token after `package` is // a `package` introducer. - return context.PositionKind(Lookahead(2)) == Lex::TokenKind::Period; + return context.PositionKind(static_cast(2)) == + Lex::TokenKind::Period; default: return true;