re PR c++/8067 (g++ 3.2 internal error: Segmentation fault)
authorMark Mitchell <mark@codesourcery.com>
Thu, 24 Oct 2002 00:01:37 +0000 (00:01 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 24 Oct 2002 00:01:37 +0000 (00:01 +0000)
PR c++/8067
* decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
related variables.

PR c++/8067
* g++.dg/lookup/pretty1.C: New test.

From-SVN: r58477

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/pretty1.C [new file with mode: 0644]

index bca3b4c3570132cd90be92ae996ecc4aaa325092..e6ed9295e15b99607c6b96f64055acb163268768 100644 (file)
@@ -1,5 +1,9 @@
 2002-10-23  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/8067
+       * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
+       related variables.
+
        PR c++/7679
        * spew.c (next_token): Do not return an endless stream of
        END_OF_SAVED_INPUT tokens.
index b52622a03a8234b9c99d0fb4b9e6393a8f8e42e2..97ab9462e6a3eb3c27447b64ddfd9b2bc5168e96 100644 (file)
@@ -8175,6 +8175,12 @@ maybe_inject_for_scope_var (decl)
 {
   if (!DECL_NAME (decl))
     return;
+  
+  /* Declarations of __FUNCTION__ and its ilk appear magically when
+     the variable is first used.  If that happens to be inside a
+     for-loop, we don't want to do anything special.  */
+  if (DECL_PRETTY_FUNCTION_P (decl))
+    return;
 
   if (current_binding_level->is_for_scope)
     {
index e2fa07709ca6c6a346210202788ff7287c08c4a4..fc2c7c2c3021a9e561957ef41fbdd22f7d1ed769 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-23  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/8067
+       * g++.dg/lookup/pretty1.C: New test.
+
 2002-10-23  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/20021023-1.c: New test.
diff --git a/gcc/testsuite/g++.dg/lookup/pretty1.C b/gcc/testsuite/g++.dg/lookup/pretty1.C
new file mode 100644 (file)
index 0000000..a03bd3c
--- /dev/null
@@ -0,0 +1 @@
+void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; }