public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50608] New: cannot apply 'offsetof' to a non constant address
@ 2011-10-03 23:41 dberger at oubliette dot org
  2011-10-03 23:42 ` [Bug c++/50608] " dberger at oubliette dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dberger at oubliette dot org @ 2011-10-03 23:41 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50608
           Summary: cannot apply 'offsetof' to a non constant address
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dberger@oubliette.org


$ cat repro.ii

struct A {
    int offset;
};

struct B: public A {
};

struct C {
    A a;
    B b;
};

/* error: cannot apply 'offsetof' to a non constant address */
int fails = __builtin_offsetof (C, b.offset);

int works = (int)(&(((C*)0)->b.offset));

$

looks like a dup of Bug 13648, which claims to be fixed.


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

end of thread, other threads:[~2012-06-12  3:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 23:41 [Bug c++/50608] New: cannot apply 'offsetof' to a non constant address dberger at oubliette dot org
2011-10-03 23:42 ` [Bug c++/50608] " dberger at oubliette dot org
2011-10-04  9:34 ` [Bug c++/50608] [4.6/4.7 Regression] " paolo.carlini at oracle dot com
2011-10-10 11:29 ` rguenth at gcc dot gnu.org
2011-10-10 15:23 ` rguenth at gcc dot gnu.org
2011-10-11  9:09 ` mikpe at it dot uu.se
2011-10-11  9:49 ` ebotcazou at gcc dot gnu.org
2011-10-26 17:16 ` [Bug c++/50608] [4.6/4.7 regression] cannot apply 'offsetof' to a non-constant address jakub at gcc dot gnu.org
2011-11-04 21:46 ` ebotcazou at gcc dot gnu.org
2011-11-04 21:50 ` ebotcazou at gcc dot gnu.org
2011-11-04 21:53 ` ebotcazou at gcc dot gnu.org
2012-06-12  3:11 ` amker at gcc dot gnu.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).