]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/90098 - partial specialization and class non-type parms.
authorJason Merrill <jason@redhat.com>
Fri, 19 Jul 2019 08:53:07 +0000 (04:53 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 19 Jul 2019 08:53:07 +0000 (04:53 -0400)
commita0385e9b466aa8d9ba79578b466316630540ee9b
tree159ebdb62b6ffe7fd73b5df68a69c335e96ff445
parent760811e5f54e5052059f4697648c5a13008108c4
PR c++/90098 - partial specialization and class non-type parms.

A non-type template parameter of class type used in an expression has
const-qualified type; the pt.c hunks deal with this difference from the
unqualified type of the parameter declaration.  WAhen we use such a
parameter as an argument to another template, we don't want to confuse
things by copying it, we should pass it straight through.  And we might as
well skip copying other classes in constant evaluation context in a
template, too; we'll get the copy semantics at instantiation time.

PR c++/90099
PR c++/90101
* call.c (build_converted_constant_expr_internal): Don't copy.
* pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
around class non-type parameter.
(unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
(invalid_nontype_parm_type_p): Check for dependent class type.

From-SVN: r273597
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/nontype-class18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/nontype-class19.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/nontype-class20.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/nontype-class21.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/nontype-class22.C [new file with mode: 0644]