PR c++/28111
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2006 09:55:42 +0000 (09:55 +0000)
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2006 09:55:42 +0000 (09:55 +0000)
* pt.c (determine_specialization): Check for invalid decls.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114887 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ac044d1..ec07436 100644 (file)
@@ -1,5 +1,8 @@
 2006-06-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/28111
+       * pt.c (determine_specialization): Check for invalid decls.
+
        PR c++/28110
        * pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
        parameters.
index f7bc7ce..89afb5f 100644 (file)
@@ -1354,7 +1354,7 @@ determine_specialization (tree template_id,
 
   *targs_out = NULL_TREE;
 
-  if (template_id == error_mark_node)
+  if (template_id == error_mark_node || decl == error_mark_node)
     return error_mark_node;
 
   fns = TREE_OPERAND (template_id, 0);
index a02dc4c..013608b 100644 (file)
@@ -1,5 +1,8 @@
 2006-06-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/28111
+       * g++.dg/template/friend43.C: New test.
+
        PR c++/28110
        * g++.dg/template/crash53.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/template/friend43.C b/gcc/testsuite/g++.dg/template/friend43.C
new file mode 100644 (file)
index 0000000..edbed84
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/28111
+// { dg-do compile }
+
+template<typename> void foo();
+
+template<typename T> struct A
+{
+  friend void foo<>(typename T::X);  // { dg-error "not a class" }
+};
+
+A<int> a;