This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Remove float and complex template constant parms
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH] Remove float and complex template constant parms
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Tue, 27 Feb 2001 14:55:27 +0000
- CC: mark at codesourcery dot com
- Organization: Codesourcery LLC
Hi,
This patch removes support for float and complex template constant
parameters - there appears to be no documentation to remove about them.
built & 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-02-27 Nathan Sidwell <nathan@codesourcery.com>
Remove floating point and complex type template constant parms.
* pt.c (convert_nontype_argument): Remove REAL_TYPE and
COMPLEX_TYPE extensions.
(invalid_nontype_parm_type_p): Likewise.
2001-02-27 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.ext/realpt1.C: Remove.
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:45:44
*************** convert_nontype_argument (type, expr)
*** 2945,2954 ****
}
else if (INTEGRAL_TYPE_P (expr_type)
|| TYPE_PTRMEM_P (expr_type)
! || TYPE_PTRMEMFUNC_P (expr_type)
! /* The next two are g++ extensions. */
! || TREE_CODE (expr_type) == REAL_TYPE
! || TREE_CODE (expr_type) == COMPLEX_TYPE)
{
if (! TREE_CONSTANT (expr))
{
--- 2945,2951 ----
}
else if (INTEGRAL_TYPE_P (expr_type)
|| TYPE_PTRMEM_P (expr_type)
! || TYPE_PTRMEMFUNC_P (expr_type))
{
if (! TREE_CONSTANT (expr))
{
*************** convert_nontype_argument (type, expr)
*** 2987,3005 ****
return expr;
- case REAL_TYPE:
- case COMPLEX_TYPE:
- /* These are g++ extensions. */
- if (TREE_CODE (expr_type) != TREE_CODE (type))
- return error_mark_node;
-
- expr = digest_init (type, expr, (tree*) 0);
-
- if (TREE_CODE (expr) != REAL_CST)
- goto non_constant;
-
- return expr;
-
case POINTER_TYPE:
{
tree type_pointed_to = TREE_TYPE (type);
--- 2984,2989 ----
*************** invalid_nontype_parm_type_p (type, compl
*** 10355,10364 ****
return 0;
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)
--- 10339,10344 ----