public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: lrtaylor@micron.com
To: <eljay@adobe.com>, <gcc-help@gcc.gnu.org>
Subject: RE: pure virtual w/implementation bug in GCC 3.3?
Date: Thu, 18 Sep 2003 19:46:00 -0000	[thread overview]
Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4A2760A@ntxboimbx07.micron.com> (raw)

Without actually looking at the standard, isn't a pure virtual function with an implementation simply a contradiction?  The fact that there is no implementation is what makes it "pure".  Otherwise, it's just a regular virtual function.  It doesn't make sense to try to say something is both pure virtual and that it has a definition.  That's just self contradictory...

Thanks,
Lyle Taylor

-----Original Message-----
From: Eljay Love-Jensen [mailto:eljay@adobe.com]
Sent: Thursday, September 18, 2003 1:38 PM
To: gcc-help@gcc.gnu.org
Subject: pure virtual w/implementation bug in GCC 3.3?

Hi everyone,

Using GCC 3.3 or GCC 3.2, it appears unable to digest this code:

--------8<--------
class Foo
{
public:
        virtual ~Foo() = 0 { }
};
--------8<--------

> g++33 -c foo.cpp
foo.cpp:4: error: parse error before `{' token
foo.cpp:4: error: missing ';' before right brace

Pure virtual functions can have implementations.  Pure virtual destructors (if I recall correctly) MUST have implementations.

And if the implementation is defined later with GCC 3.2 or 3.3 -- either as inline or not as inline ("out of line"?) -- it digests it with out an issue.

As per Stroustrup's C++PL, the EBNF grammar looks like it should and does support the syntax given above.  (The "implicit inline" of a method given in the class declaration.)

Is this a known bug in GCC?

Or is this a new bug in GCC?

Or am I misinformed?

Thanks,
--Eljay

             reply	other threads:[~2003-09-18 19:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-18 19:46 lrtaylor [this message]
2003-09-18 19:53 ` Eljay Love-Jensen
2003-09-19  6:29   ` m.
2003-09-19 17:32     ` Eljay Love-Jensen
  -- strict thread matches above, loose matches on Subject: below --
2003-09-19 18:46 lrtaylor
2003-09-19 19:30 ` Eljay Love-Jensen
2003-09-18 19:38 Eljay Love-Jensen

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=363801FFD7B74240A329CEC3F7FE4CC4A2760A@ntxboimbx07.micron.com \
    --to=lrtaylor@micron.com \
    --cc=eljay@adobe.com \
    --cc=gcc-help@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).