aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.cc')
-rw-r--r--gcc/cp/pt.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 26ed9de..7b296d1 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -7492,8 +7492,13 @@ get_template_parm_object (tree expr, tree name, bool check_init/*=true*/)
{
/* The EXPR is the already processed initializer, set it on the NTTP
object now so that cp_finish_decl doesn't do it again later. */
+ gcc_checking_assert (reduced_constant_expression_p (expr));
DECL_INITIAL (decl) = expr;
- DECL_INITIALIZED_P (decl) = 1;
+ DECL_INITIALIZED_P (decl) = true;
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = true;
+ /* FIXME setting TREE_CONSTANT on refs breaks the back end. */
+ if (!TYPE_REF_P (type))
+ TREE_CONSTANT (decl) = true;
}
pushdecl_top_level_and_finish (decl, expr);
@@ -21330,13 +21335,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* Avoid error about taking the address of a constructor. */
function = TREE_OPERAND (function, 0);
- tsubst_flags_t subcomplain = complain;
- if (koenig_p && TREE_CODE (function) == FUNCTION_DECL)
- /* When KOENIG_P, we don't want to mark_used the callee before
- augmenting the overload set via ADL, so during this initial
- substitution we disable mark_used by setting tf_conv (68942). */
- subcomplain |= tf_conv;
- function = tsubst_expr (function, args, subcomplain, in_decl);
+ function = tsubst_expr (function, args, complain, in_decl);
if (BASELINK_P (function))
qualified_p = true;