aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-11-09 12:52:59 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-11-09 12:52:59 +0100
commit8810610ef1ef35a9f731c5b9c700c05b68799a4a (patch)
tree414bcdcb6b263c7507f656d38386c6af415673a2 /gcc/cp
parentb04533af33ccf91e2874b24dd3e678d195c83587 (diff)
downloadgcc-8810610ef1ef35a9f731c5b9c700c05b68799a4a.zip
gcc-8810610ef1ef35a9f731c5b9c700c05b68799a4a.tar.gz
gcc-8810610ef1ef35a9f731c5b9c700c05b68799a4a.tar.bz2
re PR c++/45894 ([C++0x] ICE: segmentation fault with -Wall)
PR c++/45894 * tree.c (lvalue_kind): Don't crash if ref has NULL type. * g++.dg/warn/Wsequence-point-2.C: New test. From-SVN: r166481
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7223529d..51e2171 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/45894
+ * tree.c (lvalue_kind): Don't crash if ref has NULL type.
+
2010-11-08 Jason Merrill <jason@redhat.com>
PR c++/46382
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 462e35f..ba8e978 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -67,7 +67,8 @@ lvalue_kind (const_tree ref)
== REFERENCE_TYPE)
return lvalue_kind (TREE_OPERAND (ref, 0));
- if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
+ if (TREE_TYPE (ref)
+ && TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
{
/* unnamed rvalue references are rvalues */
if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref))