1: TYPE_HAS_USER_CONSTRUCTOR.
2: TYPE_HAS_LATE_RETURN_TYPE (in FUNCTION_TYPE, METHOD_TYPE)
TYPE_PTRMEMFUNC_FLAG (in RECORD_TYPE)
- 3: TYPE_FOR_JAVA.
4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
5: CLASS_TYPE_P (in RECORD_TYPE and UNION_TYPE)
ENUM_FIXED_UNDERLYING_TYPE_P (in ENUMERAL_TYPE)
CPTK_HAS_TRIVIAL_CONSTRUCTOR,
CPTK_HAS_TRIVIAL_COPY,
CPTK_HAS_TRIVIAL_DESTRUCTOR,
+ CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS,
CPTK_HAS_VIRTUAL_DESTRUCTOR,
CPTK_IS_ABSTRACT,
CPTK_IS_BASE_OF,
\f
enum cp_tree_index
{
- CPTI_JAVA_BYTE_TYPE,
- CPTI_JAVA_SHORT_TYPE,
- CPTI_JAVA_INT_TYPE,
- CPTI_JAVA_LONG_TYPE,
- CPTI_JAVA_FLOAT_TYPE,
- CPTI_JAVA_DOUBLE_TYPE,
- CPTI_JAVA_CHAR_TYPE,
- CPTI_JAVA_BOOLEAN_TYPE,
-
CPTI_WCHAR_DECL,
CPTI_VTABLE_ENTRY_TYPE,
CPTI_DELTA_TYPE,
CPTI_LANG_NAME_C,
CPTI_LANG_NAME_CPLUSPLUS,
- CPTI_LANG_NAME_JAVA,
CPTI_EMPTY_EXCEPT_SPEC,
CPTI_NOEXCEPT_TRUE_SPEC,
CPTI_NOEXCEPT_FALSE_SPEC,
- CPTI_JCLASS,
CPTI_TERMINATE,
CPTI_CALL_UNEXPECTED,
CPTI_ATEXIT_FN_PTR_TYPE,
extern GTY(()) tree cp_global_trees[CPTI_MAX];
-#define java_byte_type_node cp_global_trees[CPTI_JAVA_BYTE_TYPE]
-#define java_short_type_node cp_global_trees[CPTI_JAVA_SHORT_TYPE]
-#define java_int_type_node cp_global_trees[CPTI_JAVA_INT_TYPE]
-#define java_long_type_node cp_global_trees[CPTI_JAVA_LONG_TYPE]
-#define java_float_type_node cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
-#define java_double_type_node cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
-#define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
-#define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
-
#define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
#define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
/* The type used to represent an offset by which to adjust the `this'
#define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER]
/* The name of the std namespace. */
#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER]
+/* The name of a C++17 deduction guide. */
#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
-#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA]
/* Exception specifier used for throw(). */
#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
#define noexcept_true_spec cp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC]
#define noexcept_false_spec cp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]
-/* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
-#define jclass_node cp_global_trees[CPTI_JCLASS]
-
/* The declaration for `std::terminate'. */
#define terminate_node cp_global_trees[CPTI_TERMINATE]
#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)]
-enum languages { lang_c, lang_cplusplus, lang_java };
+enum languages { lang_c, lang_cplusplus };
/* Macros to make error reporting functions' lives easier. */
#define TYPE_LINKAGE_IDENTIFIER(NODE) \
#define OVERLOAD_TYPE_P(T) \
(CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
-/* True if this a "Java" type, defined in 'extern "Java"'. */
-#define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3 (NODE)
-
/* True if this type is dependent. This predicate is only valid if
TYPE_DEPENDENT_P_VALID is true. */
#define TYPE_DEPENDENT_P(NODE) TYPE_LANG_FLAG_0 (NODE)
unsigned diamond_shaped : 1;
unsigned repeated_base : 1;
unsigned being_defined : 1;
- unsigned java_interface : 1;
unsigned debug_requested : 1;
unsigned fields_readonly : 1;
+ unsigned ptrmemfunc_flag : 1;
unsigned use_template : 2;
- unsigned ptrmemfunc_flag : 1;
unsigned was_anonymous : 1;
unsigned lazy_default_ctor : 1;
unsigned lazy_copy_ctor : 1;
unsigned lazy_copy_assign : 1;
unsigned lazy_destructor : 1;
-
unsigned has_const_copy_ctor : 1;
+
unsigned has_complex_copy_ctor : 1;
unsigned has_complex_copy_assign : 1;
unsigned non_aggregate : 1;
unsigned has_list_ctor : 1;
unsigned non_std_layout : 1;
unsigned is_literal : 1;
-
unsigned lazy_move_ctor : 1;
+
unsigned lazy_move_assign : 1;
unsigned has_complex_move_ctor : 1;
unsigned has_complex_move_assign : 1;
unsigned has_constexpr_ctor : 1;
+ unsigned unique_obj_representations : 1;
+ unsigned unique_obj_representations_set : 1;
/* When adding a flag here, consider whether or not it ought to
apply to a template instance if it applies to the template. If
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 3;
+ unsigned dummy : 2;
tree primary_base;
vec<tree_pair_s, va_gc> *vcall_indices;
#define CLASSTYPE_ALIGN_UNIT(NODE) \
(CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT)
-/* True if this a Java interface type, declared with
- '__attribute__ ((java_interface))'. */
-#define TYPE_JAVA_INTERFACE(NODE) \
- (LANG_TYPE_CLASS_CHECK (NODE)->java_interface)
-
/* A vec<tree> of virtual functions which cannot be inherited by
derived classes. When deriving from this type, the derived
class must provide its own definition for each of these functions. */
#define CLASSTYPE_NON_STD_LAYOUT(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->non_std_layout)
+/* Nonzero means that this class type does have unique object
+ representations. */
+#define CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS(NODE) \
+ (LANG_TYPE_CLASS_CHECK (NODE)->unique_obj_representations)
+
+/* Nonzero means that this class type has
+ CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS computed. */
+#define CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS_SET(NODE) \
+ (LANG_TYPE_CLASS_CHECK (NODE)->unique_obj_representations_set)
+
/* Nonzero means that this class contains pod types whose default
initialization is not a zero initialization (namely, pointers to
data members). */
struct GTY(()) lang_decl_base {
unsigned selector : 16; /* Larger than necessary for faster access. */
- ENUM_BITFIELD(languages) language : 4;
+ ENUM_BITFIELD(languages) language : 1;
unsigned use_template : 2;
unsigned not_really_extern : 1; /* var or fn */
unsigned initialized_in_class : 1; /* var or fn */
unsigned odr_used : 1; /* var or fn */
unsigned u2sel : 1;
unsigned concept_p : 1; /* applies to vars and functions */
- /* 0 spare bits */
+ unsigned var_declared_inline_p : 1; /* var */
+ /* 2 spare bits */
};
/* True for DECL codes which have template info and access. */
(LANG_DECL_FN_CHECK (NODE)->context = (THUNKS))
/* If NODE, a FUNCTION_DECL, is a C++11 inheriting constructor, then this
- is the base it inherits from. */
-#define DECL_INHERITED_CTOR_BASE(NODE) \
- (DECL_CONSTRUCTOR_P (NODE) ? LANG_DECL_FN_CHECK (NODE)->context : NULL_TREE)
+ is the constructor it inherits from. */
+#define DECL_INHERITED_CTOR(NODE) \
+ (DECL_DECLARES_FUNCTION_P (NODE) && DECL_CONSTRUCTOR_P (NODE) \
+ ? LANG_DECL_FN_CHECK (NODE)->context : NULL_TREE)
+
+/* And this is the base that constructor comes from. */
+#define DECL_INHERITED_CTOR_BASE(NODE) \
+ (DECL_INHERITED_CTOR (NODE) \
+ ? DECL_CONTEXT (flag_new_inheriting_ctors \
+ ? strip_inheriting_ctors (NODE) \
+ : DECL_INHERITED_CTOR (NODE)) \
+ : NULL_TREE)
/* Set the inherited base. */
-#define SET_DECL_INHERITED_CTOR_BASE(NODE,INH) \
+#define SET_DECL_INHERITED_CTOR(NODE,INH) \
(LANG_DECL_FN_CHECK (NODE)->context = (INH))
/* Nonzero if NODE is a thunk, rather than an ordinary function. */
#define CP_DECL_THREADPRIVATE_P(DECL) \
(DECL_LANG_SPECIFIC (VAR_DECL_CHECK (DECL))->u.base.threadprivate_or_deleted_p)
+/* Nonzero if NODE is a VAR_DECL which has been declared inline. */
+#define DECL_VAR_DECLARED_INLINE_P(NODE) \
+ (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE)) \
+ ? DECL_LANG_SPECIFIC (NODE)->u.base.var_declared_inline_p \
+ : false)
+#define SET_DECL_VAR_DECLARED_INLINE_P(NODE) \
+ (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.var_declared_inline_p \
+ = true)
+
+/* Nonzero if NODE is an inline VAR_DECL. In C++17, static data members
+ declared with constexpr specifier are implicitly inline variables. */
+#define DECL_INLINE_VAR_P(NODE) \
+ (DECL_VAR_DECLARED_INLINE_P (NODE) \
+ || (cxx_dialect >= cxx1z \
+ && DECL_DECLARED_CONSTEXPR_P (NODE) \
+ && DECL_CLASS_SCOPE_P (NODE)))
+
/* Nonzero if DECL was declared with '= delete'. */
#define DECL_DELETED_FN(DECL) \
(LANG_DECL_FN_CHECK (DECL)->min.base.threadprivate_or_deleted_p)
for calls in decltype (5.2.2/11). */
tf_partial = 1 << 8, /* Doing initial explicit argument
substitution in fn_type_unification. */
+ tf_fndecl_type = 1 << 9, /* Substituting the type of a function
+ declaration. */
/* Convenient substitution flags combinations. */
tf_warning_or_error = tf_warning | tf_error
};
extern bool defer_mangling_aliases;
+/* True if noexcept is part of the type (i.e. in C++17). */
+
+extern bool flag_noexcept_type;
+
/* A list of namespace-scope objects which have constructors or
destructors which reside in the global scope. The decl is stored
in the TREE_VALUE slot and the initializer is stored in the
#define TEMPLATE_TYPE_PARAMETER_PACK(NODE) \
(TEMPLATE_PARM_PARAMETER_PACK (TEMPLATE_TYPE_PARM_INDEX (NODE)))
+/* For a C++17 class deduction placeholder, the template it represents. */
+#define CLASS_PLACEHOLDER_TEMPLATE(NODE) \
+ (DECL_INITIAL (TYPE_NAME (TEMPLATE_TYPE_PARM_CHECK (NODE))))
+
/* Contexts in which auto deduction occurs. These flags are
used to control diagnostics in do_auto_deduction. */
e.g "int f(void)". */
extern cp_parameter_declarator *no_parameters;
-/* True if we saw "#pragma GCC java_exceptions". */
-extern bool pragma_java_exceptions;
-
/* in call.c */
extern bool check_dtor_name (tree, tree);
int magic_varargs_p (tree);
extern void resort_type_method_vec (void *, void *,
gt_pointer_operator, void *);
extern bool add_method (tree, tree, tree);
+extern tree declared_access (tree);
extern tree currently_open_class (tree);
extern tree currently_open_derived_class (tree);
extern tree outermost_open_class (void);
extern tree perform_qualification_conversions (tree, tree);
extern bool tx_safe_fn_type_p (tree);
extern tree tx_unsafe_fn_variant (tree);
-extern bool can_convert_tx_safety (tree, tree);
+extern bool fnptr_conv_p (tree, tree);
+extern tree strip_fnptr_conv (tree);
/* in name-lookup.c */
extern tree pushdecl (tree);
extern int walk_namespaces (walk_namespaces_fn,
void *);
extern int wrapup_globals_for_namespace (tree, void *);
+extern int diagnose_inline_vars_for_namespace (tree, void *);
extern tree create_implicit_typedef (tree, tree);
extern int local_variable_p (const_tree);
extern tree register_dtor_fn (tree);
extern void warn_extern_redeclared_static (tree, tree);
extern tree cxx_comdat_group (tree);
extern bool cp_missing_noreturn_ok_p (tree);
+extern bool is_direct_enum_init (tree, tree);
extern void initialize_artificial_var (tree, vec<constructor_elt, va_gc> *);
extern tree check_var_type (tree, tree);
extern tree reshape_init (tree, tree, tsubst_flags_t);
/* in decl2.c */
extern void note_mangling_alias (tree, tree);
extern void generate_mangling_aliases (void);
-extern bool check_java_method (tree);
extern tree build_memfn_type (tree, tree, cp_cv_quals, cp_ref_qualifier);
extern tree build_pointer_ptrmemfn_type (tree);
extern tree change_return_type (tree, tree);
tsubst_flags_t);
extern tree throw_bad_array_new_length (void);
extern bool type_has_new_extended_alignment (tree);
+extern unsigned malloc_alignment (void);
extern tree build_new (vec<tree, va_gc> **, tree, tree,
vec<tree, va_gc> **, int,
tsubst_flags_t);
tsubst_flags_t);
extern tree create_temporary_var (tree);
extern void initialize_vtbl_ptrs (tree);
-extern tree build_java_class_ref (tree);
extern tree scalar_constant_value (tree);
extern tree decl_really_constant_value (tree);
extern int diagnose_uninitialized_cst_or_ref_member (tree, bool, bool);
extern tree get_copy_assign (tree);
extern tree get_default_ctor (tree);
extern tree get_dtor (tree, tsubst_flags_t);
-extern tree get_inherited_ctor (tree);
+extern tree strip_inheriting_ctors (tree);
+extern tree inherited_ctor_binfo (tree);
+extern bool ctor_omit_inherited_parms (tree);
extern tree locate_ctor (tree);
extern tree implicitly_declare_fn (special_function_kind, tree,
bool, tree, tree);
extern void check_template_variable (tree);
extern tree make_auto (void);
extern tree make_decltype_auto (void);
+extern tree make_template_placeholder (tree);
extern tree do_auto_deduction (tree, tree, tree);
extern tree do_auto_deduction (tree, tree, tree,
tsubst_flags_t,
extern tree retrieve_local_specialization (tree);
extern tree extract_fnparm_pack (tree, tree *);
extern tree template_parm_to_arg (tree);
+extern tree dguide_name (tree);
+extern bool dguide_name_p (tree);
+extern bool deduction_guide_p (tree);
/* in repo.c */
extern void init_repo (void);
extern tree finish_return_stmt (tree);
extern tree begin_for_scope (tree *);
extern tree begin_for_stmt (tree, tree);
-extern void finish_for_init_stmt (tree);
+extern void finish_init_stmt (tree);
extern void finish_for_cond (tree, tree, bool);
extern void finish_for_expr (tree, tree);
extern void finish_for_stmt (tree);
extern void maybe_add_lambda_conv_op (tree);
extern bool is_lambda_ignored_entity (tree);
extern bool lambda_static_thunk_p (tree);
+extern tree finish_builtin_launder (location_t, tree,
+ tsubst_flags_t);
/* in tree.c */
extern int cp_tree_operand_length (const_tree);
extern bool std_layout_type_p (const_tree);
extern bool trivial_type_p (const_tree);
extern bool trivially_copyable_p (const_tree);
+extern bool type_has_unique_obj_representations (const_tree);
extern bool scalarish_type_p (const_tree);
extern bool type_has_nontrivial_default_init (const_tree);
extern bool type_has_nontrivial_copy_init (const_tree);
extern tree ovl_scope (tree);
extern const char *cxx_printable_name (tree, int);
extern const char *cxx_printable_name_translate (tree, int);
+extern tree canonical_eh_spec (tree);
extern tree build_exception_variant (tree, tree);
extern tree bind_template_template_parm (tree, tree);
extern tree array_type_nelts_total (tree);
extern tree complete_type_or_else (tree, tree);
extern tree complete_type_or_maybe_complain (tree, tree, tsubst_flags_t);
extern int type_unknown_p (const_tree);
-enum { ce_derived, ce_normal, ce_exact };
+enum { ce_derived, ce_type, ce_normal, ce_exact };
extern bool comp_except_specs (const_tree, const_tree, int);
extern bool comptypes (tree, tree, int);
extern bool same_type_ignoring_top_level_qualifiers_p (tree, tree);
extern tree build_x_unary_op (location_t,
enum tree_code, cp_expr,
tsubst_flags_t);
+extern tree cp_build_addressof (location_t, tree,
+ tsubst_flags_t);
extern tree cp_build_addr_expr (tree, tsubst_flags_t);
extern tree cp_build_unary_op (enum tree_code, tree, bool,
tsubst_flags_t);