]> 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:29:42 +0000 (17:29 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Thu, 19 Jan 2006 17:29:42 +0000 (17:29 +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: r109975

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

index 981976f2821bb7495ac07b7a8fa2d635dc55a2f0..53b2953320a71e8b1866aee5ac5f7131dc34f96c 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.
+
 2006-01-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/16829
index 23c84cde0daad73546bd0b83b02819770c28247a..236145763addfda4a7dc51de3e4ec51a7d8fdc0b 100644 (file)
@@ -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))
     {
index f39f40f89ad1ce3f3d1637a6671c3fa52afd0757..4e4c7e0c683914ca102089511bee2b55d3f88b85 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-19  Andrew Pinski  <pinskia@physics.uc.edu>
 
        * objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c (switchfiles):
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" }