On Fri, 3 Dec 2021 13:13:23 +0100 Ichthyostega <p...@ichthyostega.de> wrote:
>Am 02.12.21 um 22:39 schrieb Will Godfrey: > >> Date: Thu, 02 Dec 2021 12:56:15 -0800 >> From: "yuri@FreeBSD" <notificati...@github.com> >> To: Yoshimi/yoshimi <yosh...@noreply.github.com> >> Subject: [Yoshimi/yoshimi] 2.1.2.1: error: constexpr variable 'LN_BASE' must >> be >> initialized by a constant expression (Issue #156) > > >> It fails when built with clang-12: > > >> Misc/NumericFuncs.h:96:32: >> error: constexpr variable 'LN_BASE' must be initialized by a constant > >> expression static constexpr float LN_BASE = log(fraction? 1.0/base : >> double(base)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >...which is strange, because, to my understanding, the whole point >of constexpr variables is to be initialised by a const expression, >not just a constant. A "const expression" is anything that can >be evaluated completely at compile time. As in our case, the >logarithm. For that very reason, both "base" and the "fraction" toggle >are template parameters, and chosen for each instantiation anew. > > >Just a guess: maybe Clang is overly picky here, since we still set the >language level at C++11, which indeed had already the keyword constexpr, >but didn't yet allow evaluation of const expressions explicitly. Simply >because at that time, the specifications and implementations weren't >mature enough to be standardised. However, at that time, compilers with >more or less complete C++11 support *did* already evaluate constant >expressions (since this was the whole point of the exercise). > >Btw, why are we still setting the language level to C++11? >I vaguely recall a discussion to the end that we could without damage >raise the level to C++14 (and still support Ubuntu 14.04)... > >-- Hermann Let's go for this low hanging fruit first. I'll suggest the guy tries with C++14 set in CmakeLists.txt I don't remember exactly, but I don't remember 14 being mentioned. it was 17 I was concerned about as 9at the time) that was only 3 years old, and i was concerned about people compiling on old systems, whereas 14 is now 7 years old. -- Will J Godfrey https://willgodfrey.bandcamp.com/ http://yoshimi.github.io Say you have a poem and I have a tune. Exchange them and we can both have a poem, a tune, and a song. _______________________________________________ Yoshimi-devel mailing list Yoshimi-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/yoshimi-devel