From 3e7cf2e6c0ee30b83aa158b7bd2b2eb9a686c1c3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 14 Nov 2019 02:02:16 +0100 Subject: [PATCH] re PR ipa/92421 (ICE in inline_small_functions, at ipa-inline.c:2001 since r277759) PR ipa/92421 * g++.dg/torture/pr92421.C: Add -Wno-return-type to dg-additional-options. Avoid -Wwrite-string warnings, most of -Wreturn-type warnings, define bf ctor. Use struct instead of class with public: at the start. From-SVN: r278192 --- gcc/testsuite/ChangeLog | 6 ++++ gcc/testsuite/g++.dg/torture/pr92421.C | 45 ++++++++++++-------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3fa120855db..d480dacd469 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2019-11-14 Jakub Jelinek + PR ipa/92421 + * g++.dg/torture/pr92421.C: Add -Wno-return-type to + dg-additional-options. Avoid -Wwrite-string warnings, most of + -Wreturn-type warnings, define bf ctor. Use struct instead of class + with public: at the start. + * g++.dg/cpp0x/alias-decl-pr92206-3.C: Require effective target c++14 rather than c++11. diff --git a/gcc/testsuite/g++.dg/torture/pr92421.C b/gcc/testsuite/g++.dg/torture/pr92421.C index 7adf53f7299..2146e9416db 100644 --- a/gcc/testsuite/g++.dg/torture/pr92421.C +++ b/gcc/testsuite/g++.dg/torture/pr92421.C @@ -1,55 +1,49 @@ -/* { dg-do compile } */ +// PR ipa/92421 +// { dg-do compile } +// { dg-additional-options "-Wno-return-type" } + typedef long a; void *b, *c; template class d {}; template bool operator!=(d, d); -class g { -public: - g(char *); +struct g { + g(const char *); }; -class j { -public: +struct j { j(); void h(); void i(); void aj(); }; -class m { -public: +struct m { m(bool); }; -class n { -public: +struct n { operator a(); }; -class o { -public: +struct o { long am(); }; -class H { -public: +struct H { class p {}; virtual bool accept(const char *, unsigned long, p *, bool); }; -class q : H { -public: - class r { - public: +struct q : H { + struct r { enum at { au, av, aw }; }; enum { ax }; - virtual void ay(char *, int, const char *, r::at, char *); + virtual void ay(const char *, int, const char *, r::at, const char *); virtual bool az(const g &, unsigned = ax); virtual bool ba(const int &, p *, bool); void bb(char *bc, long bd, char *, long be) { - class bf : public p { - public: - bf(long); + struct bf : public p { + bf(long) {} } bg(be); accept(bc, bd, &bg, true); } }; -class s { +struct s { q *bi; bool bj(); }; @@ -109,6 +103,7 @@ template class t : q { while (kit != df) ; cx(); + return false; } bool az(const g &, unsigned) { t dj; @@ -157,8 +152,7 @@ template class t : q { O db[6]; bool bp; }; -class w : q { -public: +struct w : q { void dn(); bool l() { m(true); @@ -171,4 +165,5 @@ public: bool s::bj() { bi->az(""); new t; + return false; } -- 2.30.2