]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/14763 (internal compiler error: in find_function_data, at...
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Sat, 1 May 2004 20:27:40 +0000 (20:27 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sat, 1 May 2004 20:27:40 +0000 (20:27 +0000)
Backport from gcc-3_4-branch
2004-03-30  Mark Mitchell  <mark@codesourcery.com>
            Jakub Jelinek  <jakub@redhat.com>
        PR c++/14763
* pt.c (tsubst_default_argument): Clear
current_function_decl.
* decl2.c (mark_used): Don't segfault if cfun != NULL but
current_function_decl == NULL.

From-SVN: r81395

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/pt.c

index abc8892cf406e54e67b238fa8c813371cb41d19c..e5f90d9e8a1bcab0683cf1950c60e799897573da 100644 (file)
@@ -1,3 +1,13 @@
+2004-05-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       Backport from gcc-3_4-branch
+       2004-03-30  Mark Mitchell  <mark@codesourcery.com>
+                   Jakub Jelinek  <jakub@redhat.com>
+       PR c++/14763
+       * pt.c (tsubst_default_argument): Clear current_function_decl.
+       * decl2.c (mark_used): Don't segfault if cfun != NULL but
+       current_function_decl == NULL.
+
 2004-05-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        Backport from gcc-3_4-branch:
index 50bb3e2fa79fdb273f88a8e790f3afd1f4f9070a..f172e84c974022f9dbd8e706521d19ce9db18745 100644 (file)
@@ -4879,6 +4879,7 @@ mark_used (decl)
                  generate its body to find that out.  */
               || TREE_NOTHROW (decl)
               || !cfun
+               || !current_function_decl
               /* If we already know the current function can't throw,
                  then we don't need to work hard to prove it.  */
               || TREE_NOTHROW (current_function_decl)
index 0f35b1e356ae8dc01243b09890027abd86397647..ee7f7dbfffcbc2d6f61ee7e1154a38f4cb78625c 100644 (file)
@@ -5905,6 +5905,10 @@ tsubst_default_argument (fn, type, arg)
 
   /* FN is already the desired FUNCTION_DECL.  */
   push_access_scope (fn);
+  /* The default argument expression should not be considered to be
+     within the scope of FN.  Since push_access_scope sets
+     current_function_decl, we must explicitly clear it here.  */
+  current_function_decl = NULL_TREE;
 
   arg = tsubst_expr (arg, DECL_TI_ARGS (fn),
                     tf_error | tf_warning, NULL_TREE);