This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ PATCH to fix -fno-weak


We weren't using flag_weak consistently, which broke explicit instantiation
of static data member templates with -fno-weak.  No, don't ask.

Tested i686-pc-linux-gnu, applied to trunk.

Test in g++.ext/noweak1.C.

2001-05-21  Jason Merrill  <jason_merrill@redhat.com>

	* decl2.c (maybe_make_one_only): Check flag_weak, not
	supports_one_only().

*** decl2.c.~1~	Sat May 19 00:24:17 2001
--- decl2.c	Fri May 18 10:18:58 2001
*************** maybe_make_one_only (decl)
*** 2354,2360 ****
       after a weak one is an error.  Also, not making explicit
       instantiations one_only means that we can end up with two copies of
       some template instantiations. */
!   if (! supports_one_only ())
      return;
  
    /* We can't set DECL_COMDAT on functions, or finish_file will think
--- 2354,2360 ----
       after a weak one is an error.  Also, not making explicit
       instantiations one_only means that we can end up with two copies of
       some template instantiations. */
!   if (! flag_weak)
      return;
  
    /* We can't set DECL_COMDAT on functions, or finish_file will think

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]