diff --git a/include/verilated_types.h b/include/verilated_types.h index 79d9f1ee7..fd0341a2d 100644 --- a/include/verilated_types.h +++ b/include/verilated_types.h @@ -24,7 +24,6 @@ #ifndef VERILATOR_VERILATED_TYPES_H_ #define VERILATOR_VERILATED_TYPES_H_ -#include "verilatedos.h" #ifndef VERILATOR_VERILATED_H_INTERNAL_ #error "verilated_types.h should only be included by verilated.h" #endif @@ -2071,15 +2070,24 @@ struct VlNull final { return nullptr; } template - VL_CONSTEXPR_CXX17 bool operator==(T* ptr) const { - return !ptr; + bool operator==(T* rhs) const { + return !rhs; } template - VL_CONSTEXPR_CXX17 bool operator==(const T* ptr) const { - return !ptr; + bool operator==(const T* rhs) const { + return !rhs; } }; +template +inline bool operator==(T* lhs, VlNull) { + return !lhs; +} +template +inline bool operator==(const T* lhs, VlNull) { + return !lhs; +} + //=================================================================== // Verilog class reference container // There are no multithreaded locks on this; the base variable must diff --git a/test_regress/t/t_clang_overload.py b/test_regress/t/t_clang_overload.py index b2e525416..0f1f5d0a0 100755 --- a/test_regress/t/t_clang_overload.py +++ b/test_regress/t/t_clang_overload.py @@ -4,13 +4,13 @@ # This program is free software; you can redistribute it and/or modify it # under the terms of either the GNU Lesser General Public License Version 3 # or the Perl Artistic License Version 2.0. -# SPDX-FileCopyrightText: 2024 Wilson Snyder +# SPDX-FileCopyrightText: 2026 Wilson Snyder # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 import vltest_bootstrap test.scenarios('vlt') -test.compile(verilator_flags2=['--binary', '--timing', '--compiler', 'clang', '-Wno-fatal']) +test.compile(verilator_flags2=['--binary', '-Wno-WIDTHTRUNC']) test.passes()