From 6e13779b8b22df9d1d2d8ce4e6216cb9e73aaf4f Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 8 Apr 2026 20:05:36 -0400 Subject: [PATCH] Use C++-sryle `static_cast`, not C-style explicit cast `uint32_t(param)` is actually functional notation of explicit casting, not a direct constructor call. `uint32_t{param}` would be uniform initialization syntax for a constructor call, but would not allow narrowing from `uint64_t`. See issue #1904 for discussion. --- src/diagnostics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnostics.cpp b/src/diagnostics.cpp index b610c9df..e12c4004 100644 --- a/src/diagnostics.cpp +++ b/src/diagnostics.cpp @@ -76,5 +76,5 @@ std::pair> getInitialWarningState(std::str } } - return {state, param > UINT32_MAX ? UINT32_MAX : uint32_t(param)}; + return {state, param > UINT32_MAX ? UINT32_MAX : static_cast(param)}; }