public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Hao Li <hli@haoli.org>
To: gcc-gnats@gcc.gnu.org
Cc: Hao Li <hli@haoli.org>
Subject: c++/3274: gcc-3.0 bug
Date: Tue, 19 Jun 2001 17:26:00 -0000	[thread overview]
Message-ID: <200106200017.f5K0H1f25103@lexus.onetta.com> (raw)

>Number:         3274
>Category:       c++
>Synopsis:       typedef bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 19 17:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Hao Li
>Release:        3.0
>Organization:
Onetta
>Environment:
System: Linux lexus 2.4.4 #1 Fri May 18 18:13:11 PDT 2001 i686 unknown
Architecture: i686

	
host: i686-redhat-linux-gnu
build: i686-redhat-linux-gnu
target: i686-redhat-linux-gnu
configured with: ../configure --prefix=/opt/gcc-3.0 --enable-shared --enable-threads --disable-nls i686-redhat-linux
>Description:
	g++ 3.0 dies with "Internal error: Segmentation fault" when compiling 
	following code:

class test
{
    public:
	typedef bool (test::*ResponseFunc)(char*);
	typedef bool RF(char*);

	struct Command {
	    ResponseFunc respFunc;
	};


	RF setLosSwd;
	RF getLosSwd;
	RF printHelp;

	static Command d_cmdTable[];
};

test::Command test::d_cmdTable[] = {
    {&test::setLosSwd},
    {&test::getLosSwd},
    {&test::printHelp}
};

>How-To-Repeat:
	Preprocessor output is the same as above.
>Fix:
	If I don't use typedef of RF the problem is gone, i.e., following
	code compiles fine. gcc-2.95.3 does not have this bug.


class test
{
    public:
	typedef bool (test::*ResponseFunc)(char*);
	typedef bool RF(char*);

	struct Command {
	    ResponseFunc respFunc;
	};


	bool setLosSwd(char*);
	bool getLosSwd(char*);
	bool printHelp(char*);

	static Command d_cmdTable[];
};

test::Command test::d_cmdTable[] = {
    {&test::setLosSwd},
    {&test::getLosSwd},
    {&test::printHelp}
};

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


                 reply	other threads:[~2001-06-19 17:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200106200017.f5K0H1f25103@lexus.onetta.com \
    --to=hli@haoli.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).