public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41090]  New: Using static label reference in c++ class constructor produces wrong code
@ 2009-08-17 13:54 mark at gcc dot gnu dot org
  2009-08-17 14:21 ` [Bug c++/41090] " dodji at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: mark at gcc dot gnu dot org @ 2009-08-17 13:54 UTC (permalink / raw)
  To: gcc-bugs

The following code compiles, but won't link:

#include <iostream>
using namespace std;

class C
{
public:
  C()
  {
    static void *labelref = &&label;
    goto *labelref;
    label: cout << "hello" << endl;
  }
}; 

int
main (int argc, char **argv)
{
  C inst = C();
  return 0;
}

$ g++ label.cxx 
/tmp/ccirWO3W.o:(.data._ZZN1CC1EvE8labelref[C::C()::labelref]+0x0): undefined
reference to `.L11'
collect2: ld returned 1 exit status


-- 
           Summary: Using static label reference in c++ class constructor
                    produces wrong code
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-06-19  0:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17 13:54 [Bug c++/41090] New: Using static label reference in c++ class constructor produces wrong code mark at gcc dot gnu dot org
2009-08-17 14:21 ` [Bug c++/41090] " dodji at gcc dot gnu dot org
2009-08-17 14:27 ` mikpe at it dot uu dot se
2009-09-18  5:15 ` [Bug c++/41090] [4.3/4.4/4.5 Regression] " pinskia at gcc dot gnu dot org
2009-09-18  9:03 ` rguenth at gcc dot gnu dot org
2009-09-28 21:38 ` pinskia at gcc dot gnu dot org
2009-11-09 22:44 ` jason at gcc dot gnu dot org
2010-01-29 17:20 ` jason at gcc dot gnu dot org
2010-02-03  0:08 ` jason at gcc dot gnu dot org
2010-02-03  1:15 ` jason at gcc dot gnu dot org
2010-02-04 23:36 ` howarth at nitro dot med dot uc dot edu
2010-02-05  1:41 ` jason at gcc dot gnu dot org
2010-03-02 19:40 ` mrs at gcc dot gnu dot org
2010-05-22 18:34 ` [Bug c++/41090] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
2010-06-19  0:28 ` danglin 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).