[C++ PATCH]: Fix 2184

Nathan Sidwell nathan@codesourcery.com
Thu May 24 05:02:00 GMT 2001


Hi,
I've installed the attached on both mainline and trunk, to fix regression
2184, concerning using decls in template functions.

booted & tested on i686-pc-linux-gnu, approved by Mark.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-05-22  Nathan Sidwell  <nathan@codesourcery.com>

	* decl2.c (do_local_using_decl): Push the decls, even in a
	template.

2001-05-22  Nathan Sidwell  <nathan@codesourcery.com>

	* g++.old-deja/g++.pt/using1.C: Adjust.

Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.466
diff -c -3 -p -r1.466 decl2.c
*** decl2.c	2001/05/21 15:55:40	1.466
--- decl2.c	2001/05/22 17:12:51
*************** do_local_using_decl (decl)
*** 5136,5143 ****
    if (building_stmt_tree ()
        && at_function_scope_p ())
      add_decl_stmt (decl);
-   if (processing_template_decl)
-     return;
  
    oldval = lookup_name_current_level (name);
    oldtype = lookup_type_current_level (name);
--- 5136,5141 ----
Index: testsuite/g++.old-deja/g++.pt/using1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.pt/using1.C,v
retrieving revision 1.1
diff -c -3 -p -r1.1 using1.C
*** using1.C	2001/03/01 14:01:39	1.1
--- using1.C	2001/05/22 17:12:57
*************** template <class T> void f()
*** 15,20 ****
--- 15,22 ----
  
  template void f<float> ();
  
+ int foo (int) { return 0;}
+ 
  namespace B
  {
    int foo (int) { return 1;}
*************** namespace B
*** 27,34 ****
    }
    template int baz<float> ();
  };
- 
- int foo (int) { return 0;}
  
  int main ()
  {
--- 29,34 ----


More information about the Gcc-patches mailing list