aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-11-02 01:03:03 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-11-02 01:03:03 +0000
commitbec80a45fd419b66bb7fc6d658e24019b1395575 (patch)
tree78f9248491b1a67f82cf93b6069e4237f4bcdc6d /gcc
parenta70b59e1dbb2e78812f73edbd960f3fc1f9620d6 (diff)
downloadgcc-bec80a45fd419b66bb7fc6d658e24019b1395575.zip
gcc-bec80a45fd419b66bb7fc6d658e24019b1395575.tar.gz
gcc-bec80a45fd419b66bb7fc6d658e24019b1395575.tar.bz2
re PR c++/8391 (infinite loop in cp/decl2.c(finish_file))
PR c++/8391 * toplev.c (rest_of_compilation): Do not refuse to output code for an inline function in a local class. PR c++/8391 * g++.dg/opt/local1.C: New test. From-SVN: r58734
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/local1.C20
-rw-r--r--gcc/toplev.c3
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 20e95b7..1d4a1ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8391
+ * toplev.c (rest_of_compilation): Do not refuse to output code for
+ an inline function in a local class.
+
2002-11-01 David O'Brien <obrien@FreeBSD.org>
* config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Define __arch64__.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 437893d..90877e8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/8391
+ * g++.dg/opt/local1.C: New test.
+
2002-10-30 Mark Mitchell <mark@codesourcery.com>
PR c++/8160
diff --git a/gcc/testsuite/g++.dg/opt/local1.C b/gcc/testsuite/g++.dg/opt/local1.C
new file mode 100644
index 0000000..9cecaee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/local1.C
@@ -0,0 +1,20 @@
+// { dg-options "-O" }
+
+struct Outer {
+ struct Inner { virtual bool f() = 0; };
+ void g(Inner &) const;
+};
+
+inline void h(const Outer &o)
+{
+ struct Local : public Outer::Inner {
+ virtual bool f() {};
+ };
+ Local l;
+ o.g(l);
+}
+
+void f(Outer &req) {
+ h (req);
+}
+
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 2f3d1274..9e57576 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2429,6 +2429,9 @@ rest_of_compilation (decl)
DECL_INITIAL (decl) = 0;
goto exit_rest_of_compilation;
}
+ else if (TYPE_P (parent))
+ /* A function in a local class should be treated normally. */
+ break;
/* If requested, consider whether to make this function inline. */
if ((DECL_INLINE (decl) && !flag_no_inline)