diff options
author | Dodji Seketeli <dodji@redhat.com> | 2008-11-19 22:26:56 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2008-11-19 23:26:56 +0100 |
commit | b55276c8acf960a6316f93ad55fb75003c36f9e2 (patch) | |
tree | f13393d9af28c6cde577eb6c5d6137b0b1dca471 /gcc/cp/error.c | |
parent | ff367ac90266005ff0f6a471483ffa2a5f542e9f (diff) | |
download | gcc-b55276c8acf960a6316f93ad55fb75003c36f9e2.zip gcc-b55276c8acf960a6316f93ad55fb75003c36f9e2.tar.gz gcc-b55276c8acf960a6316f93ad55fb75003c36f9e2.tar.bz2 |
re PR c++/35405 (Internal compiler error)
gcc/cp/ChangeLog:
2008-11-19 Dodji Seketeli <dodji@redhat.com>
PR c++/35405
* pt.c (lookup_template_class): Check pointers before dereferencing
Them.
* error.c (dump_template_decl): Likewise.
gcc/testsuite/ChangeLog:
2008-11-19 Dodji Seketeli <dodji@redhat.com>
PR c++/35405
* g++.dg/template/crash84.C: New test.
From-SVN: r142022
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 3aa9b59..a2db157 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1044,11 +1044,13 @@ dump_template_decl (tree t, int flags) } } - if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL) + if (DECL_TEMPLATE_RESULT (t) + && TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL) dump_type (TREE_TYPE (t), ((flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0))); - else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL) + else if (DECL_TEMPLATE_RESULT (t) + && TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL) dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME); else { |