[Bug c++/102871] ICE in unify, at cp/pt.c:23752 since r7-4431-g4a826ca6feb3c7ec

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 8 09:20:07 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102871

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-11-08
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase removing the auto and a few other template arguments and
making it valid C++11 code:
short arr3[1];
template <typename... Ts> struct A {
  template <Ts... Ns> A(Ts (*...qs)[Ns]);
};
A<short> a(&arr3);
------- CUT ------
The above testcase ICEs all the way down to GCC 4.8.0, before it was rejected
with:
<source>:5:17: error: no matching function for call to 'A<short int>::A(short
int (*)[1])'
<source>:5:17: note: candidates are:
<source>:3:23: note: template<Ts ...Ns> A::A(Ts (*)[Ns]...)
<source>:3:23: note:   template argument deduction/substitution failed:
<source>:5:17: note:   'Ns' is not equivalent to '1'
<source>:2:34: note: constexpr A<short int>::A(const A<short int>&)
<source>:2:34: note:   no known conversion for argument 1 from 'short int
(*)[1]' to 'const A<short int>&'
<source>:2:34: note: constexpr A<short int>::A(A<short int>&&)
<source>:2:34: note:   no known conversion for argument 1 from 'short int
(*)[1]' to 'A<short int>&&'

Note the revision referenced was just dealing with the first line of the code
which you can replace the auto with int* and get a failure earlier too.


More information about the Gcc-bugs mailing list