diff options
author | lerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-25 14:18:19 +0000 |
---|---|---|
committer | lerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-25 14:18:19 +0000 |
commit | 5d6080a0858f5b5ebe32fb842afba7bb2a0f7321 (patch) | |
tree | 398adcd2d521118bc33743e4e0cd721d12ff6b8a /gcc/cp/pt.c | |
parent | da15642faa6447fa6bece1262aa3d567d8458698 (diff) | |
download | gcc-5d6080a0858f5b5ebe32fb842afba7bb2a0f7321.tar.gz |
PR c++/13797
* pt.c (instantiate_class_template): Add an error_mark_node
check.
(tsubst_decl) <TEMPLATE_DECL case>: Likewise.
* g++.dg/template/nontype4.C: New test.
* g++.dg/template/nontype5.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76556 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 967e9d1da8e..2178e90e924 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5370,7 +5370,9 @@ instantiate_class_template (tree type) tree newtag; newtag = tsubst (tag, args, tf_error, NULL_TREE); - my_friendly_assert (newtag != error_mark_node, 20010206); + if (newtag == error_mark_node) + continue; + if (TREE_CODE (newtag) != ENUMERAL_TYPE) { if (TYPE_LANG_SPECIFIC (tag) && CLASSTYPE_IS_TEMPLATE (tag)) @@ -5902,6 +5904,9 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain) if (TREE_CODE (decl) == TYPE_DECL) { tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl); + if (new_type == error_mark_node) + return error_mark_node; + TREE_TYPE (r) = new_type; CLASSTYPE_TI_TEMPLATE (new_type) = r; DECL_TEMPLATE_RESULT (r) = TYPE_MAIN_DECL (new_type); |