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]

Undefined external in test g++.pt/ptrmem2.C



I have a proposed change to the test g++.old-deja/g++.pt/ptrmem2.C.
This test fails on my platform (IA64 HP-UX) because we need to generate
an external statement for globals (functions in particular) in order to
use the HP linker and g++ does so via assemble_external.  So g++
generates an external statement for the function S::h but this function
is never defined (or called), thus we fail to link.  My proposed fix is
to define S::h.  The other option would be to modify GCC to only call
assemble_external when we see a call to the function, not when we see a
definition, but I don't know if that is practical or not.

Obviously, this is only a problem on platforms that define
ASM_OUTPUT_EXTERNAL.

Any comments?  If it looks good can someone check it in?



*** testsuite/g++.old-deja/g++.pt/ptrmem2.C.orig        Thu Jun 14 14:53:07 2001

--- testsuite/g++.old-deja/g++.pt/ptrmem2.C     Thu Jun 14 14:53:51 2001
*************** S* S::g()
*** 31,36 ****
--- 31,41 ----
    return this;
  }

+ S* S::h()
+ {
+   return this;
+ }
+
  int main()
  {
    S s;


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