public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38007]  New: g++ instantiate same operator twice due to bitfield in -O0 mode, causing symbol already defined assembler error
@ 2008-11-03 19:24 jengliang at gmail dot com
  2008-11-03 20:08 ` [Bug c++/38007] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jengliang at gmail dot com @ 2008-11-03 19:24 UTC (permalink / raw)
  To: gcc-bugs

Following code produces symbol already defined assembler error when compiled
with g++ 4.2.4 with -O0 flag.  It can compile without problem with g++ 4.1.1.

=== foo.hpp ===
class foo {
    public:
        template <typename T> operator T ();
};

template <typename T>
    inline foo::operator T () {
        return (T)0;
    }

=== foo.cpp ===
#include "foo.hpp"

struct bar {
    unsigned int _bar : 24;
};

int main() {
    foo a;
    unsigned int b = a;
    bar c;
    c._bar = a;
    return 1;
}

====
compile with g++ -O0 foo.cpp

Regards,
Jeng-Liang


-- 
           Summary: g++ instantiate same operator twice due to bitfield in -
                    O0 mode, causing symbol already defined assembler error
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jengliang at gmail dot com


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-04-29 15:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 19:24 [Bug c++/38007] New: g++ instantiate same operator twice due to bitfield in -O0 mode, causing symbol already defined assembler error jengliang at gmail dot com
2008-11-03 20:08 ` [Bug c++/38007] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
2008-11-04 10:41 ` rguenth at gcc dot gnu dot org
2008-11-06 15:16 ` jakub at gcc dot gnu dot org
2008-11-07 22:25 ` jason at gcc dot gnu dot org
2008-11-12 20:53 ` jason at gcc dot gnu dot org
2008-11-12 22:11 ` [Bug c++/38007] [4.2/4.3 " jason at gcc dot gnu dot org
2008-11-12 22:16 ` jason at gcc dot gnu dot org
2008-11-12 22:17 ` jason at gcc dot gnu dot org
2009-04-29 15:20 ` pinskia 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).