https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98810
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:bf49d83570ddb4df7893c3d605f7fc89db13792d commit r10-9412-gbf49d83570ddb4df7893c3d605f7fc89db13792d Author: Jason Merrill <ja...@redhat.com> Date: Thu Feb 25 16:47:53 2021 -0500 c++: Fix class NTTP constness handling [PR98810] Here, when substituting still-dependent args into an alias template, we see a non-const type because the default argument is non-const, and is not a template parm object because it's still dependent. gcc/cp/ChangeLog: PR c++/98810 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const to a class non-type template argument that needs it. gcc/testsuite/ChangeLog: PR c++/98810 * g++.dg/cpp2a/nontype-class-defarg1.C: New test.