This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/13275] New: [3.4 regression] Implementation of offsetof macro


Please reopen #11072.  Mr. Bangareth's test still passes, however the following
does not.

#include <cstddef>

struct choke_me
{
    int size;
    char storage[1];
};

struct offset_is_broken
{
    static const int offset = offsetof(choke_me, storage);
};


$ g++-3.4 -v -c gccbug.cpp
Reading specs from /home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/home/jonathan
--enable-languages=c,c++ --program-suffix=-3.4 : (reconfigured)
Thread model: posix
gcc version 3.4 20031202 (experimental)
 /home/jonathan/libexec/gcc/i686-pc-linux-gnu/3.4/cc1plus -quiet -v
-D_GNU_SOURCE gccbug.cpp -quiet -dumpbase gccbug.cpp -mtune=pentiumpro -auxbase
gccbug -version -o /tmp/ccMICppc.s
ignoring nonexistent directory
"/home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4
 /home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/i686-pc-linux-gnu
 /home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/backward
 /usr/local/include
 /home/jonathan/include
 /home/jonathan/lib/gcc/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
GNU C++ version 3.4 20031202 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.4 20031130 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
gccbug.cpp:11: error: a cast to a type other than an integral or enumeration
type cannot appear in a constant-expression
gccbug.cpp:11: error: expected `)'
gccbug.cpp:11: error: expected `;'

-- 
           Summary: [3.4 regression] Implementation of offsetof macro
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jbrandmeyer at earthlink dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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