diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-05-15 08:52:29 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-05-15 08:52:29 +0000 |
commit | dca56f77ee6797d96370360a8d105034223d3e6c (patch) | |
tree | 31e8df92419c6b103c7b23b4f257c5110c725995 /gcc/cp | |
parent | 05b449213cccb347aa6d0ee65e4fb9b7ad242b6b (diff) | |
download | gcc-dca56f77ee6797d96370360a8d105034223d3e6c.zip gcc-dca56f77ee6797d96370360a8d105034223d3e6c.tar.gz gcc-dca56f77ee6797d96370360a8d105034223d3e6c.tar.bz2 |
re PR c++/27496 (ICE on broken templated friend)
PR c++/27496
* pt.c (tsubst_friend_class): Return early on invalid friend
declarations.
* g++.dg/template/void2.C: New test.
From-SVN: r113776
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 593ee2c..632c7bb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c++/27496 + * pt.c (tsubst_friend_class): Return early on invalid friend + declarations. + 2006-05-14 H.J. Lu <hongjiu.lu@intel.com> * Make-lang.in (cp/decl.o): Add dependency on $(TARGET_H). diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c1530fb..1634d2b 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5435,6 +5435,8 @@ tsubst_friend_class (tree friend_tmpl, tree args) case, the instantiation of the template class will cause the injection of this template into the global scope. */ tmpl = tsubst (friend_tmpl, args, tf_warning_or_error, NULL_TREE); + if (tmpl == error_mark_node) + return error_mark_node; /* The new TMPL is not an instantiation of anything, so we forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for |