Use explicit(false) for implicit construction (#6039)

Echoing what was added in #5608, updating existing uses. Unfortunately
there's divergent behavior for operators versus constructors, so keeping
the nolint on those.
This commit is contained in:
Jon Ross-Perkins
2025-09-10 13:47:59 +00:00
committed by GitHub
parent b74fdf52de
commit 3f799bd987
20 changed files with 75 additions and 103 deletions
+2 -2
View File
@@ -35,8 +35,8 @@ constexpr auto IsValidTemplateString(int /*unused*/) -> std::true_type {
struct AnythingAsTemplateArg {
// An implicit constructor that can accept any argument and discards it.
template <typename T>
// NOLINTNEXTLINE(google-explicit-constructor,bugprone-forwarding-reference-overload)
constexpr AnythingAsTemplateArg(T&& /*unused*/) {}
// NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
explicit(false) constexpr AnythingAsTemplateArg(T&& /*unused*/) {}
};
// An overload that will be active for any template argument. Returns a false