PR c/28419
* c-decl.c (c_make_fname_decl): Do not segfault in case where
current_function_decl is set but current_function_scope is not.
* gcc.dg/pr28319.c: New test.
From-SVN: r117684
+2006-10-12 Jan Hubicka <jh@suse.cz>
+
+ PR c/28419
+ * c-decl.c (c_make_fname_decl): Do not segfault in case where
+ current_function_decl is set but current_function_scope is not.
+
2006-10-12 Jie Zhang <jie.zhang@analog.com>
* config/bfin/bfin.md (eh_return): Call emit_jump_insn instead of
TREE_USED (decl) = 1;
- if (current_function_decl)
+ if (current_function_decl
+ /* For invalid programs like this:
+
+ void foo()
+ const char* p = __FUNCTION__;
+
+ the __FUNCTION__ is believed to appear in K&R style function
+ parameter declarator. In that case we still don't have
+ function_scope. */
+ && (!errorcount || current_function_scope))
{
DECL_CONTEXT (decl) = current_function_decl;
bind (id, decl, current_function_scope,
-2006-10-12 Mark Mitchell <mark@codesourcery.com>
+2006-10-12 Jan Hubicka <jh@suse.cz>
+
+ PR c/28419
+ * gcc.dg/pr28319.c: New test.
+2006-10-12 Mark Mitchell <mark@codesourcery.com>
PR c++/29318
* g++.dg/ext/vla4.C: New test.
--- /dev/null
+/* { dg-do compile } */
+void foo()
+const char* p = __FUNCTION__; /* { dg-error "" } */