X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fsmobs.tcc;h=c0a62535f5e4f830200c8b4a249ae955032d414f;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=7b5179256709db8570a1137109a6b1f9f14bfa4b;hpb=30203dfe5c45fb9c6255512ba0f8366b322d303f;p=lilypond.git diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index 7b51792567..c0a62535f5 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -1,7 +1,7 @@ /* -*- C++ -*- This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2005--2014 Han-Wen Nienhuys + Copyright (C) 2005--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -128,9 +128,12 @@ void Smob_base::init () if (&Super::free_smob != &Smob_base::free_smob) scm_set_smob_free (smob_tag_, Super::free_smob); - // Old GCC versions refuse comparing pointers-to-member-function of - // covariant types, so we recast here. - if (&Super::mark_smob != + // Old GCC versions get their type lattice for pointers-to-members + // tangled up to a degree where we need to typecast _both_ covariant + // types in order to be able to compare them. The other comparisons + // are for static member functions and thus are ordinary function + // pointers which work without those contortions. + if (static_cast(&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);