> 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. > > Tested x86_64-pc-linux-gnu, applying to trunk. > > 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.
This apparently went down to the 9 branch as well and introduced: Running /home/eric/cvs/gcc-9/gcc/testsuite/g++.dg/dg.exp ... ERROR: g++.dg/cpp2a/nontype-class-defarg1.C -std=c++98: syntax error in target selector "target c++20" for " dg-do 2 compile { target c++20 } " ERROR: g++.dg/cpp2a/nontype-class-defarg1.C -std=c++98: syntax error in target selector "target c++20" for " dg-do 2 compile { target c++20 } " ERROR: g++.dg/cpp2a/nontype-class-defarg1.C -std=c++14: syntax error in target selector "target c++20" for " dg-do 2 compile { target c++20 } " ERROR: g++.dg/cpp2a/nontype-class-defarg1.C -std=c++14: syntax error in target selector "target c++20" for " dg-do 2 compile { target c++20 } " ERROR: g++.dg/cpp2a/nontype-class-defarg1.C -std=c++17: syntax error in target selector "target c++20" for " dg-do 2 compile { target c++20 } " ERROR: g++.dg/cpp2a/nontype-class-defarg1.C -std=c++17: syntax error in target selector "target c++20" for " dg-do 2 compile { target c++20 } " On the contrary, the 10 branch is a in good shape. -- Eric Botcazou