]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/25854 (Bogus diagnostic with '<type error>')
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Thu, 19 Jan 2006 17:37:49 +0000 (17:37 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Thu, 19 Jan 2006 17:37:49 +0000 (17:37 +0000)
PR c++/25854
* pt.c (maybe_process_partial_specialization): Return early on
error_mark_node.

* g++.dg/template/spec28.C: New test.

From-SVN: r109978

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/spec28.C [new file with mode: 0644]

index c540dbde9054a0edc4dcba489b5595761feec015..2d5c6b106fd2eb6b2025f551590f8d2f8ed0a5dc 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2005-12-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/20552
index e916c3786d738bb575f5cb3fa417035ba63dfca7..aca2dcd5361846d31cbe1226d46b65621203eb47 100644 (file)
@@ -744,8 +744,12 @@ check_specialization_namespace (tree tmpl)
 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))
     {
index da846acc44b7c101a56ef4ba0f9ce34a419a77d0..1e2995be7f8f6758271eba67648e0a746be11b23 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/25854
+       * g++.dg/template/spec28.C: New test.
+
 2006-01-16  Ian Lance Taylor  <ian@airs.com>
 
        * consistency.vlad: Remove entire directory, 1652 files.
diff --git a/gcc/testsuite/g++.dg/template/spec28.C b/gcc/testsuite/g++.dg/template/spec28.C
new file mode 100644 (file)
index 0000000..f0bb22c
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/25854
+// Bad diagnostic
+// { dg-do compile }
+
+template<typename> struct A {};  // { dg-error "provided" }
+template<> struct A<> {};        // { dg-error "wrong number" }