From de066348af8d9f1d7d18320106d87f6c0a2c7246 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 20 Jun 2025 16:09:22 +0200 Subject: [PATCH] Upgrade: workaround for compiler-bug Compilation failure with GCC-14.2 with the following code class Base { protected: Base() = default; }; struct Feed : Base { }; int main (int, char**) { Feed f1; // Feed f2{}; /// does not compile with GCC 14.2 return 0; } In the actual code base this can be triggered when instantiating classes with the `NonCopyable`-mix-in; seemingly the compiler attempts to invoke the base class ctor directly, while it should invoke a (synthesised) default ctor for the derived class. The problem could not be reproduced with other compiler versions at Godbolt.org --- src/steam/engine/param-weaving-pattern.hpp | 4 +- wiki/thinkPad.ichthyo.mm | 112 ++++++++++++++++++++- 2 files changed, 109 insertions(+), 7 deletions(-) diff --git a/src/steam/engine/param-weaving-pattern.hpp b/src/steam/engine/param-weaving-pattern.hpp index 59da09c66..90fc72119 100644 --- a/src/steam/engine/param-weaving-pattern.hpp +++ b/src/steam/engine/param-weaving-pattern.hpp @@ -307,8 +307,6 @@ namespace engine { { builder.emplaceParamDataBlock (&block(), turnoutSys); } - ///////////////OOO - Feed()= default; }; @@ -324,7 +322,7 @@ namespace engine { Feed mount (TurnoutSystem&) { - return Feed{}; + return Feed(); } /** Invoke the parameter-functors to create the basic parameter data */ diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 91d678bca..57a2d460c 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -166109,18 +166109,122 @@ Since then others have made contributions, see the log for the history. - - + + + - + - + + + + + + + +
+
+

+ class Base +

+

+ { +

+

+ protected: +

+

+ Base() = default; +

+

+ }; +

+

+
+ +

+

+ struct Feed +

+

+ : Base +

+

+ { +

+

+ +

+

+ }; +

+

+
+ +

+

+ int +

+

+ main (int, char**) +

+

+ { +

+

+ Feed f1; +

+

+ // Feed f1{}; /// does not compile with GCC 14.2 +

+

+ return 0; +

+

+ } +

+

+ +

+
+
+ + +
+ + + + + + + + + + + + + + + + +

+ vermutlich ein sehr spezieller Compiler-Bug +

+ + +
+ +
+ + + +