From f07be57a397faa0db543ded2bc4bacd7736ea620 Mon Sep 17 00:00:00 2001 From: mmitchel Date: Fri, 15 Jan 1999 18:34:48 +0000 Subject: * pt.c (process_template_parm): Ignore top-level qualifiers on non-type parameters. * decl.c (start_function): Use current_function_parms in the call to require_complete_type_for_parms, not the probably empty DECL_ARGUMENTS. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24684 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 9 +++++++++ gcc/cp/decl.c | 4 ++-- gcc/cp/pt.c | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a0145167ed9..c0daba4189e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +1999-01-15 Mark Mitchell + + * pt.c (process_template_parm): Ignore top-level qualifiers on + non-type parameters. + + * decl.c (start_function): Use current_function_parms in the call + to require_complete_type_for_parms, not the probably empty + DECL_ARGUMENTS. + 1999-01-14 Jason Merrill * semantics.c (finish_asm_stmt): Don't warn about redundant volatile. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bf887d2918d..5e603b6d480 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12860,8 +12860,8 @@ start_function (declspecs, declarator, attrs, pre_parsed_p) if (! processing_template_decl) { - /* In a fcn definition, arg types must be complete. */ - require_complete_types_for_parms (DECL_ARGUMENTS (decl1)); + /* In a function definition, arg types must be complete. */ + require_complete_types_for_parms (current_function_parms); if (TYPE_SIZE (complete_type (TREE_TYPE (fntype))) == NULL_TREE) { diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index fea1c345be8..a28751b0386 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1591,6 +1591,13 @@ process_template_parm (list, next) /* is a const-param */ parm = grokdeclarator (TREE_VALUE (parm), TREE_PURPOSE (parm), PARM, 0, NULL_TREE); + + /* [temp.param] + + The top-level cv-qualifiers on the template-parameter are + ignored when determining its type. */ + TREE_TYPE (parm) = TYPE_MAIN_VARIANT (TREE_TYPE (parm)); + /* A template parameter is not modifiable. */ TREE_READONLY (parm) = 1; if (IS_AGGR_TYPE (TREE_TYPE (parm)) -- cgit v1.2.1