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.cc20
1 files changed, 2 insertions, 18 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 6df16fe..3f1cf13 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -26815,20 +26815,7 @@ instantiate_body (tree pattern, tree args, tree d, bool nested_p)
if (current_function_decl)
save_omp_privatization_clauses (omp_privatization_save);
- bool push_to_top
- = !(current_function_decl
- && !LAMBDA_FUNCTION_P (d)
- && decl_function_context (d) == current_function_decl);
-
- if (push_to_top)
- push_to_top_level ();
- else
- {
- gcc_assert (!processing_template_decl);
- push_function_context ();
- cp_unevaluated_operand = 0;
- c_inhibit_evaluation_warnings = 0;
- }
+ bool push_to_top = maybe_push_to_top_level (d);
mark_template_arguments_used (pattern, args);
@@ -26942,10 +26929,7 @@ instantiate_body (tree pattern, tree args, tree d, bool nested_p)
if (!nested_p)
TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (d)) = 0;
- if (push_to_top)
- pop_from_top_level ();
- else
- pop_function_context ();
+ maybe_pop_from_top_level (push_to_top);
if (current_function_decl)
restore_omp_privatization_clauses (omp_privatization_save);