]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/semantics.c
re PR c++/22137 (Internal error: Segmentation fault (program cc1plus))
authorMark Mitchell <mark@codesourcery.com>
Sun, 16 Oct 2005 19:38:57 +0000 (19:38 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 16 Oct 2005 19:38:57 +0000 (19:38 +0000)
commit02ed62dd463d55d9d9810b9c8829691e7814743d
tree76f4797c33c693120da1fa591e01740f0bef605d
parentc2b27658fe406ae890354dd825e4060d65df7e0a
re PR c++/22137 (Internal error: Segmentation fault (program cc1plus))

PR c++/22137
* cp-tree.h (QUALIFIED_NAME_IS_TEMPLATE): New macro.
(check_template_keyword): New function.
(finish_id_expression): Change prototoype.
(finish_qualified_id_expr): Change prototype.
(build_qualified_name): New function.
(finish_class_member_access_expr): Change prototype.
* init.c (build_offset_ref): Use build_qualified_name.
* mangle.c (write_expression): Likewise.
* parser.c (cp_parser_primary_expression): Remove qualifying_class
parameter.  Add address_p and template_arg_p.  Use
build_qualified_name.
(cp_parser_id_expression): Default *template_p to
template_keyword_p.  Check for invalid uses of the template
keyword.
(cp_parser_postfix_expression): Eliminate special handling for
qualified names.  Adjust call to cp_parser_primary_expression.
(cp_parser_postfix_dot_deref_expression): Adjust call to
cp_parser_id_expression and finish_class_member_access_expr.
(cp_parser_template_argument_list): Add comment.
(cp_parser_template_argument): Adjust use of
cp_parser_primary_expression.  Remove call to
finish_qualified_id_expr.
(cp_parser_lookup_name): Use build_qualified_name.
* pt.c (tsubst): Use build_qualified_name.
(tsubst_qualified_id): Likewise.  Adjust call to
finish_qualified_id_expr.
(tsubst_copy): Use build_qualified_name.
(tsubst_copy_and_build): Adjusts call to finish_id_expression and
finish_class_member_access_expr.
* semantics.c (finish_non_static_data_member): Use
build_qualified_name.
(finish_qualified_id_expr): Add template_p and template_arg_p
parameters.
(finish_id_expression): Remove qualifiying_class parameter.  Add
template_p, done, address_p, and template_arg_p.  Use
build_qualified_name.  Adjust calls to
finish_class_member_acess_expr.
* tree.c (build_qualified_name): New function.
* typeck.c (check_template_keyword): New function.
(finish_class_member_access_expr): Add template_p argument.  Check
for invalid uses of the template keyword.

PR c++/22137
* g++.dg/parse/template18.C: New test.
* g++.dg/template/nontype15.C: Likewise.

From-SVN: r105463
12 files changed:
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/init.c
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/template18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/nontype15.C [new file with mode: 0644]