[Bug analyzer/93543] [10 regression] bootstrap with clang 9.0.1 fails in analyzer: reinterpret_cast from 'nullptr_t' to 'function *' is not allowed
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 3 20:11:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93543
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Here's a simpler patch; does it fix the build with clang?
gcc/analyzer/ChangeLog:
PR analyzer/93543
* engine.cc (pod_hash_traits<function_call_string>::mark_empty):
Eliminate reinterpret_cast.
(pod_hash_traits<function_call_string>::is_empty): Likewise.
---
gcc/analyzer/engine.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 90f7067dec1..81b8a76c5eb 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -2962,7 +2962,7 @@ template <>
inline void
pod_hash_traits<function_call_string>::mark_empty (value_type &v)
{
- v.m_fun = reinterpret_cast<function *> (NULL);
+ v.m_fun = NULL;
}
template <>
inline bool
@@ -2974,7 +2974,7 @@ template <>
inline bool
pod_hash_traits<function_call_string>::is_empty (value_type v)
{
- return v.m_fun == reinterpret_cast<function *> (NULL);
+ return v.m_fun == NULL;
}
namespace ana {
--
2.21.0
More information about the Gcc-bugs
mailing list