From cec64c29fea5dfb443855b5fbc40b07bc11218d0 Mon Sep 17 00:00:00 2001 From: Thomas Peters Date: Wed, 13 Sep 2023 12:16:20 -0400 Subject: [PATCH] SmallVector.h: avoid casting away constness Casting to `void*` removes constness if `T` is a `const` type. Even though the casting here is safe (i.e., no modifications are made), some compilers warn about the cast anway. Avoid casting away constness to remove some picky compiler warnings. --- include/slang/util/SmallVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/slang/util/SmallVector.h b/include/slang/util/SmallVector.h index e23e7444d..a8609465f 100644 --- a/include/slang/util/SmallVector.h +++ b/include/slang/util/SmallVector.h @@ -453,7 +453,7 @@ class SmallVectorBase { /// Indicates whether we are still "small", which means we are still on the stack. [[nodiscard]] constexpr bool isSmall() const noexcept { - return (void*)data_ == (void*)firstElement; + return (const void*)data_ == (const void*)firstElement; } protected: