diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-30 07:24:02 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-30 07:24:02 +0000 |
commit | 5f6526e1c1d8af5b373ddab9ed2a6ef200914ad6 (patch) | |
tree | 9b52cc234bf9b52b7127dba18c43be2715c995b2 /gcc/cp/semantics.c | |
parent | 0924aa1d55504c9c44ee33530ff04805640c758c (diff) | |
download | gcc-5f6526e1c1d8af5b373ddab9ed2a6ef200914ad6.tar.gz |
* c-common.c (builtin_define_float_constants): Define
__<TYPE>_HAS_INFINITY__ and __<TYPE>_HAS_QUIET_NAN__.
* call.c (build_field_call): Use build_new_op, not build_opfncall.
(prep_operand): New function.
(build_new_op): Use it. Remove dead code.
* class.c (pushclass): Change "modify" parameter type from int to
bool.
(currently_open_class): Use same_type_p, not pointer equality.
(push_nested_class): Adjust calls to pushclass, remove modify
parameter.
* cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
(pushclass): Change prototype.
(push_nested_class): Likewise.
(grokoptypename): Remove.
(build_opfncall): Remove.
(value_dependent_expression_p): Declare.
(resolve_typename_type): Likewise.
(resolve_typename_type_in_current_instantiation): Likewise.
(enter_scope_of): Remove.
(tsubst): Remove.
(tsubst_expr): Likewise.
(tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
* decl.c (warn_about_implicit_typename_lookup): Remove.
(finish_case_label): Return error_mark_node for erroneous labels.
(start_decl): Adjust calls to push_nested_class.
(grokfndecl): Call push_scope/pop_scope around call to
duplicate_decls.
(grokdeclarator): Do not call tsubst.
(start_function): Adjust calls to push_nested_class.
* decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
(check_classfn): Use push_scope/pop_scope around type comparisions.
(grokoptypename): Remove.
(push_sscope): Adjust call to push_nested_class.
* error.c (dump_type): Show cv-qualification of typename types.
* init.c (build_member_call): Use build_new_op, not
build_opfncall.
* method.c (build_opfncall): Remove.
* parser.c (cp_parser): Add allow_non_constant_expression_p and
non_constant_expression_p.
(cp_parser_constant_expression): Adjust prototype.
(cp_parser_resolve_typename_type): Remove.
(cp_parser_non_constant_expression): New function.
(cp_parser_non_constant_id_expression): Likewise.
(cp_parser_new): Set allow_non_constant_expression_p and
non_constant_expression_p.
(cp_parser_primary_expression): Reject `this' and `va_arg' in
constant-expressions. Note that dependent names aren't really
constant.
(cp_parser_postfix_expression): Reject conversions to non-integral
types in constant-expressions. Neither are increments or
decrements.
(cp_parser_unary_expression): Reject increments and decrements in
constant-expressions.
(cp_parser_direct_new_declarator): Adjust call to
cp_parser_constant_expression.
(cp_parser_cast_expression): Reject conversions to non-integral
types in constant-expressions.
(cp_parser_assignment_expression): Rejects assignments in
constant-expressions.
(cp_parser_expression): Reject commas in constant-expressions.
(cp_parser_labeled_statement): Adjust call to
cp_parser_constant_expression.
(cp_parser_direct_declarator): Simplify array bounds, even in
templates, when they are non-dependent. Use
resolve_typename_type, not cp_parser_resolve_typename_type.
(cp_parser_class_head): Use resolve_typename_type, not
cp_parser_resolve_typename_type.
(cp_parser_member_declaration): Adjust call to
cp_parser_constant_expression.
(cp_parser_constant_initializer): Likewise.
(cp_parser_constructor_declarator): Use resolve_typename_type, not
cp_parser_resolve_typename_type.
(cp_parser_late_parsing_default_args): Adjust call to
push_nested_class.
* pt.c (tsubst): Give it internal linkage.
(tsubst_expr): Likewise.
(tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
(push_access_scope_real): Likewise.
(tsubst_friend_class): Likewise.
(instantiate_class_template): Adjust call to pushclass.
(value_dependent_expression_p): Give it external linkage.
Robustify.
(resolve_typename_type): New function.
* semantics.c (finish_call_expr): Use build_new_op, not
build_opfncall.
(begin_constructor_declarator): Remove.
(begin_class_definition): Adjust call to pushclass.
(enter_scope_of): Remove.
* typeck.c (comptypes): Resolve typename types as appropriate.
(build_x_indirect_ref): Use build_new_op, not build_opfncall.
(build_x_compound_expr): Likewise.
(build_modify_expr): Likewise.
(build_x_modify_expr): Likewise.
* typeck2.c (build_x_arrow): Likewise.
* g++.dg/parser/constant1.C: New test.
* include/std/std_limits.h (numeric_limits<float>::has_infinity):
Use __FLT_HAS_INIFINITY__ to initialize.
(numeric_limits<float>::has_quiet_NaN): Likewise.
(numeric_limits<double>::has_infinity): Use __DBL_HAS_INIFINITY__
to initialize.
(numeric_limits<double>::has_quiet_NaN): Likewise.
(numeric_limits<long double>::has_infinity): Use
__LDBL_HAS_INIFINITY__ to initialize.
(numeric_limits<long_double>::has_quiet_NaN): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62130 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index fb6f25d116f..9c0b28b6b13 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1434,7 +1434,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual) /* If the "function" is really an object of class type, it might have an overloaded `operator ()'. */ tree result; - result = build_opfncall (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE); + result = build_new_op (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE); if (result) return result; } @@ -1665,19 +1665,6 @@ begin_function_definition (decl_specs, attributes, declarator) return 1; } -/* Begin a constructor declarator of the form `SCOPE::NAME'. Returns - a SCOPE_REF. */ - -tree -begin_constructor_declarator (scope, name) - tree scope; - tree name; -{ - tree result = build_nt (SCOPE_REF, scope, name); - enter_scope_of (result); - return result; -} - /* Finish an init-declarator. Returns a DECL. */ tree @@ -1831,7 +1818,7 @@ begin_class_definition (t) pushtag (TYPE_IDENTIFIER (t), t, 0); } maybe_process_partial_specialization (t); - pushclass (t, 1); + pushclass (t, true); TYPE_BEING_DEFINED (t) = 1; TYPE_PACKED (t) = flag_pack_struct; /* Reset the interface data, at the earliest possible @@ -2044,34 +2031,6 @@ finish_template_type (name, args, entering_scope) return decl; } -/* SR is a SCOPE_REF node. Enter the scope of SR, whether it is a - namespace scope or a class scope. */ - -void -enter_scope_of (sr) - tree sr; -{ - tree scope = TREE_OPERAND (sr, 0); - - if (TREE_CODE (scope) == NAMESPACE_DECL) - { - push_decl_namespace (scope); - TREE_COMPLEXITY (sr) = -1; - } - else if (scope != current_class_type) - { - if (TREE_CODE (scope) == TYPENAME_TYPE) - { - /* In a declarator for a template class member, the scope will - get here as an implicit typename, a TYPENAME_TYPE with a type. */ - scope = TREE_TYPE (scope); - TREE_OPERAND (sr, 0) = scope; - } - push_nested_class (scope, 3); - TREE_COMPLEXITY (sr) = current_class_depth; - } -} - /* Finish processing a BASE_CLASS with the indicated ACCESS_SPECIFIER. Return a TREE_LIST containing the ACCESS_SPECIFIER and the BASE_CLASS, or NULL_TREE if an error occurred. The |