[Bug c++/124173] [16 Regression] template argument deduction/substitution failed with nullptr_t in C++11/14 since r16-7582
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 20 19:08:40 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124173
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Looking at C++14, [temp.arg.nontype]/1 says
A template-argument for a non-type template-parameter shall be a converted
constant expression of the type of the template-parameter.
Looking at C++1, [temp.arg.nontype]/1 says there
A template-argument for a non-type, non-template template-parameter shall be
one of:
— for a non-type template-parameter of integral or enumeration type, a
converted constant expression of the type of the template-parameter; or
...
— a constant expression that evaluates to a null pointer value; or
So, I think at least for C++14 NULLPTR_TYPE_P should be added next to
integral/enumeral check, for C++11 dunno what the actual difference between
converted constant expression vs. constant expression.
More information about the Gcc-bugs
mailing list