https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116108
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-07-26 Target Milestone|--- |12.5 Known to fail| |10.1.0, 12.1.0 Known to work| |9.5.0 Status|UNCONFIRMED |NEW Summary|GCC crashes on incorrect |[12/13/14/15 Regression] |code with -std=c++20 |GCC crashes on incorrect | |code with -std=c++20 Keywords|error-recovery | --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: ``` template<class T> struct size_t_class { const size_t_class value = 1; }; size_t_class t{2}; ``` This is invalid since size_t_class is incomplete type in itself :). Well and there is no way to deduce the template argument here. GCC 9.5.0 reported: ``` <source>:5:17: error: class template argument deduction failed: 5 | size_t_class t{2}; | ^ <source>:5:17: error: no matching function for call to 'size_t_class(int)' <source>:2:8: note: candidate: 'template<class T> size_t_class(size_t_class<T>)-> size_t_class<T>' 2 | struct size_t_class { | ^~~~~~~~~~~~ <source>:2:8: note: template argument deduction/substitution failed: <source>:5:17: note: mismatched types 'size_t_class<T>' and 'int' 5 | size_t_class t{2}; | ^ ``` So a regression.