aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2006-01-19 17:29:42 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2006-01-19 17:29:42 +0000
commitc9043d037246a4de7b42f411ac628971d50ea145 (patch)
treecbb6e67b336ab512aca01d5fa4a0f497fb3a64f2 /gcc/cp
parent9795d9fd7a80977d03a81e17f5d980e3b69f84d1 (diff)
downloadgcc-c9043d037246a4de7b42f411ac628971d50ea145.zip
gcc-c9043d037246a4de7b42f411ac628971d50ea145.tar.gz
gcc-c9043d037246a4de7b42f411ac628971d50ea145.tar.bz2
re PR c++/25854 (Bogus diagnostic with '<type error>')
PR c++/25854 * pt.c (maybe_process_partial_specialization): Return early on error_mark_node. * g++.dg/template/spec28.C: New test. From-SVN: r109975
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 981976f..53b2953 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+ PR c++/25854
+ * pt.c (maybe_process_partial_specialization): Return early on
+ error_mark_node.
+
+2006-01-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
PR c++/16829
* decl.c (start_preparsed_function): Check default arguments
unconditionally.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 23c84cd..2361457 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -678,8 +678,12 @@ check_explicit_instantiation_namespace (tree spec)
void
maybe_process_partial_specialization (tree type)
{
- /* TYPE maybe an ERROR_MARK_NODE. */
- tree context = TYPE_P (type) ? TYPE_CONTEXT (type) : NULL_TREE;
+ tree context;
+
+ if (type == error_mark_node)
+ return;
+
+ context = TYPE_CONTEXT (type);
if (CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type))
{