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]

[C++ patch] deprecate float & complex template constant parms


Hi,
this patch deprecates floating point and complex template constant parms.

built & tested on i686-pc-linux-gnu, ok for 3.0 branch?

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-02-27  Nathan Sidwell  <nathan@codesourcery.com>

	* extend.texi (Deprecated Features): Deprecate float and
	complex template constant parms.

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

	* pt.c (invalid_nontype_parm_type_p): Deprecate float and
	complex types.

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

	* g++.old-deja/g++.ext/realpt1.C: Deprecate.

Index: extend.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/extend.texi,v
retrieving revision 1.94
diff -c -3 -p -r1.94 extend.texi
*** extend.texi	2001/02/22 15:41:49	1.94
--- extend.texi	2001/02/27 14:12:54
*************** removed from g++ at some point.
*** 4393,4398 ****
--- 4393,4401 ----
  The use of initializer lists with new expressions has been deprecated,
  and will be removed from g++ at some point.
  
+ Floating point and complex template constant parameters are deprecated,
+ and will be removed from g++ at some point.
+ 
  @node Backwards Compatibility
  @section Backwards Compatibility
  @cindex Backwards Compatibility
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/pt.c,v
retrieving revision 1.522
diff -c -3 -p -r1.522 pt.c
*** pt.c	2001/02/18 20:31:43	1.522
--- pt.c	2001/02/27 14:13:00
*************** invalid_nontype_parm_type_p (type, compl
*** 10356,10364 ****
    else if (TYPE_PTRMEMFUNC_P (type))
      return 0;
    else if (!pedantic && TREE_CODE (type) == REAL_TYPE)
!     return 0; /* GNU extension */
    else if (!pedantic && TREE_CODE (type) == COMPLEX_TYPE)
!     return 0; /* GNU extension */
    else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
      return 0;
    else if (TREE_CODE (type) == TYPENAME_TYPE)
--- 10356,10372 ----
    else if (TYPE_PTRMEMFUNC_P (type))
      return 0;
    else if (!pedantic && TREE_CODE (type) == REAL_TYPE)
!     {
!       if (complain)
!         cp_deprecated ("floating point template constant parameter");
!       return 0; /* GNU extension */
!     }
    else if (!pedantic && TREE_CODE (type) == COMPLEX_TYPE)
!     {
!       if (complain)
!         cp_deprecated ("complex template constant parameter");
!       return 0; /* GNU extension */
!     }
    else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
      return 0;
    else if (TREE_CODE (type) == TYPENAME_TYPE)
Index: testsuite/g++.old-deja/g++.ext/realpt1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C,v
retrieving revision 1.1
diff -c -3 -p -r1.1 realpt1.C
*** realpt1.C	1999/10/19 17:40:47	1.1
--- realpt1.C	2001/02/27 14:13:00
***************
*** 2,18 ****
  // Special g++ Options:
  // Origin: Mark Mitchell <mark@codesourcery.com>
  
! template <double d>
  struct S;
  
! template <double d, double e>
! void f (S<d>*, S<e>*, S<d + e>*);
  
  void g ()
  {
!   S<2.0>* s1;
!   S<3.7>* s2;
!   S<5.7>* s3;
    
    f (s1, s2, s3);
  }
--- 2,18 ----
  // Special g++ Options:
  // Origin: Mark Mitchell <mark@codesourcery.com>
  
! template <double d> // WARNING - deprecated
  struct S;
  
! template <double d, double e> // WARNING - deprecated
! void f (S<d>*, S<e>*, S<d + e>*);  // WARNING - deprecated
  
  void g ()
  {
!   S<2.0>* s1; // WARNING - deprecated
!   S<3.7>* s2; // WARNING - deprecated
!   S<5.7>* s3; // WARNING - deprecated
    
    f (s1, s2, s3);
  }

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