From e5844e6d3984a967559f02386556127d12c8746f Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 28 Feb 2001 10:44:05 +0000 Subject: [PATCH] Remove floating point and complex type template constant parms. cp: 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. testuite: * g++.old-deja/g++.ext/realpt1.C: Remove. From-SVN: r40117 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/pt.c | 22 +------------------- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.old-deja/g++.ext/realpt1.C | 19 ----------------- 4 files changed, 12 insertions(+), 40 deletions(-) delete mode 100644 gcc/testsuite/g++.old-deja/g++.ext/realpt1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3dfe8d3c460..fc3fb94597b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2001-02-28 Nathan Sidwell + + 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 Jeffrey Oldham * except.c (call_eh_info): Revert "match_function"'s type. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 630adc94820..331b307dc3d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2945,10 +2945,7 @@ convert_nontype_argument (type, expr) } 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) + || TYPE_PTRMEMFUNC_P (expr_type)) { if (! TREE_CONSTANT (expr)) { @@ -2987,19 +2984,6 @@ convert_nontype_argument (type, expr) 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); @@ -10355,10 +10339,6 @@ invalid_nontype_parm_type_p (type, complain) 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9a6eaf701a2..82d82b3e608 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-02-28 Nathan Sidwell + + * g++.old-deja/g++.ext/realpt1.C: Remove. + 2001-02-27 Nathan Sidwell * g++.old-deja/g++.abi/vtable3.h: Check vcall offsets too. diff --git a/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C b/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C deleted file mode 100644 index 7e8ea9164bc..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C +++ /dev/null @@ -1,19 +0,0 @@ -// Build don't link: -// Special g++ Options: -// Origin: Mark Mitchell - -template -struct S; - -template -void f (S*, S*, S*); - -void g () -{ - S<2.0>* s1; - S<3.7>* s2; - S<5.7>* s3; - - f (s1, s2, s3); -} - -- 2.30.2