]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
poly-int: Fix struct vs class confusion
authorGerald Pfeifer <gerald@pfeifer.com>
Sun, 26 Oct 2025 17:01:02 +0000 (18:01 +0100)
committerGerald Pfeifer <gerald@pfeifer.com>
Sun, 26 Oct 2025 17:01:02 +0000 (18:01 +0100)
We currently issue a good deal of warnings of the following kind:

  In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/coretypes.h:500:
  .../GCC-HEAD/gcc/poly-int.h:378:1: warning: 'poly_int' defined as a
  struct template here but previously declared as a class template; this
  is valid, but may result in linker errors under the Microsoft C++ ABI
  [-Wmismatched-tags]
    378 | struct poly_int
        | ^
  .../GCC-HEAD/gcc/poly-int.h:32:38: note: did you mean struct here?
     32 | template<unsigned int N, typename T> class poly_int;
        |                                      ^~~~~
        |                                      struct

A `grep "'poly_int' defined as a struct template" | cut -d: -f1 | uniq -c`
shows 749 issue for a typical bootstrap.

Addressing this brings down the bootstrap log by 8.5% - from 80454 lines
down to 73613.

gcc:
* poly-int.h: Change struct poly_int to class poly_int.

gcc/poly-int.h

index 77f78752e74d06827591dcabc4f9c756239c13b3..d99f63b671fb0e6f3a555868380848b802b4f6f5 100644 (file)
@@ -374,7 +374,7 @@ template<> struct poly_int_fullness<true> { using type = poly_int_full; };
 /* A class containing polynomial integers.  The polynomial has N coefficients
    of type C, and N - 1 indeterminates.  */
 template<unsigned int N, typename C>
-struct poly_int
+class poly_int
 {
 public:
   poly_int () = default;