[Bug c++/90099] [P0732] Partial specialization of a class template with variadic parameter pack fails after adding non-type template parameter

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 19 06:53:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90099

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jul 19 06:52:47 2019
New Revision: 273591

URL: https://gcc.gnu.org/viewcvs?rev=273591&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/nontype-class18.C
    trunk/gcc/testsuite/g++.dg/cpp2a/nontype-class19.C
    trunk/gcc/testsuite/g++.dg/cpp2a/nontype-class20.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/pt.c


More information about the Gcc-bugs mailing list