public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23708] New: Non-inline function incorrectly treated as inline when using precompiled headers
@ 2005-09-03  1:57 jconner at apple dot com
  2005-09-03  2:09 ` [Bug c++/23708] " jconner at apple dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: jconner at apple dot com @ 2005-09-03  1:57 UTC (permalink / raw)
  To: gcc-bugs

The non-inline specialization of an inline member function of a template class is not being treated as 
inline when using precompiled headers.

For example, consider

  test.H:
    template <class T> class simple_class {
      public:
        inline void testfn (T);
    };

  test.C:
    #include "test.H"

    template <> void simple_class<int>::testfn (int) {}

    int main (int argc, char *argv[])
    {
      simple_class<int> sc1;
      sc1.testfn (5);
    }

When compiled without precompiled headers, the function appears a simple global function:

        .global _ZN12simple_classIiE6testfnEi

But when test.H is first compiled (with "g++ test.H") into a PCH, and then test.C is compiled, the 
function appears as a weak symbol in a COMDAT section, implying that g++ is considering the 
specialization "inline" even though it isn't marked as such.

        .section        .text._ZN12simple_classIiE6testfnEi,"axG",%
progbits,_ZN12simple_classIiE6testfnEi,comdat
        .align  2
        .weak   _ZN12simple_classIiE6testfnEi
        .type   _ZN12simple_classIiE6testfnEi, %function

-- 
           Summary: Non-inline function incorrectly treated as inline when
                    using precompiled headers
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jconner at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-none-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23708


^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <bug-23708-10413@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2007-02-03 15:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-03  1:57 [Bug c++/23708] New: Non-inline function incorrectly treated as inline when using precompiled headers jconner at apple dot com
2005-09-03  2:09 ` [Bug c++/23708] " jconner at apple dot com
2005-09-03  2:11 ` [Bug c++/23708] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-08 19:55 ` pinskia at gcc dot gnu dot org
2005-09-09 16:38 ` [Bug c++/23708] [4.0 " mmitchel at gcc dot gnu dot org
2005-09-27 16:17 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-23708-10413@http.gcc.gnu.org/bugzilla/>
2006-01-15 22:43 ` mmitchel at gcc dot gnu dot org
2006-03-11  3:19 ` mmitchel at gcc dot gnu dot org
2007-02-03 15:38 ` gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).