public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65615] New: gcc says abstract class even though it isn't
@ 2015-03-28  4:43 gartenriese at gulli dot com
  2015-03-28 15:25 ` [Bug c++/65615] " redi at gcc dot gnu.org
  2021-07-31 21:30 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: gartenriese at gulli dot com @ 2015-03-28  4:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65615
           Summary: gcc says abstract class even though it isn't
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gartenriese at gulli dot com

The following does not compile with gcc 4.9.2

class O {};

class D : public virtual O {
public:
    virtual float foo() const = 0;
};

class B : public D {
public:
    B(float, float) {}
};

class R : public B {
public:
    R() : B{1.f, 1.f} {}
    virtual float foo() const override { return 0.f; }
};

int main() {
    R r;
}

It says it cannot instantiate an object of abstract class B.
With Clang 3.6 it compiles.
See discussion here:
http://stackoverflow.com/questions/29289857/base-class-with-pure-virtual-functions

If I use () instead of {} to create B, it compiles.
If B has only one parameter in the constructor instead of two, it compiles.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/65615] gcc says abstract class even though it isn't
  2015-03-28  4:43 [Bug c++/65615] New: gcc says abstract class even though it isn't gartenriese at gulli dot com
@ 2015-03-28 15:25 ` redi at gcc dot gnu.org
  2021-07-31 21:30 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-28 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-28
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/65615] gcc says abstract class even though it isn't
  2015-03-28  4:43 [Bug c++/65615] New: gcc says abstract class even though it isn't gartenriese at gulli dot com
  2015-03-28 15:25 ` [Bug c++/65615] " redi at gcc dot gnu.org
@ 2021-07-31 21:30 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-31 21:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 7+.  I suspect by r7-3590 .

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-31 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-28  4:43 [Bug c++/65615] New: gcc says abstract class even though it isn't gartenriese at gulli dot com
2015-03-28 15:25 ` [Bug c++/65615] " redi at gcc dot gnu.org
2021-07-31 21:30 ` pinskia at gcc dot gnu.org

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