re PR c++/43024 (ICE on template code with -O2 or -O3, regression from 4.4.2)

PR c++/43024
	* name-lookup.h (current_binding_level): Check for null
	cp_function_chain.

From-SVN: r156741
This commit is contained in:
Jason Merrill 2010-02-12 17:27:14 -05:00 committed by Jason Merrill
parent 8150eadf30
commit da7d88bfc2
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2010-02-12 Jason Merrill <jason@redhat.com>
PR c++/43024
* name-lookup.h (current_binding_level): Check for null
cp_function_chain.
2010-02-12 Jason Merrill <jason@redhat.com>
PR c++/43054

View File

@ -259,7 +259,7 @@ struct GTY(()) cp_binding_level {
/* The binding level currently in effect. */
#define current_binding_level \
(*(cfun && cp_function_chain->bindings \
(*(cfun && cp_function_chain && cp_function_chain->bindings \
? &cp_function_chain->bindings \
: &scope_chain->bindings))