public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: hg@technosis.de
To: gcc-gnats@gcc.gnu.org
Subject: c++/9842: Compile error when accessing a bitfield base class member
Date: Mon, 24 Feb 2003 23:16:00 -0000	[thread overview]
Message-ID: <20030224231348.23689.qmail@sources.redhat.com> (raw)


>Number:         9842
>Category:       c++
>Synopsis:       Compile error when accessing a bitfield base class member
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 23:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Heiko Gerdau
>Release:        gcc version 3.2
>Organization:
>Environment:
SuSe Linux 8.1 (with gcc 3.2) or W2k with mingw-gcc 3.2.2
>Description:
Using the attached code gcc returns the following error:

hg@linux:~> gcc -o bf.exe bf.cpp
bf.cpp: In member function `void B::f()':
bf.cpp:11: illegal pointer to bit-field `A::ib'

It should be possible to access a base class member, even if it's a bitfield.

The file bf.cpp contains the following code:

class A
{
public:
    unsigned int ib:1;
};

class B : public A
{
public:
    unsigned int ib;
    void f(){ A::ib=1;}
};

int main()
{
    B b;
    b.f();
    return (0);
}
>How-To-Repeat:
Just copy the code given above to bf.cpp and run
gcc -o bf.exe bf.cpp
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-02-24 23:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24 23:16 hg [this message]
2003-02-24 23:18 bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030224231348.23689.qmail@sources.redhat.com \
    --to=hg@technosis.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).