public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-coroutines] analyzer: fix build error with clang (PR 93543)
@ 2020-02-04 20:58 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2020-02-04 20:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1dae549dccfec1edb0cb4e65feadc4722bb3bcc8

commit 1dae549dccfec1edb0cb4e65feadc4722bb3bcc8
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Jan 28 16:31:01 2020 -0500

    analyzer: fix build error with clang (PR 93543)
    
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243681 reports a build
    failure with clang 9.0.1:
    
    gcc/analyzer/engine.cc:2971:13: error:
          reinterpret_cast from 'nullptr_t' to 'function *' is not allowed
      v.m_fun = reinterpret_cast<function *> (NULL);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    engine.cc:2983:21: error:
          reinterpret_cast from 'nullptr_t' to 'function *' is not allowed
      return v.m_fun == reinterpret_cast<function *> (NULL);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    The casts appears to be unnecessary; eliminate them.
    
    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.

Diff:
---
 gcc/analyzer/ChangeLog | 7 +++++++
 gcc/analyzer/engine.cc | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index 4f0d014..8089280 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,3 +1,10 @@
+2020-02-04  David Malcolm  <dmalcolm@redhat.com>
+
+	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.
+
 2020-02-03  David Malcolm  <dmalcolm@redhat.com>
 
 	* constraint-manager.cc (range::constrained_to_single_element):
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 90f7067..81b8a76 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 {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-04 20:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 20:58 [gcc/devel/c++-coroutines] analyzer: fix build error with clang (PR 93543) Iain D Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).