OSDN Git Service

* pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Feb 1999 17:25:51 +0000 (17:25 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Feb 1999 17:25:51 +0000 (17:25 +0000)
before calling complete_type_or_else.

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

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

index 7c28387..d74c484 100644 (file)
@@ -1,3 +1,8 @@
+1999-02-01  Mark Mitchell  <mark@markmitchell.com>
+
+       * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
+       before calling complete_type_or_else.
+
 Mon Feb  1 09:49:52 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * input.c (inline): Don't define, its handled by system.h.
index 1db903d..901005b 100644 (file)
@@ -6083,7 +6083,8 @@ tsubst (t, args, in_decl)
           But, such constructs have already been resolved by this
           point, so here CTX really should have complete type, unless
           it's a partial instantiation.  */
-       if (!uses_template_parms (ctx) 
+       if (!uses_template_parms (ctx)
+           && !TYPE_BEING_DEFINED (ctx)
            && !complete_type_or_else (ctx))
          return error_mark_node;
 
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec28.C b/gcc/testsuite/g++.old-deja/g++.pt/spec28.C
new file mode 100644 (file)
index 0000000..d63e796
--- /dev/null
@@ -0,0 +1,25 @@
+// Build don't link:
+
+template <class T> 
+struct S1 {
+  friend bool f<>(const S1&);
+  typedef T X;
+};
+
+template <class T>
+struct S2 {
+};
+
+template <class T>
+struct S2<S1<T> > {
+  typedef typename S1<T>::X Y;
+};
+
+template <class T>
+bool f(T);
+
+template <class T>
+typename S2<S1<T> >::Y
+f(const S1<T>&);
+
+template struct S1<int>;