aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e0b7a2a90aa..a6398c04f85 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15194,25 +15194,21 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
DECL_CONTEXT (decl) = current_function_decl;
cp_check_omp_declare_reduction (decl);
}
- else if (VAR_P (decl)
- && DECL_PRETTY_FUNCTION_P (decl))
- {
- /* For __PRETTY_FUNCTION__ we have to adjust the
- initializer. */
- const char *const name
- = cxx_printable_name (current_function_decl, 2);
- init = cp_fname_init (name, &TREE_TYPE (decl));
- SET_DECL_VALUE_EXPR (decl, init);
- DECL_HAS_VALUE_EXPR_P (decl) = 1;
- DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1;
- maybe_push_decl (decl);
- }
else
{
int const_init = false;
maybe_push_decl (decl);
-
- init = tsubst_init (init, decl, args, complain, in_decl);
+ if (VAR_P (decl)
+ && DECL_PRETTY_FUNCTION_P (decl))
+ {
+ /* For __PRETTY_FUNCTION__ we have to adjust the
+ initializer. */
+ const char *const name
+ = cxx_printable_name (current_function_decl, 2);
+ init = cp_fname_init (name, &TREE_TYPE (decl));
+ }
+ else
+ init = tsubst_init (init, decl, args, complain, in_decl);
if (VAR_P (decl))
const_init = (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P