aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-07-26 08:18:19 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-07-26 08:18:19 +0000
commita7a64a77ef33be210374003a0b84dd8d60f75a49 (patch)
treec9b772ea54e12c6cccfb0e0b435dbd04cdf6a698 /gcc/cp/cp-tree.h
parent5cabd6f5f4b1c910709ab5beca3ad62e7d38ed7f (diff)
downloadgcc-a7a64a77ef33be210374003a0b84dd8d60f75a49.zip
gcc-a7a64a77ef33be210374003a0b84dd8d60f75a49.tar.gz
gcc-a7a64a77ef33be210374003a0b84dd8d60f75a49.tar.bz2
cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
* cp-tree.h (CP_INTEGRAL_TYPE_P): New macro. (ARITHMETIC_TYPE_P): Adjust definition for standard conformance. (strip_top_quals): Declare. (ncp_convert): Likewise. (type_after_usual_arithmetic_converions): Likewise. (composite_pointer_type): Likewise. * call.c (strip_top_quals): Don't make it static. (promoted_arithmetic_type_p): New function. (conditional_conversion): Likewise. (null_ptr_cst_p): Allow `false' as a NULL pointer constant. (standard_conversion): Use same_type_p. Don't build BASE_CONVs for converting a type to itself. (reference_binding): Honor LOOKUP_NO_TEMP_BIND. (implicit_conversion): Make sure the from and to types are complete. (add_builtin_candidate): Correct handling of ?: operator. (add_builtin_candidates): Improve documentation. (build_conditional_expr): New function. (can_convert): Implement in terms of can_convert_arg. (ncp_convert): New function. * typeck.c (type_after_usual_arithmetic_conversions): New function, split out from common_type. (composite_pointer_type): New function, split out from build_conditional_expr. (common_type): Use type_after_usual_arithmetic_conversions. Remove redundant attribute merging. (comptypes): Tidy. Handle COMPLEX_TYPE. (build_binary_op_nodefault): Use null_ptr_cst_p. (build_conditional_expr): Remove. (convert_for_assignment): Use new conversion functions. * cp-tree.h (abstract_virtuals_error): Change declaration. * typeck2.c (abstract_virtuals_error): Check to see if an error ocurred, and return a boolean value accordingly. (build_functional_cast): Adjust accordingly. * class.c (finish_struct_1): Likewise. * cvt.c (ocp_convert): Likewise. * decl.c (cp_finish_decl): Likewise. (grokparams): Likewise. (grok_op_properties): Likewise. (start_function): Likewise. * init.c (build_new_1): Likewise. * pt.c (unify): Don't get confused by pointers-to-member functions. * search.c (build_cplus_new): Robustify. From-SVN: r28262
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 50d28ca..4e13392 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1660,7 +1660,24 @@ extern int flag_new_for_scope;
#define INTEGRAL_CODE_P(CODE) \
(CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
-#define ARITHMETIC_TYPE_P(TYPE) (INTEGRAL_TYPE_P (TYPE) || FLOAT_TYPE_P (TYPE))
+
+/* [basic.fundamental]
+
+ Types bool, char, wchar_t, and the signed and unsigned integer types
+ are collectively called integral types.
+
+ Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
+ types as well, which is incorrect in C++. */
+#define CP_INTEGRAL_TYPE_P(TYPE) \
+ (TREE_CODE ((TYPE)) == BOOLEAN_TYPE \
+ || TREE_CODE ((TYPE)) == INTEGER_TYPE)
+
+/* [basic.fundamental]
+
+ Integral and floating types are collectively called arithmetic
+ types. */
+#define ARITHMETIC_TYPE_P(TYPE) \
+ (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
/* Mark which labels are explicitly declared.
These may be shadowed, and may be referenced from nested functions. */
@@ -2767,6 +2784,8 @@ extern tree convert_default_arg PROTO((tree, tree, tree));
extern tree convert_arg_to_ellipsis PROTO((tree));
extern int is_properly_derived_from PROTO((tree, tree));
extern tree initialize_reference PROTO((tree, tree));
+extern tree strip_top_quals PROTO((tree));
+extern tree ncp_convert PROTO((tree, tree));
/* in class.c */
extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int));
@@ -3534,12 +3553,14 @@ extern tree build_ptrmemfunc1 PROTO((tree, tree, tree, tree, t
extern void expand_ptrmemfunc_cst PROTO((tree, tree *, tree *, tree *, tree *));
extern tree delta2_from_ptrmemfunc PROTO((tree));
extern tree pfn_from_ptrmemfunc PROTO((tree));
+extern tree type_after_usual_arithmetic_conversions PROTO((tree, tree));
+extern tree composite_pointer_type PROTO((tree, tree, tree, tree, char*));
/* in typeck2.c */
extern tree error_not_base_type PROTO((tree, tree));
extern tree binfo_or_else PROTO((tree, tree));
extern void readonly_error PROTO((tree, const char *, int));
-extern void abstract_virtuals_error PROTO((tree, tree));
+extern int abstract_virtuals_error PROTO((tree, tree));
extern void signature_error PROTO((tree, tree));
extern void incomplete_type_error PROTO((tree, tree));
extern void my_friendly_abort PROTO((int))