[Bug c++/79092] template<auto>: type ignored if value already instantiated

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 16 20:14:00 GMT 2017


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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Nov 16 20:13:48 2017
New Revision: 254843

URL: https://gcc.gnu.org/viewcvs?rev=254843&root=gcc&view=rev
Log:
        PR c++/79092 - non-type args of different types are different

        * tree.c (cp_tree_equal): Check the type of constants.
        * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
        when comparing to previously deduced argument.
        (maybe_convert_nontype_argument): New.
        (convert_nontype_argument): Call it.
        (tsubst_copy_and_build): Handle partial instantiation of
        IMPLICIT_CONV_EXPR.
        (unify): Ignore type when deducing from array bound.
        (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
        (value_dependent_expression_p): Any type-dependent expression is
        value-dependent.  Handle IMPLICIT_CONV_EXPR.
        * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
        * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto12.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/mangle.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/tree.c


More information about the Gcc-bugs mailing list