]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
X86: Provide a CTOR for stringop_algs [PR100246].
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 3 Jul 2021 18:47:48 +0000 (19:47 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 20 Jul 2021 06:58:03 +0000 (07:58 +0100)
Several older compilers fail to build modern GCC because of missing
or incomplete C++11 support.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/100246 - [11/12 Regression] GCC will not bootstrap with clang 3.4/3.5 [xcode 5/6, Darwin 12/13]

PR bootstrap/100246

gcc/ChangeLog:

* config/i386/i386.h (struct stringop_algs): Define a CTOR for
this type.

(cherry picked from commit f99f6eb58e1f894dae024f63cc2fe30fa7605e59)

gcc/config/i386/i386.h

index 05e34c8d14af7f8ebacc278a7d92c1c98763a73b..5583ec6881a0e527135d16ea862240340a0c52c4 100644 (file)
@@ -251,6 +251,15 @@ struct stringop_algs
 {
   const enum stringop_alg unknown_size;
   const struct stringop_strategy {
+    /* Several older compilers delete the default constructor because of the
+       const entries (see PR100246).  Manually specifying a CTOR works around
+       this issue.  Since this header is used by code compiled with the C
+       compiler we must guard the addition.  */
+#ifdef __cplusplus
+    stringop_strategy(int _max = -1, enum stringop_alg _alg = libcall,
+                     int _noalign = false)
+      : max (_max), alg (_alg), noalign (_noalign) {}
+#endif
     const int max;
     const enum stringop_alg alg;
     int noalign;