lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUB failing


From: Jonas Hahnfeld
Subject: Re: GUB failing
Date: Sun, 12 Jul 2020 17:09:38 +0200
User-agent: Evolution 3.36.4

Am Sonntag, den 12.07.2020, 13:46 +0100 schrieb Phil Holmes:
> Getting this error:
> 
> /home/gub/NewGub/gub/target/linux-64/src/lilypond-git.sv.gnu.org--lilypond.git-release-unstable/lily/include/ly-scm-list.hh:166:69:
>  
> error: cannot call member function 'ly_scm_iterator_t<T, 
> allow_mutation>::private_scm& ly_scm_iterator_t<T, 
> allow_mutation>::dereference_scm() const [with T = const Book*; bool 
> allow_mutation = true; ly_scm_iterator_t<T, allow_mutation>::private_scm = 
> scm_unused_struct*]' without object
> make[1]: *** [out/book.o] Error 1

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57543, which we can
also use as a workaround. (Note that there appear to be quite some bugs
with decltype in trailing return types with old compiler versions and
support for member functions was only voted very late in the process to
C++11, see https://stackoverflow.com/a/5159293/10606944).

Dan, ok to do the following? (I'd push directly to release/unstable...)
---
commit 533d40176adbf6ee03b207db16f460736eae367a (HEAD -> fix-decltype-gcc)
Author: Jonas Hahnfeld <hahnjo@hahnjo.de>
Date:   Sun Jul 12 17:05:28 2020 +0200

    Fix trailing return type for old GCC
    
    GCC 4.9.4 complains that it "cannot call member function
    dereference_scm() without object" which appears to be a bug, see
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57543. Work around
    this issue by adding an explicit 'this' for the member call.

diff --git a/lily/include/ly-scm-list.hh b/lily/include/ly-scm-list.hh
index 5d6fb03ee8..959bc9bb67 100644
--- a/lily/include/ly-scm-list.hh
+++ b/lily/include/ly-scm-list.hh
@@ -163,7 +163,9 @@ public:
   // operator * takes no parameters.  TODO: It might be possible to provide a
   // uniform fallback value as a parameter of the list template.
   //
-  auto operator * () const->decltype (from_scm<T> (dereference_scm ()))
+  // (Explicit 'this' in trailing decltype needed because of bug in GCC, see
+  // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57543)
+  auto operator * () const->decltype (from_scm<T> (this->dereference_scm ()))
   {
     return from_scm<T> (dereference_scm ());
   }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]