From 30203dfe5c45fb9c6255512ba0f8366b322d303f Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 12 Oct 2014 19:39:15 +0200 Subject: [PATCH] Avoid comparing pointers-to-member of covariant types The GCC version of current GUB is not happy about those kind of comparisons, so we add a static_cast here. --- lily/include/smobs.tcc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index 0838a791b2..7b51792567 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -128,7 +128,10 @@ void Smob_base::init () if (&Super::free_smob != &Smob_base::free_smob) scm_set_smob_free (smob_tag_, Super::free_smob); - if (&Super::mark_smob != &Smob_base::mark_smob) + // Old GCC versions refuse comparing pointers-to-member-function of + // covariant types, so we recast here. + if (&Super::mark_smob != + static_cast(&Smob_base::mark_smob)) scm_set_smob_mark (smob_tag_, Super::mark_trampoline); scm_set_smob_print (smob_tag_, Super::print_trampoline); if (&Super::equal_p != &Smob_base::equal_p) -- 2.39.5