summaryrefslogtreecommitdiffstats
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-16 19:38:57 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-16 19:38:57 +0000
commitfbb01da7f6e67f35be3c62f1c118d9595952d1f6 (patch)
tree76f4797c33c693120da1fa591e01740f0bef605d /gcc/cp/tree.c
parentec7d1569362ff61904f7d618062fd00b89fc63f4 (diff)
downloadppe42-gcc-fbb01da7f6e67f35be3c62f1c118d9595952d1f6.tar.gz
ppe42-gcc-fbb01da7f6e67f35be3c62f1c118d9595952d1f6.zip
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/tree.c')
-rw-r--r--gcc/cp/tree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 954a8093a95..15ee56c7c87 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -805,6 +805,23 @@ debug_binfo (tree elem)
}
}
+/* Build a representation for the qualified name SCOPE::NAME. TYPE is
+ the type of the result expression, if known, or NULL_TREE if the
+ resulting expression is type-dependent. If TEMPLATE_P is true,
+ NAME is known to be a template because the user explicitly used the
+ "template" keyword after the "::".
+
+ All SCOPE_REFs should be built by use of this function. */
+
+tree
+build_qualified_name (tree type, tree scope, tree name, bool template_p)
+{
+ tree t;
+ t = build2 (SCOPE_REF, type, scope, name);
+ QUALIFIED_NAME_IS_TEMPLATE (t) = template_p;
+ return t;
+}
+
int
is_overloaded_fn (tree x)
{
OpenPOWER on IntegriCloud