From: Marek Polacek Date: Mon, 14 Jan 2019 20:09:10 +0000 (+0000) Subject: PR c++/88830 - ICE with abstract class. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=345364cf7fa2a675d954ab4982bec6d664ee96e8;p=gcc.git PR c++/88830 - ICE with abstract class. * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR. Fix formatting. * g++.dg/other/abstract7.C: New test. From-SVN: r267924 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5d0ef1217bb..3c1a02f025e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-01-14 Marek Polacek + + PR c++/88830 - ICE with abstract class. + * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR. + Fix formatting. + 2019-01-14 Tom Honermann Implement P0482R5, char8_t: A type for UTF-8 characters and strings diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 1314ca812ee..0869fd30824 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2229,8 +2229,9 @@ maybe_emit_vtables (tree ctype) never get generated. */ if (CLASSTYPE_PURE_VIRTUALS (ctype) && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype) - && DECL_DEFAULTED_IN_CLASS_P(CLASSTYPE_DESTRUCTOR(ctype))) - note_vague_linkage_fn (CLASSTYPE_DESTRUCTOR(ctype)); + && !CLASSTYPE_LAZY_DESTRUCTOR (ctype) + && DECL_DEFAULTED_IN_CLASS_P (CLASSTYPE_DESTRUCTOR (ctype))) + note_vague_linkage_fn (CLASSTYPE_DESTRUCTOR (ctype)); /* Since we're writing out the vtable here, also write the debug info. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c6f9e419ba..d207a519372 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-01-14 Marek Polacek + + PR c++/88830 - ICE with abstract class. + * g++.dg/other/abstract7.C: New test. + 2019-01-14 Martin Sebor PR target/88638 diff --git a/gcc/testsuite/g++.dg/other/abstract7.C b/gcc/testsuite/g++.dg/other/abstract7.C new file mode 100644 index 00000000000..95781602c95 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/abstract7.C @@ -0,0 +1,14 @@ +// PR c++/88830 + +struct a { + ~a(); +}; +class b { + virtual void c(int &); +}; +class C : b { + void c(int &); + virtual int d() = 0; + a e; +}; +void C::c(int &) {}