This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Minor C++ PATCH to dump_function_decl


While debugging 43120, I noticed that dump_function_decl was crashing on a thunk FUNCTION_DECLs that didn't have a name yet.

Tested x86_64-pc-linux-gnu, applied to trunk.
commit 764fc0c6462f715407b98724c90e0b77580fabe2
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jul 2 23:51:52 2010 -0400

    	* error.c (dump_function_decl): Don't crash on null DECL_NAME.

diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 1902a13..cff822a 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1247,7 +1247,7 @@ dump_function_decl (tree t, int flags)
   tree exceptions;
   VEC(tree,gc) *typenames = NULL;
 
-  if (LAMBDA_FUNCTION_P (t))
+  if (DECL_NAME (t) && LAMBDA_FUNCTION_P (t))
     {
       /* A lambda's signature is essentially its "type", so defer.  */
       gcc_assert (LAMBDA_TYPE_P (DECL_CONTEXT (t)));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]