From 0771d9d750576cd36a710a1a99cdd4163efa0164 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 7 Jul 2011 17:53:58 -0400 Subject: re PR c++/49663 ([C++0x] ICE in lookup_base) PR c++/49663 * pt.c (push_deduction_access_scope): Preserve processing_template_decl across push_to_top_level. And revert: * class.c (pushclass): Accept NULL argument. (popclass): Deal with popping null class. * pt.c (push_access_scope, pop_access_scope): Use them rather than push_to_top_level/pop_from_top_level. * name-lookup.c (lookup_name_real_1): Check current_class_type. From-SVN: r176013 --- gcc/cp/pt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gcc/cp/pt.c') diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 17ca44c..2c64dd4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -214,7 +214,7 @@ push_access_scope (tree t) else if (DECL_CLASS_SCOPE_P (t)) push_nested_class (DECL_CONTEXT (t)); else - pushclass (NULL_TREE); + push_to_top_level (); if (TREE_CODE (t) == FUNCTION_DECL) { @@ -239,7 +239,7 @@ pop_access_scope (tree t) if (DECL_FRIEND_CONTEXT (t) || DECL_CLASS_SCOPE_P (t)) pop_nested_class (); else - popclass (); + pop_from_top_level (); } /* Do any processing required when DECL (a member template @@ -13843,7 +13843,13 @@ static void push_deduction_access_scope (tree tmpl) { if (cxx_dialect >= cxx0x) - push_access_scope (DECL_TEMPLATE_RESULT (tmpl)); + { + int ptd = processing_template_decl; + push_access_scope (DECL_TEMPLATE_RESULT (tmpl)); + /* Preserve processing_template_decl across push_to_top_level. */ + if (ptd && !processing_template_decl) + ++processing_template_decl; + } else push_deferring_access_checks (dk_no_check); } -- cgit v1.1