public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: thomas@koeller.dyndns.org
To: gcc-gnats@gcc.gnu.org
Cc: thomas@koeller.dyndns.org
Subject: c++/6530: GCC 3.0.4 rejects legal code
Date: Wed, 01 May 2002 06:16:00 -0000	[thread overview]
Message-ID: <20020501123240.57CF212000C@sarkovy.koeller.dyndns.org> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]


>Number:         6530
>Category:       c++
>Synopsis:       GCC 3.0.4 rejects legal code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed May 01 06:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Koeller
>Release:        3.0.4
>Organization:
>Environment:
System: Linux sarkovy.koeller.dyndns.org 2.4.18 #3 Sam Mär 23 01:29:53 CET 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/thomas/src/gnu/gcc-3.0.4/configure --prefix=/opt/gcc-v3 --enable-shared --with-gnu-as --with-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-system-zlib
>Description:
	A member function of a class is invoked through a function pointer from within a static member
	function of the same class. This is a valid C++ construct, however, the compiler flags it as an
	error.

>How-To-Repeat:
Compile this program:

/* GCC 3.0.4 bug demonstration program */

class A
{
  void f1(void);
  static void f2(A &c);
};

void A::f1(void) {}

void A::f2(A &c)
{
  void (A::*pf)(void);
  pf = &A::f1;
  c.*pf();
}



Compiler output:
bugdemo.cxx: In static member function `static void A::f2(A&)':
bugdemo.cxx:15: pointer to member function called, but not in class scope

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


             reply	other threads:[~2002-05-01 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-01  6:16 thomas [this message]
2002-06-05  8:14 lerdsuwa

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=20020501123240.57CF212000C@sarkovy.koeller.dyndns.org \
    --to=thomas@koeller.dyndns.org \
    --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).