diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-16 19:38:57 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-16 19:38:57 +0000 |
commit | fbb01da7f6e67f35be3c62f1c118d9595952d1f6 (patch) | |
tree | 76f4797c33c693120da1fa591e01740f0bef605d /gcc/cp/mangle.c | |
parent | ec7d1569362ff61904f7d618062fd00b89fc63f4 (diff) | |
download | gcc-fbb01da7f6e67f35be3c62f1c118d9595952d1f6.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105463 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 9dca2a56c55..b07012252bb 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2008,9 +2008,10 @@ write_expression (tree expr) if (code == PTRMEM_CST) { expr = build_nt (ADDR_EXPR, - build_nt (SCOPE_REF, - PTRMEM_CST_CLASS (expr), - PTRMEM_CST_MEMBER (expr))); + build_qualified_name (/*type=*/NULL_TREE, + PTRMEM_CST_CLASS (expr), + PTRMEM_CST_MEMBER (expr), + /*template_p=*/false)); code = TREE_CODE (expr); } @@ -2186,7 +2187,7 @@ write_expression (tree expr) for (i = 0; i < TREE_CODE_LENGTH (code); ++i) { tree operand = TREE_OPERAND (expr, i); - /* As a GNU expression, the middle operand of a + /* As a GNU extension, the middle operand of a conditional may be omitted. Since expression manglings are supposed to represent the input token stream, there's no good way to mangle such an |