diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index fc5af16..d05bfd2 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9058,6 +9058,22 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) complain); } + case DECLTYPE_TYPE: + { + tree type; + + type = + finish_decltype_type (tsubst_expr + (DECLTYPE_TYPE_EXPR (t), args, + complain, in_decl, + /*integral_constant_expression_p=*/false), + DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t)); + return cp_build_qualified_type_real (type, + cp_type_quals (t) + | cp_type_quals (type), + complain); + } + case TYPE_ARGUMENT_PACK: case NONTYPE_ARGUMENT_PACK: { @@ -9621,6 +9637,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) case TYPENAME_TYPE: case UNBOUND_CLASS_TEMPLATE: case TYPEOF_TYPE: + case DECLTYPE_TYPE: case TYPE_DECL: return tsubst (t, args, complain, in_decl); @@ -12824,6 +12841,12 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) break; + case TYPEOF_TYPE: + case DECLTYPE_TYPE: + /* Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE + nodes. */ + return 0; + default: gcc_assert (EXPR_P (parm)); @@ -14888,10 +14911,11 @@ dependent_type_p_r (tree type) (INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type))))) return true; - /* All TYPEOF_TYPEs are dependent; if the argument of the `typeof' - expression is not type-dependent, then it should already been - have resolved. */ - if (TREE_CODE (type) == TYPEOF_TYPE) + /* All TYPEOF_TYPEs and DECLTYPE_TYPEs are dependent; if the + argument of the `typeof' expression is not type-dependent, then + it should already been have resolved. */ + if (TREE_CODE (type) == TYPEOF_TYPE + || TREE_CODE (type) == DECLTYPE_TYPE) return true; /* A template argument pack is dependent if any of its packed |