https://gcc.gnu.org/g:e5b6b6f7198b1d3212abe1858b8091c2dcc828a2

commit r16-4633-ge5b6b6f7198b1d3212abe1858b8091c2dcc828a2
Author: Gerald Pfeifer <[email protected]>
Date:   Sun Oct 26 18:01:02 2025 +0100

    poly-int: Fix struct vs class confusion
    
    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.

Diff:
---
 gcc/poly-int.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/poly-int.h b/gcc/poly-int.h
index 77f78752e74d..d99f63b671fb 100644
--- a/gcc/poly-int.h
+++ b/gcc/poly-int.h
@@ -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;

Reply via email to