This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ patch] deprecate implicit typename


Hi,
this patch deprecates the implicit typename extension for dependent
types.  The new parser does not support that extension, so we should
deprecate it in 3.1.  This patch issues an unconditional warning &
a deprecated message (Because we implicitly create the typename,
it has 'typename' at the start, even though the source, of course,
did not. This is good, as the user then knows what the corrected
form is.)

implicit.ii:16: warning: `typename B<T>::Int' is implicitly a typename
implicit.ii:16: warning: implicit typename is deprecated, please see 
   the documentation for details

The test cases are patched in line with what we had to do on the
cp-parser branch.

booted & tested on i686-pc-linux-gnu, ok for mainline?

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-12-02  Nathan Sidwell  <nathan@codesourcery.com>

	* decl.c (grokdeclarator): Deprecated implicit typename use.

2001-12-02  Nathan Sidwell  <nathan@codesourcery.com>

	* doc/extend.texi (Deprecated Features): Deprecate implicit
	typename. Document that named return and initializer lists are now
	removed.

2001-12-02  Nathan Sidwell  <nathan@codesourcery.com>

	* g++.old-deja/g++.brendan/crash56.C: Adjust implicit typename.
	* g++.old-deja/g++.jason/2371.C: Likewise.
	* g++.old-deja/g++.jason/template33.C: Likewise.
	* g++.old-deja/g++.jason/template34.C: Likewise.
	* g++.old-deja/g++.jason/template36.C: Likewise.
	* g++.old-deja/g++.oliva/typename1.C: Likewise.
	* g++.old-deja/g++.oliva/typename2.C: Likewise.
	* g++.old-deja/g++.other/typename1.C: Likewise.
	* g++.old-deja/g++.pt/inherit2.C: Likewise.
	* g++.old-deja/g++.pt/nontype5.C: Likewise.
	* g++.old-deja/g++.pt/typename11.C: Likewise.
	* g++.old-deja/g++.pt/typename14.C: Likewise.
	* g++.old-deja/g++.pt/typename16.C: Likewise.
	* g++.old-deja/g++.pt/typename3.C: Likewise.
	* g++.old-deja/g++.pt/typename4.C: Likewise.
	* g++.old-deja/g++.pt/typename5.C: Likewise.
	* g++.old-deja/g++.pt/typename7.C: Likewise.
	* g++.old-deja/g++.robertl/eb9.C: Likewise.

Index: doc/extend.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/extend.texi,v
retrieving revision 1.37
diff -c -3 -p -r1.37 extend.texi
*** extend.texi	2001/11/18 03:30:55	1.37
--- extend.texi	2001/12/02 14:42:41
*************** parameters, as C++ demands.  This featur
*** 5319,5330 ****
  it is required for backwards compatibility @xref{Backwards Compatibility}.
  @end table
  
! The named return value extension has been deprecated, and will be
! removed from g++ at some point.
  
  The use of initializer lists with new expressions has been deprecated,
! and will be removed from g++ at some point.
  
  @node Backwards Compatibility
  @section Backwards Compatibility
  @cindex Backwards Compatibility
--- 5319,5338 ----
  it is required for backwards compatibility @xref{Backwards Compatibility}.
  @end table
  
! The named return value extension has been deprecated, and is now
! removed from g++.
  
  The use of initializer lists with new expressions has been deprecated,
! and is now removed from g++.
  
+ Floating and complex non-type template parameters have been deprecated,
+ and are now removed from g++.
+ 
+ The implicit typename extension has been deprecated and will be removed
+ from g++ at some point.  In some cases g++ determines that a dependant
+ type such as @code{TPL<T>::X} is a type without needing a
+ @code{typename} keyword, contrary to the standard.
+ 
  @node Backwards Compatibility
  @section Backwards Compatibility
  @cindex Backwards Compatibility
*************** the end of the scope which contained the
*** 5346,5352 ****
  within the for scope).  G++ retains this, but issues a warning, if such a
  variable is accessed outside the for scope.
  
! @item implicit C language
  Old C system header files did not contain an @code{extern "C" @{@dots{}@}}
  scope to set the language.  On such systems, all header files are
  implicitly scoped inside a C language scope.  Also, an empty prototype
--- 5354,5360 ----
  within the for scope).  G++ retains this, but issues a warning, if such a
  variable is accessed outside the for scope.
  
! @item Implicit C language
  Old C system header files did not contain an @code{extern "C" @{@dots{}@}}
  scope to set the language.  On such systems, all header files are
  implicitly scoped inside a C language scope.  Also, an empty prototype
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.829
diff -c -3 -p -r1.829 decl.c
*** decl.c	2001/11/27 14:31:28	1.829
--- decl.c	2001/12/02 14:45:38
*************** grokdeclarator (declarator, declspecs, d
*** 10144,10149 ****
--- 10144,10164 ----
  
        type = integer_type_node;
      }
+   
+   if (type && TREE_CODE (type) == TYPENAME_TYPE && TREE_TYPE (type))
+     {
+       /* The implicit typename extension is deprecated and will be
+ 	 removed.  Warn about its use now.  */
+       cp_warning ("`%T' is implicitly a typename", type);
+       cp_deprecated ("implicit typename");
+ 
+       /* Now remove its implicitness, so that we don't warn again.
+          For instance this might be a typedef, and we do not want to
+          warn on uses of the typedef itself.  Simply clearing the
+          TREE_TYPE is insufficient.  */
+       type = copy_node (type);
+       TREE_TYPE (type) = NULL_TREE;
+     }
  
    ctype = NULL_TREE;
  
Index: testsuite/g++.old-deja/g++.brendan/crash56.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 crash56.C
*** crash56.C	1998/12/16 21:24:11	1.3
--- crash56.C	2001/12/02 14:45:47
*************** public:
*** 140,149 ****
      ListD<T>::length;
      ListD<T>::empty;
      ListD<T>::clear;
!     typedef ListD<T>::Vix Vix;
      ListD<T>::first;
      ListD<T>::next;
      ListD<T>::operator();
  };
  extern "C" {
  extern void __eprintf (const char *, const char *, unsigned, const char *);
--- 140,152 ----
      ListD<T>::length;
      ListD<T>::empty;
      ListD<T>::clear;
!     typedef typename ListD<T>::Vix Vix;
      ListD<T>::first;
      ListD<T>::next;
      ListD<T>::operator();
+ 
+   using ListD<T>::NORMAL;
+   using ListD<T>::REMOVE_CURRENT;
  };
  extern "C" {
  extern void __eprintf (const char *, const char *, unsigned, const char *);
*************** template<class T>
*** 255,261 ****
  void
  SetLD<T>::add(const ListD<T>& other)
  {
!     ListD<T>::Vix x;
      for (first(x); 0 != x; next(x))
  	add(other(x));
  }
--- 258,264 ----
  void
  SetLD<T>::add(const ListD<T>& other)
  {
!     typename ListD<T>::Vix x;
      for (first(x); 0 != x; next(x))
  	add(other(x));
  }
*************** template<class T>
*** 270,276 ****
  void
  SetLD<T>::remove(const T& item)
  {
!     Action a = NORMAL;
      Vix x;
      for (first(x); 0 != x && REMOVE_CURRENT != a; next(x, a))
  	a = operator()(x) == item ? REMOVE_CURRENT: NORMAL;// ERROR - .*
--- 273,279 ----
  void
  SetLD<T>::remove(const T& item)
  {
!     typename ListD<T>::Action a = NORMAL;
      Vix x;
      for (first(x); 0 != x && REMOVE_CURRENT != a; next(x, a))
  	a = operator()(x) == item ? REMOVE_CURRENT: NORMAL;// ERROR - .*
*************** operator==(const SetLD<T>& a, const SetL
*** 292,298 ****
  {
      if (a.length() != b.length())
  	return FALSE;
!     SetLD<T>::Vix x;
      for (a.first(x); 0 != x; a.next(x)) {
  	if ( ! b.contains(a(x)) )
  	    return FALSE;
--- 295,301 ----
  {
      if (a.length() != b.length())
  	return FALSE;
!     typename SetLD<T>::Vix x;
      for (a.first(x); 0 != x; a.next(x)) {
  	if ( ! b.contains(a(x)) )
  	    return FALSE;
*************** operator<=(const SetLD<T>& a, const SetL
*** 313,319 ****
  {
      if (a.length() > b.length())
  	return FALSE;
!     SetLD<T>::Vix x;
      for (x=a.first(); 0 != x; a.next(x)) {
  	if ( ! b.contains(a(x)) )
  	    return FALSE;
--- 316,322 ----
  {
      if (a.length() > b.length())
  	return FALSE;
!     typename SetLD<T>::Vix x;
      for (x=a.first(); 0 != x; a.next(x)) {
  	if ( ! b.contains(a(x)) )
  	    return FALSE;
Index: testsuite/g++.old-deja/g++.jason/2371.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.jason/2371.C,v
retrieving revision 1.7
diff -c -3 -p -r1.7 2371.C
*** 2371.C	2001/04/06 22:05:07	1.7
--- 2371.C	2001/12/02 14:46:04
***************
*** 1,4 ****
- # 1 "SetLS.cc"
  // GROUPS passed templates nested-classes
  // Special g++ Options: 
  //
--- 1,3 ----
***************
*** 14,20 ****
  #include <iostream>
  using namespace std;
  
- # 1 "../../templates/SetLS.h" 1
  // -*- C++ -*-
  
  
--- 13,18 ----
*************** using namespace std;
*** 38,47 ****
  #define XTRUE true
  #define XFALSE false
  
- # 37 "../../templates/SetLS.h"
  
  
- # 1 "../../templates/ListS.h" 1
  // -*- C++ -*-
  
  
--- 36,43 ----
*************** using namespace std;
*** 63,69 ****
  
  
  
- # 1 "/projects/gnu-cygnus/gnu-cygnus-14/mips/lib/gcc-lib/decstation/cygnus-reno-1/g++-include/bool.h" 1 3
  // Defining XTRUE and XFALSE is usually a Bad Idea,
  // because you will probably be inconsistent with anyone
  // else who had the same clever idea.
--- 59,64 ----
*************** using namespace std;
*** 77,85 ****
  
  
  
- # 23 "../../templates/ListS.h" 2
  
- # 37 "../../templates/ListS.h"
  
  
  
--- 72,78 ----
*************** public:
*** 189,195 ****
  	{ check(x);
  	  return x.index->item; }
  protected:
- # 154 "../../templates/ListS.h"
  
  
      unsigned count;
--- 182,187 ----
*************** ListS<T>::remove_head_filling(T* fill)
*** 320,329 ****
  }
  
  
- # 40 "../../templates/SetLS.h" 2
  
  
- # 62 "../../templates/SetLS.h"
  
  template<class T>
  class SetLS {
--- 312,319 ----
*************** public:
*** 361,371 ****
      private:
  	friend class SetLS<T>;
  
! 	Vix(const SetLS<T> *o, const ListS<T>::Vix& x): owner(o), vix(x)
  	    { }
  
  	const SetLS<T> *owner;
! 	ListS<T>::Vix vix;
      };
      friend class Vix;
      
--- 351,361 ----
      private:
  	friend class SetLS<T>;
  
! 	Vix(const SetLS<T> *o, const typename ListS<T>::Vix& x): owner(o), vix(x)
  	    { }
  
  	const SetLS<T> *owner;
! 	typename ListS<T>::Vix vix;
      };
      friend class Vix;
      
*************** SetLS<T>::contains(const T& item) const
*** 422,428 ****
  }
  
  
- # 17 "SetLS.cc" 2
  
  
  
--- 412,417 ----
Index: testsuite/g++.old-deja/g++.jason/template33.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.jason/template33.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 template33.C
*** template33.C	1998/12/16 21:37:35	1.2
--- template33.C	2001/12/02 14:46:10
*************** public:
*** 12,17 ****
  };
  
  template <class T>
! A<T>::muni A<T>::f() { return X; }
  
  template class A<int>;
--- 12,17 ----
  };
  
  template <class T>
! typename A<T>::muni A<T>::f() { return X; }
  
  template class A<int>;
Index: testsuite/g++.old-deja/g++.jason/template34.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.jason/template34.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 template34.C
*** template34.C	1998/12/16 21:37:36	1.3
--- template34.C	2001/12/02 14:46:10
*************** int gen_cmp(const T& a, const T& b) {
*** 14,20 ****
  }
  
  template<class T>
! Set<T>::Compare Set<T>::cmp1 = &gen_cmp;
  
  template<class T>
  int (*Set<T>::cmp2)(const T&, const T&) = &gen_cmp;
--- 14,20 ----
  }
  
  template<class T>
! typename Set<T>::Compare Set<T>::cmp1 = &gen_cmp;
  
  template<class T>
  int (*Set<T>::cmp2)(const T&, const T&) = &gen_cmp;
Index: testsuite/g++.old-deja/g++.jason/template36.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.jason/template36.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 template36.C
*** template36.C	1998/12/16 21:37:38	1.2
--- template36.C	2001/12/02 14:46:10
*************** struct base_trait {
*** 18,23 ****
--- 18,24 ----
      typedef base1 base;
  };
  
+ template<>
  struct base_trait<float> {
      typedef base2 base;
  };
*************** struct base_trait<float> {
*** 25,31 ****
  template<class T>
  class weird : public base_trait<T>::base {
  public:
!     typedef base_trait<T>::base base;
  
      base f ();
      int base::* g ();
--- 26,32 ----
  template<class T>
  class weird : public base_trait<T>::base {
  public:
!     typedef typename base_trait<T>::base base;
  
      base f ();
      int base::* g ();
*************** public:
*** 35,48 ****
  };
  
  template <class T>
! weird<T>::base weird<T>::f ()
  {
      return base();
  }
  
  template <class T>
! int weird<T>::base::* weird<T>::g ()
  { return 0; }
  
  int main()
  {
--- 36,53 ----
  };
  
  template <class T>
! typename weird<T>::base weird<T>::f ()
  {
      return base();
  }
  
+ // The standard does not allow this case; the `typename' keyword may
+ // not appear in a ptr-operator.
+ #if 0
  template <class T>
! int typename weird<T>::base::* weird<T>::g ()
  { return 0; }
+ #endif
  
  int main()
  {
Index: testsuite/g++.old-deja/g++.oliva/typename1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.oliva/typename1.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 typename1.C
*** typename1.C	1999/07/05 14:04:37	1.2
--- typename1.C	2001/12/02 14:46:29
*************** template <class T> struct bar {
*** 12,17 ****
  };
  
  template <class T> struct baz {
!   typedef bar<T>::foo foo; // ERROR - missing typename - XFAIL *-*-*
!   void m(foo);
  };
--- 12,16 ----
  };
  
  template <class T> struct baz {
!   typedef bar<T>::foo foo; // ERROR - missing typename
  };
Index: testsuite/g++.old-deja/g++.oliva/typename2.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.oliva/typename2.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 typename2.C
*** typename2.C	1999/07/05 14:04:38	1.2
--- typename2.C	2001/12/02 14:46:29
***************
5
  // Build don't link:
! // Special g++ Options:
  
  // Copyright (C) 1999 Free Software Foundation
  
--- 1,5 ----
  // Build don't link:
! // Special g++ Options: -Wno-deprecated
  
  // Copyright (C) 1999 Free Software Foundation
  
*************** template <class T> struct bar {
28
  };
  
  template <class T> struct baz {
!   typedef bar<T>::foo foo; // ERROR - implicit typename - XFAIL *-*-*
    void m(foo); 
  };
--- 23,28 ----
  };
  
  template <class T> struct baz {
!   typedef bar<T>::foo foo; // WARNING - implicit typename
    void m(foo); 
  };
Index: testsuite/g++.old-deja/g++.other/typename1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.other/typename1.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 typename1.C
*** typename1.C	1998/12/16 21:53:41	1.2
--- typename1.C	2001/12/02 14:46:36
***************
*** 2,8 ****
  // Based on a test case by Louidor Erez <s3824888@techst02.technion.ac.il>
  
  // Build don't link:
! // Special g++ Options: -pedantic
  
  template<class T>
  class Vector {
--- 2,8 ----
  // Based on a test case by Louidor Erez <s3824888@techst02.technion.ac.il>
  
  // Build don't link:
! // Special g++ Options: -pedantic -Wno-deprecated
  
  template<class T>
  class Vector {
*************** public:
*** 13,17 ****
  template<class T>
  void f()
  {
!   Vector<T>::iterator i = 0; // ERROR - missing typename - XFAIL *-*-*
  }
--- 13,17 ----
  template<class T>
  void f()
  {
!   Vector<T>::iterator i = 0; // WARNING - missing typename
  }
Index: testsuite/g++.old-deja/g++.pt/inherit2.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/inherit2.C,v
retrieving revision 1.5
diff -c -3 -p -r1.5 inherit2.C
*** inherit2.C	2001/05/18 15:00:29	1.5
--- inherit2.C	2001/12/02 14:46:41
***************
*** 1,20 ****
- // Test that we warn about unqualified references to implicit typenames.
- 
- // Special g++ Options:
  // Build don't link:
  
! template <class T> struct A {
!   struct AA { };
!   struct AB { };
!   struct AC { };
  };
  
! template <class T> struct B: public A<T> {
!   friend struct B::AA;		// OK
!   friend AB;			// WARNING - needs class-key
!   friend struct AC;		// WARNING - refers to ::AC
  };
  
  B<int> b;
  
! int main () { }
--- 1,67 ----
  // Build don't link:
+ 
+ // Make sure we make the right unqualified class a friend
+ // See PR c++/4403
+ 
+ template <class T> struct A
+ {
+   struct AA;
+   struct AC;
+ };
+ 
+ template <class T> class B
+   :public A<T>
+ {
+   friend struct B::AA;		// OK, this has an implicit typename
+ 				// as if it is 'friend struct typename B::AA'
+ 				// (I think there's a defect report
+ 				// about that)
+   friend struct AC;	// this makes ::AC a friend *not* A<T>::AC
+ 
+   private: // only our friends can get out values
+   static T valueA_AA;
+   static T valueA_AC;
+   static T value_AC;
+ };
+ template <typename T> T B<T>::valueA_AA;
+ template <typename T> T B<T>::valueA_AC;// ERROR - private - XFAIL *-*-*
+ template <typename T> T B<T>::value_AC;	// gets bogus error - XFAIL *-*-*
+ 
+ // this one is a friend
+ template <class T> struct A<T>::AA
+ {
+   int M ()
+   {
+     return B<T>::valueA_AA;
+   }
+ };
  
! // this is not a friend
! template <class T> struct A<T>::AC
! {
!   T M ()
!   {
!     return B<T>::valueA_AC;	// ERROR - within this context - XFAIL *-*-*
!   }
  };
  
! // this is a friend
! struct AC 
! {
!   int M ()
!   {
!     return B<int>::value_AC;	// gets bogus error - XFAIL *-*-*
!   }
  };
  
  B<int> b;
+ A<int>::AA a_aa;
+ A<int>::AC a_ac;
+ AC ac;
  
! int main ()
! {
!   a_aa.M ();
!   a_ac.M ();
!   ac.M ();
! }
Index: testsuite/g++.old-deja/g++.pt/nontype5.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/nontype5.C,v
retrieving revision 1.1
diff -c -3 -p -r1.1 nontype5.C
*** nontype5.C	2001/01/15 09:30:03	1.1
--- nontype5.C	2001/12/02 14:46:47
*************** struct A {
*** 11,23 ****
  typedef int F();
  };
  
! template<class T, A<T>::F f>
  struct B {
  static int g() { return f(); };
  };
  
! int f() { return 0; };
  
  int main() {
  return B<int,&f>::g();  // ERROR - could not convert arg
! };
--- 11,23 ----
  typedef int F();
  };
  
! template<class T, typename A<T>::F f>
  struct B {
  static int g() { return f(); };
  };
  
! int f() { return 0; }
  
  int main() {
  return B<int,&f>::g();  // ERROR - could not convert arg
! }
Index: testsuite/g++.old-deja/g++.pt/typename11.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename11.C,v
retrieving revision 1.5
diff -c -3 -p -r1.5 typename11.C
*** typename11.C	2000/07/04 07:47:11	1.5
--- typename11.C	2001/12/02 14:46:53
***************
*** 1,5 ****
  // Build don't link:
! // Special g++ Options:
  
  template <class T, int I>
  struct S {
--- 1,5 ----
  // Build don't link:
! // Special g++ Options: -Wno-deprecated
  
  template <class T, int I>
  struct S {
*************** struct S {
*** 7,14 ****
  };
  
  template <class T, class U, int I>
! S<T,I>::X f(T, U)
! {
    S<T, I>::X();
    return S<T, I>::X();
  }
--- 7,13 ----
  };
  
  template <class T, class U, int I>
! S<T,I>::X f(T, U) {   // WARNING - implicit typename
    S<T, I>::X();
    return S<T, I>::X();
  }
Index: testsuite/g++.old-deja/g++.pt/typename14.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename14.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 typename14.C
*** typename14.C	1998/12/16 22:02:24	1.2
--- typename14.C	2001/12/02 14:46:53
***************
*** 1,5 ****
  // Build don't link:
! // Special g++ Options:
  
  template <class T>
  struct B {
--- 1,5 ----
  // Build don't link:
! // Special g++ Options: -Wno-deprecated
  
  template <class T>
  struct B {
*************** template <class T>
*** 10,15 ****
  struct S : public B<T>
  {
    struct I {
!     void f(X x);
    };
  };
--- 10,15 ----
  struct S : public B<T>
  {
    struct I {
!     void f(X x);   // WARNING - implicit typename
    };
  };
Index: testsuite/g++.old-deja/g++.pt/typename16.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename16.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 typename16.C
*** typename16.C	1999/09/04 15:09:08	1.2
--- typename16.C	2001/12/02 14:46:53
***************
*** 1,5 ****
  // Build don't run:
! // Special g++ Options:
  
  struct B {
    typedef int I;
--- 1,5 ----
  // Build don't run:
! // Special g++ Options: -Wno-deprecated
  
  struct B {
    typedef int I;
*************** struct D1 : public B {
*** 11,17 ****
  
  template <class T>
  struct D2 : public D1<T> {
!   I i;
  };
  
  template <>
--- 11,17 ----
  
  template <class T>
  struct D2 : public D1<T> {
!   I i;  // WARNING - implicit typename
  };
  
  template <>
Index: testsuite/g++.old-deja/g++.pt/typename3.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename3.C,v
retrieving revision 1.5
diff -c -3 -p -r1.5 typename3.C
*** typename3.C	1999/03/05 16:38:46	1.5
--- typename3.C	2001/12/02 14:46:54
***************
*** 1,5 ****
  // Build don't link:
! // Special g++ Options:
  
  template <class T>
  struct A
--- 1,5 ----
  // Build don't link:
! // Special g++ Options: -Wno-deprecated
  
  template <class T>
  struct A
*************** struct A
*** 11,21 ****
  template <class U>
  struct B : public A<U>
  {
!   A_Type Func();
  };
  
  
  template <class U>
! B<U>::A_Type B<U>::Func()
! {
  }
--- 11,20 ----
  template <class U>
  struct B : public A<U>
  {
!   A_Type Func(); // WARNING - implicit typename
  };
  
  
  template <class U>
! B<U>::A_Type B<U>::Func() { // WARNING - implicit typename
  }
Index: testsuite/g++.old-deja/g++.pt/typename4.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename4.C,v
retrieving revision 1.4
diff -c -3 -p -r1.4 typename4.C
*** typename4.C	1998/12/16 22:02:27	1.4
--- typename4.C	2001/12/02 14:46:54
***************
*** 1,5 ****
  // Build don't link:
! // Special g++ Options:
  
  template <class T>
  struct A
--- 1,5 ----
  // Build don't link:
! // Special g++ Options: -Wno-deprecated
  
  template <class T>
  struct A
*************** struct B : public A<U>
*** 17,27 ****
  template <class U>
  struct C : public B<U>
  {
!   A_Type Func();
  };
  
  
  template <class U>
! C<U>::A_Type C<U>::Func()
! {
  }
--- 17,26 ----
  template <class U>
  struct C : public B<U>
  {
!   A_Type Func(); // WARNING - implicit typename
  };
  
  
  template <class U>
! C<U>::A_Type C<U>::Func() { // WARNING - implicit typename
  }
Index: testsuite/g++.old-deja/g++.pt/typename5.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename5.C,v
retrieving revision 1.4
diff -c -3 -p -r1.4 typename5.C
*** typename5.C	1998/12/16 22:02:29	1.4
--- typename5.C	2001/12/02 14:46:54
***************
*** 1,5 ****
  // Build don't link:
! // Special g++ Options:
  
  template <class T>
  struct A
--- 1,5 ----
  // Build don't link:
! // Special g++ Options: -Wno-deprecated
  
  template <class T>
  struct A
*************** struct B : public A<U>
*** 17,27 ****
  template <class U>
  struct C : public B<U>
  {
!   void Func(A_Type);
  };
  
  
  template <class U>
! void C<U>::Func(A_Type)
! {
  }
--- 17,26 ----
  template <class U>
  struct C : public B<U>
  {
!   void Func(A_Type);  // WARNING - implicit typename
  };
  
  
  template <class U>
! void C<U>::Func(A_Type) { // WARNING - implicit typename
  }
Index: testsuite/g++.old-deja/g++.pt/typename7.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename7.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 typename7.C
*** typename7.C	1998/12/16 22:02:31	1.2
--- typename7.C	2001/12/02 14:46:54
*************** template <class T>
*** 15,20 ****
  struct D : public A <C <T> > {
    void f ()
      {
!       B* new_entries = (B *) 0;
      }
  };
--- 15,20 ----
  struct D : public A <C <T> > {
    void f ()
      {
!       B* new_entries = (B *) 0;  // WARNING - implicit typename
      }
  };
Index: testsuite/g++.old-deja/g++.robertl/eb9.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 eb9.C
*** eb9.C	1998/12/16 22:04:50	1.2
--- eb9.C	2001/12/02 14:46:58
*************** public:
*** 15,21 ****
  
  
  template <class Key>
! d0om_Hashmap<Key>::value_type* d0om_Hashmap<Key>::iterator::operator-> () const
  {
    return 0;
  }
--- 15,22 ----
  
  
  template <class Key>
! typename d0om_Hashmap<Key>::value_type*
! d0om_Hashmap<Key>::iterator::operator-> () const
  {
    return 0;
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]