summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-29 19:51:23 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-29 19:51:23 +0000
commit1dcd84cf006a895316f89eacd5fe0d13f998e575 (patch)
treec85f3a633a40b0563809d56852c3087090ec1bf6 /gcc/cp/pt.c
parentb38367d964273ecbfbd6e0c82ccf2d30ae63a833 (diff)
downloadgcc-1dcd84cf006a895316f89eacd5fe0d13f998e575.tar.gz
Various small fixes.
* lambda.c (build_lambda_object): Check for error_mark_node. * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type pack as well. (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters. (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251428 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 416d17b5d18..aaae06d96c7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3773,6 +3773,7 @@ make_pack_expansion (tree arg)
purpose = cxx_make_type (TYPE_PACK_EXPANSION);
SET_PACK_EXPANSION_PATTERN (purpose, TREE_PURPOSE (arg));
PACK_EXPANSION_PARAMETER_PACKS (purpose) = parameter_packs;
+ PACK_EXPANSION_LOCAL_P (purpose) = at_function_scope_p ();
/* Just use structural equality for these TYPE_PACK_EXPANSIONS;
they will rarely be compared to anything. */
@@ -9535,6 +9536,7 @@ static inline bool
neglectable_inst_p (tree d)
{
return (DECL_P (d)
+ && !undeduced_auto_decl (d)
&& !(TREE_CODE (d) == FUNCTION_DECL ? DECL_DECLARED_CONSTEXPR_P (d)
: decl_maybe_constant_var_p (d)));
}
@@ -12413,6 +12415,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
DECL_ARGUMENTS (r) = tsubst (DECL_ARGUMENTS (t), args,
complain, t);
+ for (tree parm = DECL_ARGUMENTS (r); parm; parm = DECL_CHAIN (parm))
+ DECL_CONTEXT (parm) = r;
DECL_RESULT (r) = NULL_TREE;
TREE_STATIC (r) = 0;
@@ -13786,6 +13790,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
couldn't do it earlier because it might be an auto parameter,
and we wouldn't need to if we had an argument. */
type = tsubst (type, args, complain, in_decl);
+ if (type == error_mark_node)
+ return error_mark_node;
r = reduce_template_parm_level (t, type, levels, args, complain);
break;