public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/62057] New: __builtin_offsetof works but std::offsetof doesn't
@ 2014-08-08  7:02 igodard at pacbell dot net
  0 siblings, 0 replies; only message in thread
From: igodard at pacbell dot net @ 2014-08-08  7:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62057

            Bug ID: 62057
           Summary: __builtin_offsetof works but std::offsetof doesn't
           Product: gcc
           Version: 4.6.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: igodard at pacbell dot net

This code:
#include    <cstddef>

class A {
public:
    int i;
    };

    int main() {
        int x = __builtin_offsetof(A, i);
        int j = std::offsetof(A, i);
        }

gets you this:

s6:~/ootbc/genAsm$ gcc foo.cc
foo.cc: In function âint main()â:
foo.cc:10:16: error: expected unqualified-id before â__builtin_offsetofâ
foo.cc:10:16: error: expected â,â or â;â before â__builtin_offsetofâ


Version:
s6:~/ootbc/genAsm$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc/4.6.4/libexec/gcc/x86_64-unknown-linux-gnu/4.6.4/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.6.4/configure --prefix=/usr/local/gcc/4.6.4
--libdir=/usr/local/gcc/4.6.4/lib64 --enable-languages=c,c++
Thread model: posix
gcc version 4.6.4 (GCC)
>From gcc-bugs-return-458008-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Aug 08 07:08:50 2014
Return-Path: <gcc-bugs-return-458008-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9743 invoked by alias); 8 Aug 2014 07:08:49 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 9672 invoked by uid 48); 8 Aug 2014 07:08:39 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/62057] __builtin_offsetof works but std::offsetof doesn't
Date: Fri, 08 Aug 2014 07:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.6.4
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-62057-4-gDBwDiVf3e@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-62057-4@http.gcc.gnu.org/bugzilla/>
References: <bug-62057-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg00505.txt.bz2
Content-length: 486

https://gcc.gnu.org/bugzilla/show_bug.cgi?idb057

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Offsetof is always a macro so it is never used with a namespace.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-08  7:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08  7:02 [Bug c++/62057] New: __builtin_offsetof works but std::offsetof doesn't igodard at pacbell dot net

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).