aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-02-12 17:27:14 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-02-12 17:27:14 -0500
commitda7d88bfc2d587bd1c5f670faf7832238a42ddba (patch)
treef90c444fe8095edc867c415fee70e50e53238783
parent8150eadf308e5957e03e8285b968d45038405fed (diff)
downloadgcc-da7d88bfc2d587bd1c5f670faf7832238a42ddba.zip
gcc-da7d88bfc2d587bd1c5f670faf7832238a42ddba.tar.gz
gcc-da7d88bfc2d587bd1c5f670faf7832238a42ddba.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 036b25f..7e37b69 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
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
* tree.c (cp_tree_equal): Correct CALL_EXPR logic.
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 7a3625a..0851481 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -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))