diff mbox

Minor C++ PATCH to dump_function_decl

Message ID 4C33805E.3090809@redhat.com
State New
Headers show

Commit Message

Jason Merrill July 6, 2010, 7:13 p.m. UTC
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.
diff mbox


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 (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)));