Mercurial > hg > CbC > CbC_gcc
comparison gcc/cp/cp-tree.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Definitions for C++ parsing and type checking. | 1 /* Definitions for C++ parsing and type checking. |
2 Copyright (C) 1987-2017 Free Software Foundation, Inc. | 2 Copyright (C) 1987-2018 Free Software Foundation, Inc. |
3 Contributed by Michael Tiemann (tiemann@cygnus.com) | 3 Contributed by Michael Tiemann (tiemann@cygnus.com) |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify | 7 GCC is free software; you can redistribute it and/or modify |
45 | 45 |
46 The location is redundant for node kinds that have locations, | 46 The location is redundant for node kinds that have locations, |
47 but not all node kinds do (e.g. constants, and references to | 47 but not all node kinds do (e.g. constants, and references to |
48 params, locals, etc), so we stash a copy here. */ | 48 params, locals, etc), so we stash a copy here. */ |
49 | 49 |
50 extern location_t cp_expr_location (const_tree); | |
51 | |
50 class cp_expr | 52 class cp_expr |
51 { | 53 { |
52 public: | 54 public: |
53 cp_expr () : | 55 cp_expr () : |
54 m_value (NULL), m_loc (UNKNOWN_LOCATION) {} | 56 m_value (NULL), m_loc (UNKNOWN_LOCATION) {} |
55 | 57 |
56 cp_expr (tree value) : | 58 cp_expr (tree value) : |
57 m_value (value), m_loc (EXPR_LOCATION (m_value)) {} | 59 m_value (value), m_loc (cp_expr_location (m_value)) {} |
58 | 60 |
59 cp_expr (tree value, location_t loc): | 61 cp_expr (tree value, location_t loc): |
60 m_value (value), m_loc (loc) {} | 62 m_value (value), m_loc (loc) {} |
61 | |
62 cp_expr (const cp_expr &other) : | |
63 m_value (other.m_value), m_loc (other.m_loc) {} | |
64 | 63 |
65 /* Implicit conversions to tree. */ | 64 /* Implicit conversions to tree. */ |
66 operator tree () const { return m_value; } | 65 operator tree () const { return m_value; } |
67 tree & operator* () { return m_value; } | 66 tree & operator* () { return m_value; } |
68 tree operator* () const { return m_value; } | 67 tree operator* () const { return m_value; } |
89 } | 88 } |
90 | 89 |
91 void set_range (location_t start, location_t finish) | 90 void set_range (location_t start, location_t finish) |
92 { | 91 { |
93 set_location (make_location (m_loc, start, finish)); | 92 set_location (make_location (m_loc, start, finish)); |
93 } | |
94 | |
95 cp_expr& maybe_add_location_wrapper () | |
96 { | |
97 m_value = maybe_wrap_with_location (m_value, m_loc); | |
98 return *this; | |
94 } | 99 } |
95 | 100 |
96 private: | 101 private: |
97 tree m_value; | 102 tree m_value; |
98 location_t m_loc; | 103 location_t m_loc; |
147 CPTI_STD_IDENTIFIER, | 152 CPTI_STD_IDENTIFIER, |
148 CPTI_ANON_IDENTIFIER, | 153 CPTI_ANON_IDENTIFIER, |
149 CPTI_AUTO_IDENTIFIER, | 154 CPTI_AUTO_IDENTIFIER, |
150 CPTI_DECLTYPE_AUTO_IDENTIFIER, | 155 CPTI_DECLTYPE_AUTO_IDENTIFIER, |
151 CPTI_INIT_LIST_IDENTIFIER, | 156 CPTI_INIT_LIST_IDENTIFIER, |
157 CPTI_FOR_RANGE__IDENTIFIER, | |
158 CPTI_FOR_BEGIN__IDENTIFIER, | |
159 CPTI_FOR_END__IDENTIFIER, | |
160 CPTI_FOR_RANGE_IDENTIFIER, | |
161 CPTI_FOR_BEGIN_IDENTIFIER, | |
162 CPTI_FOR_END_IDENTIFIER, | |
163 CPTI_ABI_TAG_IDENTIFIER, | |
164 CPTI_ALIGNED_IDENTIFIER, | |
165 CPTI_BEGIN_IDENTIFIER, | |
166 CPTI_END_IDENTIFIER, | |
167 CPTI_GET_IDENTIFIER, | |
168 CPTI_GNU_IDENTIFIER, | |
169 CPTI_TUPLE_ELEMENT_IDENTIFIER, | |
170 CPTI_TUPLE_SIZE_IDENTIFIER, | |
171 CPTI_TYPE_IDENTIFIER, | |
172 CPTI_VALUE_IDENTIFIER, | |
173 CPTI_FUN_IDENTIFIER, | |
174 CPTI_CLOSURE_IDENTIFIER, | |
152 | 175 |
153 CPTI_LANG_NAME_C, | 176 CPTI_LANG_NAME_C, |
154 CPTI_LANG_NAME_CPLUSPLUS, | 177 CPTI_LANG_NAME_CPLUSPLUS, |
155 | 178 |
156 CPTI_EMPTY_EXCEPT_SPEC, | 179 CPTI_EMPTY_EXCEPT_SPEC, |
215 For identifiers for functions, including special member functions such | 238 For identifiers for functions, including special member functions such |
216 as ctors and assignment operators, the nodes can be used (among other | 239 as ctors and assignment operators, the nodes can be used (among other |
217 things) to iterate over their overloads defined by/for a type. For | 240 things) to iterate over their overloads defined by/for a type. For |
218 example: | 241 example: |
219 | 242 |
220 tree ovlid = cp_assignment_operator_id (NOP_EXPR); | 243 tree ovlid = assign_op_identifier; |
221 tree overloads = get_class_binding (type, ovlid); | 244 tree overloads = get_class_binding (type, ovlid); |
222 for (ovl_iterator it (overloads); it; ++it) { ... } | 245 for (ovl_iterator it (overloads); it; ++it) { ... } |
223 | 246 |
224 iterates over the set of implicitly and explicitly defined overloads | 247 iterates over the set of implicitly and explicitly defined overloads |
225 of the assignment operator for type (including the copy and move | 248 of the assignment operator for type (including the copy and move |
242 classes. */ | 265 classes. */ |
243 #define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER] | 266 #define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER] |
244 /* The name of a destructor that destroys virtual base classes, and | 267 /* The name of a destructor that destroys virtual base classes, and |
245 then deletes the entire object. */ | 268 then deletes the entire object. */ |
246 #define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] | 269 #define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] |
270 | |
271 #define ovl_op_identifier(ISASS, CODE) (OVL_OP_INFO(ISASS, CODE)->identifier) | |
272 #define assign_op_identifier (ovl_op_info[true][OVL_OP_NOP_EXPR].identifier) | |
273 #define call_op_identifier (ovl_op_info[false][OVL_OP_CALL_EXPR].identifier) | |
247 /* The name used for conversion operators -- but note that actual | 274 /* The name used for conversion operators -- but note that actual |
248 conversion functions use special identifiers outside the identifier | 275 conversion functions use special identifiers outside the identifier |
249 table. */ | 276 table. */ |
250 #define conv_op_identifier cp_global_trees[CPTI_CONV_OP_IDENTIFIER] | 277 #define conv_op_identifier cp_global_trees[CPTI_CONV_OP_IDENTIFIER] |
251 | |
252 /* The name of the identifier used internally to represent operator CODE. */ | |
253 #define cp_operator_id(CODE) \ | |
254 (operator_name_info[(int) (CODE)].identifier) | |
255 | |
256 /* The name of the identifier used to represent assignment operator CODE, | |
257 both simple (i.e., operator= with CODE == NOP_EXPR) and compound (e.g., | |
258 operator+= with CODE == PLUS_EXPR). Includes copy and move assignment. | |
259 Use copy_fn_p() to test specifically for copy assignment. */ | |
260 #define cp_assignment_operator_id(CODE) \ | |
261 (assignment_operator_name_info[(int) (CODE)].identifier) | |
262 | 278 |
263 #define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER] | 279 #define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER] |
264 #define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER] | 280 #define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER] |
265 /* The name of the parameter that contains a pointer to the VTT to use | 281 /* The name of the parameter that contains a pointer to the VTT to use |
266 for this subobject constructor or destructor. */ | 282 for this subobject constructor or destructor. */ |
274 #define anon_identifier cp_global_trees[CPTI_ANON_IDENTIFIER] | 290 #define anon_identifier cp_global_trees[CPTI_ANON_IDENTIFIER] |
275 /* auto and declspec(auto) identifiers. */ | 291 /* auto and declspec(auto) identifiers. */ |
276 #define auto_identifier cp_global_trees[CPTI_AUTO_IDENTIFIER] | 292 #define auto_identifier cp_global_trees[CPTI_AUTO_IDENTIFIER] |
277 #define decltype_auto_identifier cp_global_trees[CPTI_DECLTYPE_AUTO_IDENTIFIER] | 293 #define decltype_auto_identifier cp_global_trees[CPTI_DECLTYPE_AUTO_IDENTIFIER] |
278 #define init_list_identifier cp_global_trees[CPTI_INIT_LIST_IDENTIFIER] | 294 #define init_list_identifier cp_global_trees[CPTI_INIT_LIST_IDENTIFIER] |
295 #define for_range__identifier cp_global_trees[CPTI_FOR_RANGE__IDENTIFIER] | |
296 #define for_begin__identifier cp_global_trees[CPTI_FOR_BEGIN__IDENTIFIER] | |
297 #define for_end__identifier cp_global_trees[CPTI_FOR_END__IDENTIFIER] | |
298 #define for_range_identifier cp_global_trees[CPTI_FOR_RANGE_IDENTIFIER] | |
299 #define for_begin_identifier cp_global_trees[CPTI_FOR_BEGIN_IDENTIFIER] | |
300 #define for_end_identifier cp_global_trees[CPTI_FOR_END_IDENTIFIER] | |
301 #define abi_tag_identifier cp_global_trees[CPTI_ABI_TAG_IDENTIFIER] | |
302 #define aligned_identifier cp_global_trees[CPTI_ALIGNED_IDENTIFIER] | |
303 #define begin_identifier cp_global_trees[CPTI_BEGIN_IDENTIFIER] | |
304 #define end_identifier cp_global_trees[CPTI_END_IDENTIFIER] | |
305 #define get__identifier cp_global_trees[CPTI_GET_IDENTIFIER] | |
306 #define gnu_identifier cp_global_trees[CPTI_GNU_IDENTIFIER] | |
307 #define tuple_element_identifier cp_global_trees[CPTI_TUPLE_ELEMENT_IDENTIFIER] | |
308 #define tuple_size_identifier cp_global_trees[CPTI_TUPLE_SIZE_IDENTIFIER] | |
309 #define type_identifier cp_global_trees[CPTI_TYPE_IDENTIFIER] | |
310 #define value_identifier cp_global_trees[CPTI_VALUE_IDENTIFIER] | |
311 #define fun_identifier cp_global_trees[CPTI_FUN_IDENTIFIER] | |
312 #define closure_identifier cp_global_trees[CPTI_CLOSURE_IDENTIFIER] | |
279 #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] | 313 #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] |
280 #define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] | 314 #define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] |
281 | 315 |
282 /* Exception specifiers used for throw(), noexcept(true), | 316 /* Exception specifiers used for throw(), noexcept(true), |
283 noexcept(false) and deferred noexcept. We rely on these being | 317 noexcept(false) and deferred noexcept. We rely on these being |
351 BASELINK_QUALIFIED_P (in BASELINK) | 385 BASELINK_QUALIFIED_P (in BASELINK) |
352 TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) | 386 TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) |
353 TEMPLATE_PARM_PARAMETER_PACK (in TEMPLATE_PARM_INDEX) | 387 TEMPLATE_PARM_PARAMETER_PACK (in TEMPLATE_PARM_INDEX) |
354 ATTR_IS_DEPENDENT (in the TREE_LIST for an attribute) | 388 ATTR_IS_DEPENDENT (in the TREE_LIST for an attribute) |
355 ABI_TAG_IMPLICIT (in the TREE_LIST for the argument of abi_tag) | 389 ABI_TAG_IMPLICIT (in the TREE_LIST for the argument of abi_tag) |
390 LAMBDA_CAPTURE_EXPLICIT_P (in a TREE_LIST in LAMBDA_EXPR_CAPTURE_LIST) | |
356 CONSTRUCTOR_IS_DIRECT_INIT (in CONSTRUCTOR) | 391 CONSTRUCTOR_IS_DIRECT_INIT (in CONSTRUCTOR) |
357 LAMBDA_EXPR_CAPTURES_THIS_P (in LAMBDA_EXPR) | 392 LAMBDA_EXPR_CAPTURES_THIS_P (in LAMBDA_EXPR) |
358 DECLTYPE_FOR_LAMBDA_CAPTURE (in DECLTYPE_TYPE) | 393 DECLTYPE_FOR_LAMBDA_CAPTURE (in DECLTYPE_TYPE) |
359 VEC_INIT_EXPR_IS_CONSTEXPR (in VEC_INIT_EXPR) | 394 VEC_INIT_EXPR_IS_CONSTEXPR (in VEC_INIT_EXPR) |
360 DECL_OVERRIDE_P (in FUNCTION_DECL) | 395 DECL_OVERRIDE_P (in FUNCTION_DECL) |
369 BLOCK_OUTER_CURLY_BRACE_P (in BLOCK) | 404 BLOCK_OUTER_CURLY_BRACE_P (in BLOCK) |
370 FOLD_EXPR_MODOP_P (*_FOLD_EXPR) | 405 FOLD_EXPR_MODOP_P (*_FOLD_EXPR) |
371 IF_STMT_CONSTEXPR_P (IF_STMT) | 406 IF_STMT_CONSTEXPR_P (IF_STMT) |
372 TEMPLATE_TYPE_PARM_FOR_CLASS (TEMPLATE_TYPE_PARM) | 407 TEMPLATE_TYPE_PARM_FOR_CLASS (TEMPLATE_TYPE_PARM) |
373 DECL_NAMESPACE_INLINE_P (in NAMESPACE_DECL) | 408 DECL_NAMESPACE_INLINE_P (in NAMESPACE_DECL) |
409 SWITCH_STMT_ALL_CASES_P (in SWITCH_STMT) | |
410 REINTERPRET_CAST_P (in NOP_EXPR) | |
411 ALIGNOF_EXPR_STD_P (in ALIGNOF_EXPR) | |
374 1: IDENTIFIER_KIND_BIT_1 (in IDENTIFIER_NODE) | 412 1: IDENTIFIER_KIND_BIT_1 (in IDENTIFIER_NODE) |
375 TI_PENDING_TEMPLATE_FLAG. | 413 TI_PENDING_TEMPLATE_FLAG. |
376 TEMPLATE_PARMS_FOR_INLINE. | 414 TEMPLATE_PARMS_FOR_INLINE. |
377 DELETE_EXPR_USE_VEC (in DELETE_EXPR). | 415 DELETE_EXPR_USE_VEC (in DELETE_EXPR). |
378 (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out). | 416 (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out). |
383 TARGET_EXPR_LIST_INIT_P (in TARGET_EXPR) | 421 TARGET_EXPR_LIST_INIT_P (in TARGET_EXPR) |
384 LAMBDA_EXPR_MUTABLE_P (in LAMBDA_EXPR) | 422 LAMBDA_EXPR_MUTABLE_P (in LAMBDA_EXPR) |
385 DECL_FINAL_P (in FUNCTION_DECL) | 423 DECL_FINAL_P (in FUNCTION_DECL) |
386 QUALIFIED_NAME_IS_TEMPLATE (in SCOPE_REF) | 424 QUALIFIED_NAME_IS_TEMPLATE (in SCOPE_REF) |
387 DECLTYPE_FOR_INIT_CAPTURE (in DECLTYPE_TYPE) | 425 DECLTYPE_FOR_INIT_CAPTURE (in DECLTYPE_TYPE) |
388 CONSTRUCTOR_NO_IMPLICIT_ZERO (in CONSTRUCTOR) | |
389 TINFO_USED_TEMPLATE_ID (in TEMPLATE_INFO) | 426 TINFO_USED_TEMPLATE_ID (in TEMPLATE_INFO) |
390 PACK_EXPANSION_SIZEOF_P (in *_PACK_EXPANSION) | 427 PACK_EXPANSION_SIZEOF_P (in *_PACK_EXPANSION) |
391 OVL_USING_P (in OVERLOAD) | 428 OVL_USING_P (in OVERLOAD) |
429 IMPLICIT_CONV_EXPR_NONTYPE_ARG (in IMPLICIT_CONV_EXPR) | |
392 2: IDENTIFIER_KIND_BIT_2 (in IDENTIFIER_NODE) | 430 2: IDENTIFIER_KIND_BIT_2 (in IDENTIFIER_NODE) |
393 ICS_THIS_FLAG (in _CONV) | 431 ICS_THIS_FLAG (in _CONV) |
394 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL) | 432 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL) |
395 STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST) | 433 STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST) |
396 TYPENAME_IS_RESOLVING_P (in TYPE_NAME_TYPE) | 434 TYPENAME_IS_RESOLVING_P (in TYPE_NAME_TYPE) |
397 TARGET_EXPR_DIRECT_INIT_P (in TARGET_EXPR) | 435 TARGET_EXPR_DIRECT_INIT_P (in TARGET_EXPR) |
398 FNDECL_USED_AUTO (in FUNCTION_DECL) | 436 FNDECL_USED_AUTO (in FUNCTION_DECL) |
399 DECLTYPE_FOR_LAMBDA_PROXY (in DECLTYPE_TYPE) | 437 DECLTYPE_FOR_LAMBDA_PROXY (in DECLTYPE_TYPE) |
400 REF_PARENTHESIZED_P (in COMPONENT_REF, INDIRECT_REF, SCOPE_REF) | 438 REF_PARENTHESIZED_P (in COMPONENT_REF, INDIRECT_REF, SCOPE_REF, VIEW_CONVERT_EXPR) |
401 AGGR_INIT_ZERO_FIRST (in AGGR_INIT_EXPR) | 439 AGGR_INIT_ZERO_FIRST (in AGGR_INIT_EXPR) |
402 CONSTRUCTOR_MUTABLE_POISON (in CONSTRUCTOR) | 440 CONSTRUCTOR_MUTABLE_POISON (in CONSTRUCTOR) |
403 OVL_HIDDEN_P (in OVERLOAD) | 441 OVL_HIDDEN_P (in OVERLOAD) |
442 SWITCH_STMT_NO_BREAK_P (in SWITCH_STMT) | |
443 LAMBDA_EXPR_CAPTURE_OPTIMIZED (in LAMBDA_EXPR) | |
404 3: (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out). | 444 3: (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out). |
405 ICS_BAD_FLAG (in _CONV) | 445 ICS_BAD_FLAG (in _CONV) |
406 FN_TRY_BLOCK_P (in TRY_BLOCK) | 446 FN_TRY_BLOCK_P (in TRY_BLOCK) |
407 BIND_EXPR_BODY_BLOCK (in BIND_EXPR) | 447 BIND_EXPR_BODY_BLOCK (in BIND_EXPR) |
408 DECL_NON_TRIVIALLY_INITIALIZED_P (in VAR_DECL) | 448 DECL_NONTRIVIALLY_INITIALIZED_P (in VAR_DECL) |
409 CALL_EXPR_ORDERED_ARGS (in CALL_EXPR, AGGR_INIT_EXPR) | 449 CALL_EXPR_ORDERED_ARGS (in CALL_EXPR, AGGR_INIT_EXPR) |
410 DECLTYPE_FOR_REF_CAPTURE (in DECLTYPE_TYPE) | 450 DECLTYPE_FOR_REF_CAPTURE (in DECLTYPE_TYPE) |
411 CONSTUCTOR_C99_COMPOUND_LITERAL (in CONSTRUCTOR) | 451 CONSTRUCTOR_C99_COMPOUND_LITERAL (in CONSTRUCTOR) |
412 OVL_NESTED_P (in OVERLOAD) | 452 OVL_NESTED_P (in OVERLOAD) |
413 4: IDENTIFIER_MARKED (IDENTIFIER_NODEs) | 453 4: IDENTIFIER_MARKED (IDENTIFIER_NODEs) |
414 TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, | 454 TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, |
415 CALL_EXPR, or FIELD_DECL). | 455 CALL_EXPR, or FIELD_DECL). |
416 DECL_TINFO_P (in VAR_DECL) | 456 DECL_TINFO_P (in VAR_DECL) |
419 LOOKUP_FOUND_P (in RECORD_TYPE, UNION_TYPE, NAMESPACE_DECL) | 459 LOOKUP_FOUND_P (in RECORD_TYPE, UNION_TYPE, NAMESPACE_DECL) |
420 5: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) | 460 5: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) |
421 DECL_VTABLE_OR_VTT_P (in VAR_DECL) | 461 DECL_VTABLE_OR_VTT_P (in VAR_DECL) |
422 FUNCTION_RVALUE_QUALIFIED (in FUNCTION_TYPE, METHOD_TYPE) | 462 FUNCTION_RVALUE_QUALIFIED (in FUNCTION_TYPE, METHOD_TYPE) |
423 CALL_EXPR_REVERSE_ARGS (in CALL_EXPR, AGGR_INIT_EXPR) | 463 CALL_EXPR_REVERSE_ARGS (in CALL_EXPR, AGGR_INIT_EXPR) |
464 CONSTRUCTOR_PLACEHOLDER_BOUNDARY (in CONSTRUCTOR) | |
424 6: IDENTIFIER_REPO_CHOSEN (in IDENTIFIER_NODE) | 465 6: IDENTIFIER_REPO_CHOSEN (in IDENTIFIER_NODE) |
425 DECL_CONSTRUCTION_VTABLE_P (in VAR_DECL) | 466 DECL_CONSTRUCTION_VTABLE_P (in VAR_DECL) |
426 TYPE_MARKED_P (in _TYPE) | 467 TYPE_MARKED_P (in _TYPE) |
427 RANGE_FOR_IVDEP (in RANGE_FOR_STMT) | 468 RANGE_FOR_IVDEP (in RANGE_FOR_STMT) |
428 CALL_EXPR_OPERATOR_SYNTAX (in CALL_EXPR, AGGR_INIT_EXPR) | 469 CALL_EXPR_OPERATOR_SYNTAX (in CALL_EXPR, AGGR_INIT_EXPR) |
438 AUTO_IS_DECLTYPE (in TEMPLATE_TYPE_PARM) | 479 AUTO_IS_DECLTYPE (in TEMPLATE_TYPE_PARM) |
439 REFERENCE_VLA_OK (in REFERENCE_TYPE) | 480 REFERENCE_VLA_OK (in REFERENCE_TYPE) |
440 6: TYPE_DEPENDENT_P_VALID | 481 6: TYPE_DEPENDENT_P_VALID |
441 | 482 |
442 Usage of DECL_LANG_FLAG_?: | 483 Usage of DECL_LANG_FLAG_?: |
443 0: DECL_ERROR_REPORTED (in VAR_DECL). | 484 0: DECL_TEMPLATE_PARM_P (in PARM_DECL, CONST_DECL, TYPE_DECL, or TEMPLATE_DECL) |
444 DECL_TEMPLATE_PARM_P (in PARM_DECL, CONST_DECL, TYPE_DECL, or TEMPLATE_DECL) | |
445 DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL) | 485 DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL) |
446 DECL_MUTABLE_P (in FIELD_DECL) | 486 DECL_MUTABLE_P (in FIELD_DECL) |
447 DECL_DEPENDENT_P (in USING_DECL) | 487 DECL_DEPENDENT_P (in USING_DECL) |
448 LABEL_DECL_BREAK (in LABEL_DECL) | 488 LABEL_DECL_BREAK (in LABEL_DECL) |
449 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL). | 489 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL). |
466 DECL_INVALID_OVERRIDER_P (in a FUNCTION_DECL) | 506 DECL_INVALID_OVERRIDER_P (in a FUNCTION_DECL) |
467 5: DECL_INTERFACE_KNOWN. | 507 5: DECL_INTERFACE_KNOWN. |
468 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL). | 508 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL). |
469 DECL_FIELD_IS_BASE (in FIELD_DECL) | 509 DECL_FIELD_IS_BASE (in FIELD_DECL) |
470 TYPE_DECL_ALIAS_P (in TYPE_DECL) | 510 TYPE_DECL_ALIAS_P (in TYPE_DECL) |
471 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL). | 511 7: DECL_THUNK_P (in a member FUNCTION_DECL) |
472 DECL_THUNK_P (in a member FUNCTION_DECL) | |
473 DECL_NORMAL_CAPTURE_P (in FIELD_DECL) | 512 DECL_NORMAL_CAPTURE_P (in FIELD_DECL) |
474 8: DECL_DECLARED_CONSTEXPR_P (in VAR_DECL, FUNCTION_DECL) | 513 8: DECL_DECLARED_CONSTEXPR_P (in VAR_DECL, FUNCTION_DECL) |
475 | 514 |
476 Usage of language-independent fields in a language-dependent manner: | 515 Usage of language-independent fields in a language-dependent manner: |
477 | 516 |
623 #define STMT_EXPR_NO_SCOPE(NODE) \ | 662 #define STMT_EXPR_NO_SCOPE(NODE) \ |
624 TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE)) | 663 TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE)) |
625 | 664 |
626 #define COND_EXPR_IS_VEC_DELETE(NODE) \ | 665 #define COND_EXPR_IS_VEC_DELETE(NODE) \ |
627 TREE_LANG_FLAG_0 (COND_EXPR_CHECK (NODE)) | 666 TREE_LANG_FLAG_0 (COND_EXPR_CHECK (NODE)) |
667 | |
668 /* Nonzero if this NOP_EXPR is a reinterpret_cast. Such conversions | |
669 are not constexprs. Other NOP_EXPRs are. */ | |
670 #define REINTERPRET_CAST_P(NODE) \ | |
671 TREE_LANG_FLAG_0 (NOP_EXPR_CHECK (NODE)) | |
628 | 672 |
629 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual | 673 /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual |
630 sense of `same'. */ | 674 sense of `same'. */ |
631 #define same_type_p(TYPE1, TYPE2) \ | 675 #define same_type_p(TYPE1, TYPE2) \ |
632 comptypes ((TYPE1), (TYPE2), COMPARE_STRICT) | 676 comptypes ((TYPE1), (TYPE2), COMPARE_STRICT) |
1001 cik_keyword = 1, /* A keyword. */ | 1045 cik_keyword = 1, /* A keyword. */ |
1002 cik_ctor = 2, /* Constructor (in-chg, complete or base). */ | 1046 cik_ctor = 2, /* Constructor (in-chg, complete or base). */ |
1003 cik_dtor = 3, /* Destructor (in-chg, deleting, complete or | 1047 cik_dtor = 3, /* Destructor (in-chg, deleting, complete or |
1004 base). */ | 1048 base). */ |
1005 cik_simple_op = 4, /* Non-assignment operator name. */ | 1049 cik_simple_op = 4, /* Non-assignment operator name. */ |
1006 cik_newdel_op = 5, /* New or delete operator name. */ | 1050 cik_assign_op = 5, /* An assignment operator name. */ |
1007 cik_assign_op = 6, /* An assignment operator name. */ | 1051 cik_conv_op = 6, /* Conversion operator name. */ |
1008 cik_conv_op = 7, /* Conversion operator name. */ | 1052 cik_reserved_for_udlit = 7, /* Not yet in use */ |
1009 cik_max | 1053 cik_max |
1010 }; | 1054 }; |
1011 | 1055 |
1012 /* Kind bits. */ | 1056 /* Kind bits. */ |
1013 #define IDENTIFIER_KIND_BIT_0(NODE) \ | 1057 #define IDENTIFIER_KIND_BIT_0(NODE) \ |
1058 /* True if this identifier is for any operator name (including | 1102 /* True if this identifier is for any operator name (including |
1059 conversions). Value 4, 5, 6 or 7. */ | 1103 conversions). Value 4, 5, 6 or 7. */ |
1060 #define IDENTIFIER_ANY_OP_P(NODE) \ | 1104 #define IDENTIFIER_ANY_OP_P(NODE) \ |
1061 (IDENTIFIER_KIND_BIT_2 (NODE)) | 1105 (IDENTIFIER_KIND_BIT_2 (NODE)) |
1062 | 1106 |
1063 /* True if this identifier is for new or delete operator. Value 5. */ | 1107 /* True if this identifier is for an overloaded operator. Values 4, 5. */ |
1064 #define IDENTIFIER_NEWDEL_OP_P(NODE) \ | 1108 #define IDENTIFIER_OVL_OP_P(NODE) \ |
1065 (IDENTIFIER_KIND_BIT_2 (NODE) \ | 1109 (IDENTIFIER_ANY_OP_P (NODE) \ |
1066 & (!IDENTIFIER_KIND_BIT_1 (NODE)) \ | 1110 & (!IDENTIFIER_KIND_BIT_1 (NODE))) |
1111 | |
1112 /* True if this identifier is for any assignment. Values 5. */ | |
1113 #define IDENTIFIER_ASSIGN_OP_P(NODE) \ | |
1114 (IDENTIFIER_OVL_OP_P (NODE) \ | |
1067 & IDENTIFIER_KIND_BIT_0 (NODE)) | 1115 & IDENTIFIER_KIND_BIT_0 (NODE)) |
1068 | |
1069 /* True if this identifier is for any assignment. Values 6. */ | |
1070 #define IDENTIFIER_ASSIGN_OP_P(NODE) \ | |
1071 (IDENTIFIER_KIND_BIT_2 (NODE) \ | |
1072 & IDENTIFIER_KIND_BIT_1 (NODE) \ | |
1073 & (!IDENTIFIER_KIND_BIT_0 (NODE))) | |
1074 | 1116 |
1075 /* True if this identifier is the name of a type-conversion | 1117 /* True if this identifier is the name of a type-conversion |
1076 operator. Value 7. */ | 1118 operator. Value 7. */ |
1077 #define IDENTIFIER_CONV_OP_P(NODE) \ | 1119 #define IDENTIFIER_CONV_OP_P(NODE) \ |
1078 (IDENTIFIER_KIND_BIT_2 (NODE) \ | 1120 (IDENTIFIER_ANY_OP_P (NODE) \ |
1079 & IDENTIFIER_KIND_BIT_1 (NODE) \ | 1121 & IDENTIFIER_KIND_BIT_1 (NODE) \ |
1080 & IDENTIFIER_KIND_BIT_0 (NODE)) | 1122 & (!IDENTIFIER_KIND_BIT_0 (NODE))) |
1123 | |
1124 /* True if this identifier is a new or delete operator. */ | |
1125 #define IDENTIFIER_NEWDEL_OP_P(NODE) \ | |
1126 (IDENTIFIER_OVL_OP_P (NODE) \ | |
1127 && IDENTIFIER_OVL_OP_FLAGS (NODE) & OVL_OP_FLAG_ALLOC) | |
1128 | |
1129 /* True if this identifier is a new operator. */ | |
1130 #define IDENTIFIER_NEW_OP_P(NODE) \ | |
1131 (IDENTIFIER_OVL_OP_P (NODE) \ | |
1132 && (IDENTIFIER_OVL_OP_FLAGS (NODE) \ | |
1133 & (OVL_OP_FLAG_ALLOC | OVL_OP_FLAG_DELETE)) == OVL_OP_FLAG_ALLOC) | |
1134 | |
1135 /* Access a C++-specific index for identifier NODE. | |
1136 Used to optimize operator mappings etc. */ | |
1137 #define IDENTIFIER_CP_INDEX(NODE) \ | |
1138 (IDENTIFIER_NODE_CHECK(NODE)->base.u.bits.address_space) | |
1081 | 1139 |
1082 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ | 1140 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ |
1083 #define C_TYPE_FIELDS_READONLY(TYPE) \ | 1141 #define C_TYPE_FIELDS_READONLY(TYPE) \ |
1084 (LANG_TYPE_CLASS_CHECK (TYPE)->fields_readonly) | 1142 (LANG_TYPE_CLASS_CHECK (TYPE)->fields_readonly) |
1085 | 1143 |
1201 /* Based off of TYPE_UNNAMED_P. */ | 1259 /* Based off of TYPE_UNNAMED_P. */ |
1202 #define LAMBDA_TYPE_P(NODE) \ | 1260 #define LAMBDA_TYPE_P(NODE) \ |
1203 (CLASS_TYPE_P (NODE) && CLASSTYPE_LAMBDA_EXPR (NODE)) | 1261 (CLASS_TYPE_P (NODE) && CLASSTYPE_LAMBDA_EXPR (NODE)) |
1204 | 1262 |
1205 /* Test if FUNCTION_DECL is a lambda function. */ | 1263 /* Test if FUNCTION_DECL is a lambda function. */ |
1206 #define LAMBDA_FUNCTION_P(FNDECL) \ | 1264 #define LAMBDA_FUNCTION_P(FNDECL) \ |
1207 (DECL_DECLARES_FUNCTION_P (FNDECL) \ | 1265 (DECL_DECLARES_FUNCTION_P (FNDECL) \ |
1208 && DECL_OVERLOADED_OPERATOR_P (FNDECL) == CALL_EXPR \ | 1266 && DECL_OVERLOADED_OPERATOR_P (FNDECL) \ |
1267 && DECL_OVERLOADED_OPERATOR_IS (FNDECL, CALL_EXPR) \ | |
1209 && LAMBDA_TYPE_P (CP_DECL_CONTEXT (FNDECL))) | 1268 && LAMBDA_TYPE_P (CP_DECL_CONTEXT (FNDECL))) |
1210 | 1269 |
1211 enum cp_lambda_default_capture_mode_type { | 1270 enum cp_lambda_default_capture_mode_type { |
1212 CPLD_NONE, | 1271 CPLD_NONE, |
1213 CPLD_COPY, | 1272 CPLD_COPY, |
1238 LAMBDA_EXPR_THIS_CAPTURE(NODE) | 1297 LAMBDA_EXPR_THIS_CAPTURE(NODE) |
1239 | 1298 |
1240 /* Predicate tracking whether the lambda was declared 'mutable'. */ | 1299 /* Predicate tracking whether the lambda was declared 'mutable'. */ |
1241 #define LAMBDA_EXPR_MUTABLE_P(NODE) \ | 1300 #define LAMBDA_EXPR_MUTABLE_P(NODE) \ |
1242 TREE_LANG_FLAG_1 (LAMBDA_EXPR_CHECK (NODE)) | 1301 TREE_LANG_FLAG_1 (LAMBDA_EXPR_CHECK (NODE)) |
1302 | |
1303 /* True iff uses of a const variable capture were optimized away. */ | |
1304 #define LAMBDA_EXPR_CAPTURE_OPTIMIZED(NODE) \ | |
1305 TREE_LANG_FLAG_2 (LAMBDA_EXPR_CHECK (NODE)) | |
1306 | |
1307 /* True if this TREE_LIST in LAMBDA_EXPR_CAPTURE_LIST is for an explicit | |
1308 capture. */ | |
1309 #define LAMBDA_CAPTURE_EXPLICIT_P(NODE) \ | |
1310 TREE_LANG_FLAG_0 (TREE_LIST_CHECK (NODE)) | |
1243 | 1311 |
1244 /* The source location of the lambda. */ | 1312 /* The source location of the lambda. */ |
1245 #define LAMBDA_EXPR_LOCATION(NODE) \ | 1313 #define LAMBDA_EXPR_LOCATION(NODE) \ |
1246 (((struct tree_lambda_expr *)LAMBDA_EXPR_CHECK (NODE))->locus) | 1314 (((struct tree_lambda_expr *)LAMBDA_EXPR_CHECK (NODE))->locus) |
1247 | 1315 |
1626 warning_sentinel(int& flag, bool suppress=true) | 1694 warning_sentinel(int& flag, bool suppress=true) |
1627 : flag(flag), val(flag) { if (suppress) flag = 0; } | 1695 : flag(flag), val(flag) { if (suppress) flag = 0; } |
1628 ~warning_sentinel() { flag = val; } | 1696 ~warning_sentinel() { flag = val; } |
1629 }; | 1697 }; |
1630 | 1698 |
1699 /* RAII sentinel that saves the value of a variable, optionally | |
1700 overrides it right away, and restores its value when the sentinel | |
1701 id destructed. */ | |
1702 | |
1703 template <typename T> | |
1704 class temp_override | |
1705 { | |
1706 T& overridden_variable; | |
1707 T saved_value; | |
1708 public: | |
1709 temp_override(T& var) : overridden_variable (var), saved_value (var) {} | |
1710 temp_override(T& var, T overrider) | |
1711 : overridden_variable (var), saved_value (var) | |
1712 { | |
1713 overridden_variable = overrider; | |
1714 } | |
1715 ~temp_override() { overridden_variable = saved_value; } | |
1716 }; | |
1717 | |
1631 /* The cached class binding level, from the most recently exited | 1718 /* The cached class binding level, from the most recently exited |
1632 class, or NULL if none. */ | 1719 class, or NULL if none. */ |
1633 | 1720 |
1634 #define previous_class_level scope_chain->x_previous_class_level | 1721 #define previous_class_level scope_chain->x_previous_class_level |
1635 | 1722 |
1787 #define current_function_auto_return_pattern \ | 1874 #define current_function_auto_return_pattern \ |
1788 (cp_function_chain->x_auto_return_pattern) | 1875 (cp_function_chain->x_auto_return_pattern) |
1789 | 1876 |
1790 /* In parser.c. */ | 1877 /* In parser.c. */ |
1791 extern tree cp_literal_operator_id (const char *); | 1878 extern tree cp_literal_operator_id (const char *); |
1879 | |
1880 #define NON_ERROR(NODE) ((NODE) == error_mark_node ? NULL_TREE : (NODE)) | |
1792 | 1881 |
1793 /* TRUE if a tree code represents a statement. */ | 1882 /* TRUE if a tree code represents a statement. */ |
1794 extern bool statement_code_p[MAX_TREE_CODES]; | 1883 extern bool statement_code_p[MAX_TREE_CODES]; |
1795 | 1884 |
1796 #define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)] | 1885 #define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)] |
2436 unsigned unknown_bound_p : 1; /* var */ | 2525 unsigned unknown_bound_p : 1; /* var */ |
2437 unsigned odr_used : 1; /* var or fn */ | 2526 unsigned odr_used : 1; /* var or fn */ |
2438 unsigned u2sel : 1; | 2527 unsigned u2sel : 1; |
2439 unsigned concept_p : 1; /* applies to vars and functions */ | 2528 unsigned concept_p : 1; /* applies to vars and functions */ |
2440 unsigned var_declared_inline_p : 1; /* var */ | 2529 unsigned var_declared_inline_p : 1; /* var */ |
2441 /* 2 spare bits */ | 2530 unsigned dependent_init_p : 1; /* var */ |
2531 /* 1 spare bit */ | |
2442 }; | 2532 }; |
2443 | 2533 |
2444 /* True for DECL codes which have template info and access. */ | 2534 /* True for DECL codes which have template info and access. */ |
2445 #define LANG_DECL_HAS_MIN(NODE) \ | 2535 #define LANG_DECL_HAS_MIN(NODE) \ |
2446 (VAR_OR_FUNCTION_DECL_P (NODE) \ | 2536 (VAR_OR_FUNCTION_DECL_P (NODE) \ |
2478 /* Additional DECL_LANG_SPECIFIC information for functions. */ | 2568 /* Additional DECL_LANG_SPECIFIC information for functions. */ |
2479 | 2569 |
2480 struct GTY(()) lang_decl_fn { | 2570 struct GTY(()) lang_decl_fn { |
2481 struct lang_decl_min min; | 2571 struct lang_decl_min min; |
2482 | 2572 |
2483 /* In an overloaded operator, this is the value of | 2573 /* In a overloaded operator, this is the compressed operator code. */ |
2484 DECL_OVERLOADED_OPERATOR_P. | 2574 unsigned ovl_op_code : 6; |
2485 FIXME: We should really do better in compressing this. */ | |
2486 ENUM_BITFIELD (tree_code) operator_code : 16; | |
2487 | |
2488 unsigned global_ctor_p : 1; | 2575 unsigned global_ctor_p : 1; |
2489 unsigned global_dtor_p : 1; | 2576 unsigned global_dtor_p : 1; |
2577 | |
2490 unsigned static_function : 1; | 2578 unsigned static_function : 1; |
2491 unsigned pure_virtual : 1; | 2579 unsigned pure_virtual : 1; |
2492 unsigned defaulted_p : 1; | 2580 unsigned defaulted_p : 1; |
2493 unsigned has_in_charge_parm_p : 1; | 2581 unsigned has_in_charge_parm_p : 1; |
2494 unsigned has_vtt_parm_p : 1; | 2582 unsigned has_vtt_parm_p : 1; |
2495 unsigned pending_inline_p : 1; | 2583 unsigned pending_inline_p : 1; |
2496 | |
2497 unsigned nonconverting : 1; | 2584 unsigned nonconverting : 1; |
2498 unsigned thunk_p : 1; | 2585 unsigned thunk_p : 1; |
2586 | |
2499 unsigned this_thunk_p : 1; | 2587 unsigned this_thunk_p : 1; |
2500 unsigned hidden_friend_p : 1; | 2588 unsigned hidden_friend_p : 1; |
2501 unsigned omp_declare_reduction_p : 1; | 2589 unsigned omp_declare_reduction_p : 1; |
2502 /* 3 spare bits. */ | 2590 unsigned spare : 13; |
2503 | 2591 |
2504 /* 32-bits padding on 64-bit host. */ | 2592 /* 32-bits padding on 64-bit host. */ |
2505 | 2593 |
2506 /* For a non-thunk function decl, this is a tree list of | 2594 /* For a non-thunk function decl, this is a tree list of |
2507 friendly classes. For a thunk function decl, it is the | 2595 friendly classes. For a thunk function decl, it is the |
2677 (DECL_LANG_SPECIFIC (NODE)->u.base.language = (LANGUAGE)) | 2765 (DECL_LANG_SPECIFIC (NODE)->u.base.language = (LANGUAGE)) |
2678 | 2766 |
2679 /* For FUNCTION_DECLs and TEMPLATE_DECLs: nonzero means that this function | 2767 /* For FUNCTION_DECLs and TEMPLATE_DECLs: nonzero means that this function |
2680 is a constructor. */ | 2768 is a constructor. */ |
2681 #define DECL_CONSTRUCTOR_P(NODE) \ | 2769 #define DECL_CONSTRUCTOR_P(NODE) \ |
2682 IDENTIFIER_CTOR_P (DECL_NAME (NODE)) | 2770 DECL_CXX_CONSTRUCTOR_P (STRIP_TEMPLATE (NODE)) |
2683 | 2771 |
2684 /* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete | 2772 /* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete |
2685 object. */ | 2773 object. */ |
2686 #define DECL_COMPLETE_CONSTRUCTOR_P(NODE) \ | 2774 #define DECL_COMPLETE_CONSTRUCTOR_P(NODE) \ |
2687 (DECL_NAME (NODE) == complete_ctor_identifier) | 2775 (DECL_NAME (NODE) == complete_ctor_identifier) |
2706 (DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE)) | 2794 (DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE)) |
2707 | 2795 |
2708 /* Nonzero if NODE (a FUNCTION_DECL or TEMPLATE_DECL) | 2796 /* Nonzero if NODE (a FUNCTION_DECL or TEMPLATE_DECL) |
2709 is a destructor. */ | 2797 is a destructor. */ |
2710 #define DECL_DESTRUCTOR_P(NODE) \ | 2798 #define DECL_DESTRUCTOR_P(NODE) \ |
2711 IDENTIFIER_DTOR_P (DECL_NAME (NODE)) | 2799 DECL_CXX_DESTRUCTOR_P (STRIP_TEMPLATE (NODE)) |
2712 | 2800 |
2713 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the | 2801 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the |
2714 specialized in-charge constructor, in-charge deleting constructor, | 2802 specialized in-charge constructor, in-charge deleting constructor, |
2715 or the base destructor. */ | 2803 or the base destructor. */ |
2716 #define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE) \ | 2804 #define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE) \ |
2729 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete | 2817 /* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete |
2730 object that deletes the object after it has been destroyed. */ | 2818 object that deletes the object after it has been destroyed. */ |
2731 #define DECL_DELETING_DESTRUCTOR_P(NODE) \ | 2819 #define DECL_DELETING_DESTRUCTOR_P(NODE) \ |
2732 (DECL_NAME (NODE) == deleting_dtor_identifier) | 2820 (DECL_NAME (NODE) == deleting_dtor_identifier) |
2733 | 2821 |
2822 /* Nonzero if either DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P or | |
2823 DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P is true of NODE. */ | |
2824 #define DECL_MAYBE_IN_CHARGE_CDTOR_P(NODE) \ | |
2825 (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (NODE) \ | |
2826 || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (NODE)) | |
2827 | |
2734 /* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or | 2828 /* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or |
2735 destructor. */ | 2829 destructor. */ |
2736 #define DECL_CLONED_FUNCTION_P(NODE) (!!decl_cloned_function_p (NODE, true)) | 2830 #define DECL_CLONED_FUNCTION_P(NODE) (!!decl_cloned_function_p (NODE, true)) |
2737 | 2831 |
2738 /* If DECL_CLONED_FUNCTION_P holds, this is the function that was | 2832 /* If DECL_CLONED_FUNCTION_P holds, this is the function that was |
2746 { ... } | 2840 { ... } |
2747 | 2841 |
2748 */ | 2842 */ |
2749 #define FOR_EACH_CLONE(CLONE, FN) \ | 2843 #define FOR_EACH_CLONE(CLONE, FN) \ |
2750 if (!(TREE_CODE (FN) == FUNCTION_DECL \ | 2844 if (!(TREE_CODE (FN) == FUNCTION_DECL \ |
2751 && (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (FN) \ | 2845 && DECL_MAYBE_IN_CHARGE_CDTOR_P (FN))) \ |
2752 || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (FN))))\ | |
2753 ; \ | 2846 ; \ |
2754 else \ | 2847 else \ |
2755 for (CLONE = DECL_CHAIN (FN); \ | 2848 for (CLONE = DECL_CHAIN (FN); \ |
2756 CLONE && DECL_CLONED_FUNCTION_P (CLONE); \ | 2849 CLONE && DECL_CLONED_FUNCTION_P (CLONE); \ |
2757 CLONE = DECL_CHAIN (CLONE)) | 2850 CLONE = DECL_CHAIN (CLONE)) |
2804 ? DECL_LANG_SPECIFIC (NODE)->u.base.unknown_bound_p \ | 2897 ? DECL_LANG_SPECIFIC (NODE)->u.base.unknown_bound_p \ |
2805 : false) | 2898 : false) |
2806 #define SET_VAR_HAD_UNKNOWN_BOUND(NODE) \ | 2899 #define SET_VAR_HAD_UNKNOWN_BOUND(NODE) \ |
2807 (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.unknown_bound_p = true) | 2900 (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.unknown_bound_p = true) |
2808 | 2901 |
2809 /* Set the overloaded operator code for NODE to CODE. */ | 2902 /* True iff decl NODE is for an overloaded operator. */ |
2810 #define SET_OVERLOADED_OPERATOR_CODE(NODE, CODE) \ | |
2811 (LANG_DECL_FN_CHECK (NODE)->operator_code = (CODE)) | |
2812 | |
2813 /* If NODE is an overloaded operator, then this returns the TREE_CODE | |
2814 associated with the overloaded operator. If NODE is not an | |
2815 overloaded operator, ERROR_MARK is returned. Since the numerical | |
2816 value of ERROR_MARK is zero, this macro can be used as a predicate | |
2817 to test whether or not NODE is an overloaded operator. */ | |
2818 #define DECL_OVERLOADED_OPERATOR_P(NODE) \ | 2903 #define DECL_OVERLOADED_OPERATOR_P(NODE) \ |
2819 (IDENTIFIER_ANY_OP_P (DECL_NAME (NODE)) \ | 2904 IDENTIFIER_ANY_OP_P (DECL_NAME (NODE)) |
2820 ? LANG_DECL_FN_CHECK (NODE)->operator_code : ERROR_MARK) | |
2821 | 2905 |
2822 /* Nonzero if NODE is an assignment operator (including += and such). */ | 2906 /* Nonzero if NODE is an assignment operator (including += and such). */ |
2823 #define DECL_ASSIGNMENT_OPERATOR_P(NODE) \ | 2907 #define DECL_ASSIGNMENT_OPERATOR_P(NODE) \ |
2824 IDENTIFIER_ASSIGN_OP_P (DECL_NAME (NODE)) | 2908 IDENTIFIER_ASSIGN_OP_P (DECL_NAME (NODE)) |
2909 | |
2910 /* NODE is a function_decl for an overloaded operator. Return its | |
2911 compressed (raw) operator code. Note that this is not a TREE_CODE. */ | |
2912 #define DECL_OVERLOADED_OPERATOR_CODE_RAW(NODE) \ | |
2913 (LANG_DECL_FN_CHECK (NODE)->ovl_op_code) | |
2914 | |
2915 /* DECL is an overloaded operator. Test whether it is for TREE_CODE | |
2916 (a literal constant). */ | |
2917 #define DECL_OVERLOADED_OPERATOR_IS(DECL, CODE) \ | |
2918 (DECL_OVERLOADED_OPERATOR_CODE_RAW (DECL) == OVL_OP_##CODE) | |
2825 | 2919 |
2826 /* For FUNCTION_DECLs: nonzero means that this function is a | 2920 /* For FUNCTION_DECLs: nonzero means that this function is a |
2827 constructor or a destructor with an extra in-charge parameter to | 2921 constructor or a destructor with an extra in-charge parameter to |
2828 control whether or not virtual bases are constructed. */ | 2922 control whether or not virtual bases are constructed. */ |
2829 #define DECL_HAS_IN_CHARGE_PARM_P(NODE) \ | 2923 #define DECL_HAS_IN_CHARGE_PARM_P(NODE) \ |
3041 (DECL_CLASS_SCOPE_P (NODE) ? DECL_CONTEXT (NODE) : NULL_TREE) | 3135 (DECL_CLASS_SCOPE_P (NODE) ? DECL_CONTEXT (NODE) : NULL_TREE) |
3042 | 3136 |
3043 /* For a non-member friend function, the class (if any) in which this | 3137 /* For a non-member friend function, the class (if any) in which this |
3044 friend was defined. For example, given: | 3138 friend was defined. For example, given: |
3045 | 3139 |
3046 struct S { friend void f (); }; | 3140 struct S { friend void f () { ... } }; |
3047 | 3141 |
3048 the DECL_FRIEND_CONTEXT for `f' will be `S'. */ | 3142 the DECL_FRIEND_CONTEXT for `f' will be `S'. */ |
3049 #define DECL_FRIEND_CONTEXT(NODE) \ | 3143 #define DECL_FRIEND_CONTEXT(NODE) \ |
3050 ((DECL_DECLARES_FUNCTION_P (NODE) \ | 3144 ((DECL_DECLARES_FUNCTION_P (NODE) \ |
3051 && DECL_FRIEND_P (NODE) && !DECL_FUNCTION_MEMBER_P (NODE)) \ | 3145 && DECL_FRIEND_P (NODE) && !DECL_FUNCTION_MEMBER_P (NODE)) \ |
3155 | 3249 |
3156 /* In a TREE_LIST in the argument of attribute abi_tag, indicates that the tag | 3250 /* In a TREE_LIST in the argument of attribute abi_tag, indicates that the tag |
3157 was inherited from a template parameter, not explicitly indicated. */ | 3251 was inherited from a template parameter, not explicitly indicated. */ |
3158 #define ABI_TAG_IMPLICIT(NODE) TREE_LANG_FLAG_0 (TREE_LIST_CHECK (NODE)) | 3252 #define ABI_TAG_IMPLICIT(NODE) TREE_LANG_FLAG_0 (TREE_LIST_CHECK (NODE)) |
3159 | 3253 |
3160 extern tree decl_shadowed_for_var_lookup (tree); | |
3161 extern void decl_shadowed_for_var_insert (tree, tree); | |
3162 | |
3163 /* Non zero if this is a using decl for a dependent scope. */ | 3254 /* Non zero if this is a using decl for a dependent scope. */ |
3164 #define DECL_DEPENDENT_P(NODE) DECL_LANG_FLAG_0 (USING_DECL_CHECK (NODE)) | 3255 #define DECL_DEPENDENT_P(NODE) DECL_LANG_FLAG_0 (USING_DECL_CHECK (NODE)) |
3165 | 3256 |
3166 /* The scope named in a using decl. */ | 3257 /* The scope named in a using decl. */ |
3167 #define USING_DECL_SCOPE(NODE) TREE_TYPE (USING_DECL_CHECK (NODE)) | 3258 #define USING_DECL_SCOPE(NODE) TREE_TYPE (USING_DECL_CHECK (NODE)) |
3169 /* The decls named by a using decl. */ | 3260 /* The decls named by a using decl. */ |
3170 #define USING_DECL_DECLS(NODE) DECL_INITIAL (USING_DECL_CHECK (NODE)) | 3261 #define USING_DECL_DECLS(NODE) DECL_INITIAL (USING_DECL_CHECK (NODE)) |
3171 | 3262 |
3172 /* Non zero if the using decl refers to a dependent type. */ | 3263 /* Non zero if the using decl refers to a dependent type. */ |
3173 #define USING_DECL_TYPENAME_P(NODE) DECL_LANG_FLAG_1 (USING_DECL_CHECK (NODE)) | 3264 #define USING_DECL_TYPENAME_P(NODE) DECL_LANG_FLAG_1 (USING_DECL_CHECK (NODE)) |
3174 | |
3175 /* In a VAR_DECL, true if we have a shadowed local variable | |
3176 in the shadowed var table for this VAR_DECL. */ | |
3177 #define DECL_HAS_SHADOWED_FOR_VAR_P(NODE) \ | |
3178 (VAR_DECL_CHECK (NODE)->decl_with_vis.shadowed_for_var_p) | |
3179 | |
3180 /* In a VAR_DECL for a variable declared in a for statement, | |
3181 this is the shadowed (local) variable. */ | |
3182 #define DECL_SHADOWED_FOR_VAR(NODE) \ | |
3183 (DECL_HAS_SHADOWED_FOR_VAR_P(NODE) ? decl_shadowed_for_var_lookup (NODE) : NULL) | |
3184 | |
3185 #define SET_DECL_SHADOWED_FOR_VAR(NODE, VAL) \ | |
3186 (decl_shadowed_for_var_insert (NODE, VAL)) | |
3187 | 3265 |
3188 /* In a FUNCTION_DECL, this is nonzero if this function was defined in | 3266 /* In a FUNCTION_DECL, this is nonzero if this function was defined in |
3189 the class definition. We have saved away the text of the function, | 3267 the class definition. We have saved away the text of the function, |
3190 but have not yet processed it. */ | 3268 but have not yet processed it. */ |
3191 #define DECL_PENDING_INLINE_P(NODE) \ | 3269 #define DECL_PENDING_INLINE_P(NODE) \ |
3216 /* If non-NULL for a VAR_DECL, FUNCTION_DECL, TYPE_DECL or | 3294 /* If non-NULL for a VAR_DECL, FUNCTION_DECL, TYPE_DECL or |
3217 TEMPLATE_DECL, the entity is either a template specialization (if | 3295 TEMPLATE_DECL, the entity is either a template specialization (if |
3218 DECL_USE_TEMPLATE is nonzero) or the abstract instance of the | 3296 DECL_USE_TEMPLATE is nonzero) or the abstract instance of the |
3219 template itself. | 3297 template itself. |
3220 | 3298 |
3221 In either case, DECL_TEMPLATE_INFO is a TREE_LIST, whose | 3299 In either case, DECL_TEMPLATE_INFO is a TEMPLATE_INFO, whose |
3222 TREE_PURPOSE is the TEMPLATE_DECL of which this entity is a | 3300 TI_TEMPLATE is the TEMPLATE_DECL of which this entity is a |
3223 specialization or abstract instance. The TREE_VALUE is the | 3301 specialization or abstract instance. The TI_ARGS is the |
3224 template arguments used to specialize the template. | 3302 template arguments used to specialize the template. |
3225 | 3303 |
3226 Consider: | 3304 Consider: |
3227 | 3305 |
3228 template <typename T> struct S { friend void f(T) {} }; | 3306 template <typename T> struct S { friend void f(T) {} }; |
3229 | 3307 |
3230 In this case, S<int>::f is, from the point of view of the compiler, | 3308 In this case, S<int>::f is, from the point of view of the compiler, |
3287 ? (TYPE_LANG_SLOT_1 (NODE) = (VAL)) \ | 3365 ? (TYPE_LANG_SLOT_1 (NODE) = (VAL)) \ |
3288 : (DECL_TEMPLATE_INFO (TYPE_NAME (NODE)) = (VAL))) | 3366 : (DECL_TEMPLATE_INFO (TYPE_NAME (NODE)) = (VAL))) |
3289 | 3367 |
3290 #define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE)) | 3368 #define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE)) |
3291 #define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE)) | 3369 #define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE)) |
3292 #define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE) | 3370 #define TI_PENDING_TEMPLATE_FLAG(NODE) \ |
3371 TREE_LANG_FLAG_1 (TEMPLATE_INFO_CHECK (NODE)) | |
3293 /* For a given TREE_VEC containing a template argument list, | 3372 /* For a given TREE_VEC containing a template argument list, |
3294 this property contains the number of arguments that are not | 3373 this property contains the number of arguments that are not |
3295 defaulted. */ | 3374 defaulted. */ |
3296 #define NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) TREE_CHAIN (TREE_VEC_CHECK (NODE)) | 3375 #define NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) \ |
3376 TREE_CHAIN (TREE_VEC_CHECK (NODE)) | |
3377 | |
3297 /* Below are the setter and getter of the NON_DEFAULT_TEMPLATE_ARGS_COUNT | 3378 /* Below are the setter and getter of the NON_DEFAULT_TEMPLATE_ARGS_COUNT |
3298 property. */ | 3379 property. */ |
3299 #define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \ | 3380 #define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \ |
3300 NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) = build_int_cst (NULL_TREE, INT_VALUE) | 3381 NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) = build_int_cst (NULL_TREE, INT_VALUE) |
3301 #if CHECKING_P | 3382 #if CHECKING_P |
3458 || TREE_CODE (NODE) == EXPR_PACK_EXPANSION) | 3539 || TREE_CODE (NODE) == EXPR_PACK_EXPANSION) |
3459 | 3540 |
3460 /* Extracts the type or expression pattern from a TYPE_PACK_EXPANSION or | 3541 /* Extracts the type or expression pattern from a TYPE_PACK_EXPANSION or |
3461 EXPR_PACK_EXPANSION. */ | 3542 EXPR_PACK_EXPANSION. */ |
3462 #define PACK_EXPANSION_PATTERN(NODE) \ | 3543 #define PACK_EXPANSION_PATTERN(NODE) \ |
3463 (TREE_CODE (NODE) == TYPE_PACK_EXPANSION? TREE_TYPE (NODE) \ | 3544 (TREE_CODE (NODE) == TYPE_PACK_EXPANSION ? TREE_TYPE (NODE) \ |
3464 : TREE_OPERAND (NODE, 0)) | 3545 : TREE_OPERAND (NODE, 0)) |
3465 | 3546 |
3466 /* Sets the type or expression pattern for a TYPE_PACK_EXPANSION or | 3547 /* Sets the type or expression pattern for a TYPE_PACK_EXPANSION or |
3467 EXPR_PACK_EXPANSION. */ | 3548 EXPR_PACK_EXPANSION. */ |
3468 #define SET_PACK_EXPANSION_PATTERN(NODE,VALUE) \ | 3549 #define SET_PACK_EXPANSION_PATTERN(NODE,VALUE) \ |
3477 *(TREE_CODE (NODE) == EXPR_PACK_EXPANSION \ | 3558 *(TREE_CODE (NODE) == EXPR_PACK_EXPANSION \ |
3478 ? &TREE_OPERAND (NODE, 1) \ | 3559 ? &TREE_OPERAND (NODE, 1) \ |
3479 : &TYPE_MIN_VALUE_RAW (TYPE_PACK_EXPANSION_CHECK (NODE))) | 3560 : &TYPE_MIN_VALUE_RAW (TYPE_PACK_EXPANSION_CHECK (NODE))) |
3480 | 3561 |
3481 /* Any additional template args to be applied when substituting into | 3562 /* Any additional template args to be applied when substituting into |
3482 the pattern, set by tsubst_pack_expansion for partial instantiations. */ | 3563 the pattern, set by tsubst_pack_expansion for partial instantiations. |
3564 If this is a TREE_LIST, the TREE_VALUE of the first element is the | |
3565 usual template argument TREE_VEC, and the TREE_PURPOSE of later elements | |
3566 are enclosing functions that provided function parameter packs we'll need | |
3567 to map appropriately. */ | |
3483 #define PACK_EXPANSION_EXTRA_ARGS(NODE) \ | 3568 #define PACK_EXPANSION_EXTRA_ARGS(NODE) \ |
3484 *(TREE_CODE (NODE) == TYPE_PACK_EXPANSION \ | 3569 *(TREE_CODE (NODE) == TYPE_PACK_EXPANSION \ |
3485 ? &TYPE_MAX_VALUE_RAW (NODE) \ | 3570 ? &TYPE_MAX_VALUE_RAW (NODE) \ |
3486 : &TREE_OPERAND ((NODE), 2)) | 3571 : &TREE_OPERAND ((NODE), 2)) |
3487 | 3572 |
3535 /* In an ARGUMENT_PACK_SELECT, the index of the argument we want to | 3620 /* In an ARGUMENT_PACK_SELECT, the index of the argument we want to |
3536 select. */ | 3621 select. */ |
3537 #define ARGUMENT_PACK_SELECT_INDEX(NODE) \ | 3622 #define ARGUMENT_PACK_SELECT_INDEX(NODE) \ |
3538 (((struct tree_argument_pack_select *)ARGUMENT_PACK_SELECT_CHECK (NODE))->index) | 3623 (((struct tree_argument_pack_select *)ARGUMENT_PACK_SELECT_CHECK (NODE))->index) |
3539 | 3624 |
3540 /* In an ARGUMENT_PACK_SELECT, the actual underlying argument that the | |
3541 ARGUMENT_PACK_SELECT represents. */ | |
3542 #define ARGUMENT_PACK_SELECT_ARG(NODE) \ | |
3543 TREE_VEC_ELT (ARGUMENT_PACK_ARGS (ARGUMENT_PACK_SELECT_FROM_PACK (NODE)), \ | |
3544 ARGUMENT_PACK_SELECT_INDEX (NODE)) | |
3545 | |
3546 #define FOLD_EXPR_CHECK(NODE) \ | 3625 #define FOLD_EXPR_CHECK(NODE) \ |
3547 TREE_CHECK4 (NODE, UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR, \ | 3626 TREE_CHECK4 (NODE, UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR, \ |
3548 BINARY_LEFT_FOLD_EXPR, BINARY_RIGHT_FOLD_EXPR) | 3627 BINARY_LEFT_FOLD_EXPR, BINARY_RIGHT_FOLD_EXPR) |
3549 | 3628 |
3550 #define BINARY_FOLD_EXPR_CHECK(NODE) \ | 3629 #define BINARY_FOLD_EXPR_CHECK(NODE) \ |
3577 /* In a FUNCTION_DECL, the saved language-specific per-function data. */ | 3656 /* In a FUNCTION_DECL, the saved language-specific per-function data. */ |
3578 #define DECL_SAVED_FUNCTION_DATA(NODE) \ | 3657 #define DECL_SAVED_FUNCTION_DATA(NODE) \ |
3579 (LANG_DECL_FN_CHECK (FUNCTION_DECL_CHECK (NODE)) \ | 3658 (LANG_DECL_FN_CHECK (FUNCTION_DECL_CHECK (NODE)) \ |
3580 ->u.saved_language_function) | 3659 ->u.saved_language_function) |
3581 | 3660 |
3582 /* True if NODE is an implicit INDIRECT_EXPR from convert_from_reference. */ | 3661 /* True if NODE is an implicit INDIRECT_REF from convert_from_reference. */ |
3583 #define REFERENCE_REF_P(NODE) \ | 3662 #define REFERENCE_REF_P(NODE) \ |
3584 (INDIRECT_REF_P (NODE) \ | 3663 (INDIRECT_REF_P (NODE) \ |
3585 && TREE_TYPE (TREE_OPERAND (NODE, 0)) \ | 3664 && TREE_TYPE (TREE_OPERAND (NODE, 0)) \ |
3586 && (TREE_CODE (TREE_TYPE (TREE_OPERAND ((NODE), 0))) \ | 3665 && TYPE_REF_P (TREE_TYPE (TREE_OPERAND ((NODE), 0)))) |
3587 == REFERENCE_TYPE)) | |
3588 | 3666 |
3589 /* True if NODE is a REFERENCE_TYPE which is OK to instantiate to be a | 3667 /* True if NODE is a REFERENCE_TYPE which is OK to instantiate to be a |
3590 reference to VLA type, because it's used for VLA capture. */ | 3668 reference to VLA type, because it's used for VLA capture. */ |
3591 #define REFERENCE_VLA_OK(NODE) \ | 3669 #define REFERENCE_VLA_OK(NODE) \ |
3592 (TYPE_LANG_FLAG_5 (REFERENCE_TYPE_CHECK (NODE))) | 3670 (TYPE_LANG_FLAG_5 (REFERENCE_TYPE_CHECK (NODE))) |
3634 /* Indicates whether a COMPONENT_REF or a SCOPE_REF has been parenthesized, or | 3712 /* Indicates whether a COMPONENT_REF or a SCOPE_REF has been parenthesized, or |
3635 an INDIRECT_REF comes from parenthesizing a _DECL. Currently only set some | 3713 an INDIRECT_REF comes from parenthesizing a _DECL. Currently only set some |
3636 of the time in C++14 mode. */ | 3714 of the time in C++14 mode. */ |
3637 | 3715 |
3638 #define REF_PARENTHESIZED_P(NODE) \ | 3716 #define REF_PARENTHESIZED_P(NODE) \ |
3639 TREE_LANG_FLAG_2 (TREE_CHECK3 ((NODE), COMPONENT_REF, INDIRECT_REF, SCOPE_REF)) | 3717 TREE_LANG_FLAG_2 (TREE_CHECK4 ((NODE), COMPONENT_REF, INDIRECT_REF, SCOPE_REF, VIEW_CONVERT_EXPR)) |
3640 | 3718 |
3641 /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a | 3719 /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a |
3642 constructor call, rather than an ordinary function call. */ | 3720 constructor call, rather than an ordinary function call. */ |
3643 #define AGGR_INIT_VIA_CTOR_P(NODE) \ | 3721 #define AGGR_INIT_VIA_CTOR_P(NODE) \ |
3644 TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE)) | 3722 TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE)) |
3786 | 3864 |
3787 /* Nonzero if this class has a virtual function table pointer. */ | 3865 /* Nonzero if this class has a virtual function table pointer. */ |
3788 #define TYPE_CONTAINS_VPTR_P(NODE) \ | 3866 #define TYPE_CONTAINS_VPTR_P(NODE) \ |
3789 (TYPE_POLYMORPHIC_P (NODE) || CLASSTYPE_VBASECLASSES (NODE)) | 3867 (TYPE_POLYMORPHIC_P (NODE) || CLASSTYPE_VBASECLASSES (NODE)) |
3790 | 3868 |
3791 /* This flag is true of a local VAR_DECL if it was declared in a for | |
3792 statement, but we are no longer in the scope of the for. */ | |
3793 #define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (VAR_DECL_CHECK (NODE)) | |
3794 | |
3795 /* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL | |
3796 if we already emitted a warning about using it. */ | |
3797 #define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE)) | |
3798 | |
3799 /* Nonzero if NODE is a FUNCTION_DECL (for a function with global | 3869 /* Nonzero if NODE is a FUNCTION_DECL (for a function with global |
3800 scope) declared in a local scope. */ | 3870 scope) declared in a local scope. */ |
3801 #define DECL_LOCAL_FUNCTION_P(NODE) \ | 3871 #define DECL_LOCAL_FUNCTION_P(NODE) \ |
3802 DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE)) | 3872 DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE)) |
3803 | 3873 |
3866 ? DECL_LANG_SPECIFIC (NODE)->u.base.var_declared_inline_p \ | 3936 ? DECL_LANG_SPECIFIC (NODE)->u.base.var_declared_inline_p \ |
3867 : false) | 3937 : false) |
3868 #define SET_DECL_VAR_DECLARED_INLINE_P(NODE) \ | 3938 #define SET_DECL_VAR_DECLARED_INLINE_P(NODE) \ |
3869 (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.var_declared_inline_p \ | 3939 (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.var_declared_inline_p \ |
3870 = true) | 3940 = true) |
3941 | |
3942 /* True if NODE is a constant variable with a value-dependent initializer. */ | |
3943 #define DECL_DEPENDENT_INIT_P(NODE) \ | |
3944 (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE)) \ | |
3945 && DECL_LANG_SPECIFIC (NODE)->u.base.dependent_init_p) | |
3946 #define SET_DECL_DEPENDENT_INIT_P(NODE, X) \ | |
3947 (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.dependent_init_p = (X)) | |
3871 | 3948 |
3872 /* Nonzero if NODE is an artificial VAR_DECL for a C++17 structured binding | 3949 /* Nonzero if NODE is an artificial VAR_DECL for a C++17 structured binding |
3873 declaration or one of VAR_DECLs for the user identifiers in it. */ | 3950 declaration or one of VAR_DECLs for the user identifiers in it. */ |
3874 #define DECL_DECOMPOSITION_P(NODE) \ | 3951 #define DECL_DECOMPOSITION_P(NODE) \ |
3875 (VAR_P (NODE) && DECL_LANG_SPECIFIC (NODE) \ | 3952 (VAR_P (NODE) && DECL_LANG_SPECIFIC (NODE) \ |
4094 | 4171 |
4095 /* True if NODE is a init-list used as a direct-initializer, i.e. | 4172 /* True if NODE is a init-list used as a direct-initializer, i.e. |
4096 B b{1,2}, not B b({1,2}) or B b = {1,2}. */ | 4173 B b{1,2}, not B b({1,2}) or B b = {1,2}. */ |
4097 #define CONSTRUCTOR_IS_DIRECT_INIT(NODE) (TREE_LANG_FLAG_0 (CONSTRUCTOR_CHECK (NODE))) | 4174 #define CONSTRUCTOR_IS_DIRECT_INIT(NODE) (TREE_LANG_FLAG_0 (CONSTRUCTOR_CHECK (NODE))) |
4098 | 4175 |
4099 /* True if an uninitialized element in NODE should not be treated as | |
4100 implicitly value-initialized. Only used in constexpr evaluation. */ | |
4101 #define CONSTRUCTOR_NO_IMPLICIT_ZERO(NODE) \ | |
4102 (TREE_LANG_FLAG_1 (CONSTRUCTOR_CHECK (NODE))) | |
4103 | |
4104 /* True if this CONSTRUCTOR should not be used as a variable initializer | 4176 /* True if this CONSTRUCTOR should not be used as a variable initializer |
4105 because it was loaded from a constexpr variable with mutable fields. */ | 4177 because it was loaded from a constexpr variable with mutable fields. */ |
4106 #define CONSTRUCTOR_MUTABLE_POISON(NODE) \ | 4178 #define CONSTRUCTOR_MUTABLE_POISON(NODE) \ |
4107 (TREE_LANG_FLAG_2 (CONSTRUCTOR_CHECK (NODE))) | 4179 (TREE_LANG_FLAG_2 (CONSTRUCTOR_CHECK (NODE))) |
4108 | 4180 |
4109 /* True if this typed CONSTRUCTOR represents C99 compound-literal syntax rather | 4181 /* True if this typed CONSTRUCTOR represents C99 compound-literal syntax rather |
4110 than C++11 functional cast syntax. */ | 4182 than C++11 functional cast syntax. */ |
4111 #define CONSTRUCTOR_C99_COMPOUND_LITERAL(NODE) \ | 4183 #define CONSTRUCTOR_C99_COMPOUND_LITERAL(NODE) \ |
4112 (TREE_LANG_FLAG_3 (CONSTRUCTOR_CHECK (NODE))) | 4184 (TREE_LANG_FLAG_3 (CONSTRUCTOR_CHECK (NODE))) |
4113 | 4185 |
4186 /* True if this CONSTRUCTOR contains PLACEHOLDER_EXPRs referencing the | |
4187 CONSTRUCTOR's type not nested inside another CONSTRUCTOR marked with | |
4188 CONSTRUCTOR_PLACEHOLDER_BOUNDARY. */ | |
4189 #define CONSTRUCTOR_PLACEHOLDER_BOUNDARY(NODE) \ | |
4190 (TREE_LANG_FLAG_5 (CONSTRUCTOR_CHECK (NODE))) | |
4191 | |
4114 #define DIRECT_LIST_INIT_P(NODE) \ | 4192 #define DIRECT_LIST_INIT_P(NODE) \ |
4115 (BRACE_ENCLOSED_INITIALIZER_P (NODE) && CONSTRUCTOR_IS_DIRECT_INIT (NODE)) | 4193 (BRACE_ENCLOSED_INITIALIZER_P (NODE) && CONSTRUCTOR_IS_DIRECT_INIT (NODE)) |
4116 | 4194 |
4117 /* True if NODE represents a conversion for direct-initialization in a | 4195 /* True if NODE represents a conversion for direct-initialization in a |
4118 template. Set by perform_implicit_conversion_flags. */ | 4196 template. Set by perform_implicit_conversion_flags. */ |
4119 #define IMPLICIT_CONV_EXPR_DIRECT_INIT(NODE) \ | 4197 #define IMPLICIT_CONV_EXPR_DIRECT_INIT(NODE) \ |
4120 (TREE_LANG_FLAG_0 (IMPLICIT_CONV_EXPR_CHECK (NODE))) | 4198 (TREE_LANG_FLAG_0 (IMPLICIT_CONV_EXPR_CHECK (NODE))) |
4199 | |
4200 /* True if NODE represents a dependent conversion of a non-type template | |
4201 argument. Set by maybe_convert_nontype_argument. */ | |
4202 #define IMPLICIT_CONV_EXPR_NONTYPE_ARG(NODE) \ | |
4203 (TREE_LANG_FLAG_1 (IMPLICIT_CONV_EXPR_CHECK (NODE))) | |
4121 | 4204 |
4122 /* Nonzero means that an object of this type can not be initialized using | 4205 /* Nonzero means that an object of this type can not be initialized using |
4123 an initializer list. */ | 4206 an initializer list. */ |
4124 #define CLASSTYPE_NON_AGGREGATE(NODE) \ | 4207 #define CLASSTYPE_NON_AGGREGATE(NODE) \ |
4125 (LANG_TYPE_CLASS_CHECK (NODE)->non_aggregate) | 4208 (LANG_TYPE_CLASS_CHECK (NODE)->non_aggregate) |
4177 (TYPE_HAS_COPY_ASSIGN (NODE) && ! TYPE_HAS_COMPLEX_COPY_ASSIGN (NODE)) | 4260 (TYPE_HAS_COPY_ASSIGN (NODE) && ! TYPE_HAS_COMPLEX_COPY_ASSIGN (NODE)) |
4178 | 4261 |
4179 /* Returns true if NODE is a pointer-to-data-member. */ | 4262 /* Returns true if NODE is a pointer-to-data-member. */ |
4180 #define TYPE_PTRDATAMEM_P(NODE) \ | 4263 #define TYPE_PTRDATAMEM_P(NODE) \ |
4181 (TREE_CODE (NODE) == OFFSET_TYPE) | 4264 (TREE_CODE (NODE) == OFFSET_TYPE) |
4265 | |
4182 /* Returns true if NODE is a pointer. */ | 4266 /* Returns true if NODE is a pointer. */ |
4183 #define TYPE_PTR_P(NODE) \ | 4267 #define TYPE_PTR_P(NODE) \ |
4184 (TREE_CODE (NODE) == POINTER_TYPE) | 4268 (TREE_CODE (NODE) == POINTER_TYPE) |
4185 | 4269 |
4270 /* Returns true if NODE is a reference. */ | |
4271 #define TYPE_REF_P(NODE) \ | |
4272 (TREE_CODE (NODE) == REFERENCE_TYPE) | |
4273 | |
4274 /* Returns true if NODE is a pointer or a reference. */ | |
4275 #define INDIRECT_TYPE_P(NODE) \ | |
4276 (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE)) | |
4277 | |
4186 /* Returns true if NODE is an object type: | 4278 /* Returns true if NODE is an object type: |
4187 | 4279 |
4188 [basic.types] | 4280 [basic.types] |
4189 | 4281 |
4190 An object type is a (possibly cv-qualified) type that is not a | 4282 An object type is a (possibly cv-qualified) type that is not a |
4191 function type, not a reference type, and not a void type. | 4283 function type, not a reference type, and not a void type. |
4192 | 4284 |
4193 Keep these checks in ascending order, for speed. */ | 4285 Keep these checks in ascending order, for speed. */ |
4194 #define TYPE_OBJ_P(NODE) \ | 4286 #define TYPE_OBJ_P(NODE) \ |
4195 (TREE_CODE (NODE) != REFERENCE_TYPE \ | 4287 (!TYPE_REF_P (NODE) \ |
4196 && !VOID_TYPE_P (NODE) \ | 4288 && !VOID_TYPE_P (NODE) \ |
4197 && TREE_CODE (NODE) != FUNCTION_TYPE \ | 4289 && TREE_CODE (NODE) != FUNCTION_TYPE \ |
4198 && TREE_CODE (NODE) != METHOD_TYPE) | 4290 && TREE_CODE (NODE) != METHOD_TYPE) |
4199 | 4291 |
4200 /* Returns true if NODE is a pointer to an object. Keep these checks | 4292 /* Returns true if NODE is a pointer to an object. Keep these checks |
4203 (TYPE_PTR_P (NODE) && TYPE_OBJ_P (TREE_TYPE (NODE))) | 4295 (TYPE_PTR_P (NODE) && TYPE_OBJ_P (TREE_TYPE (NODE))) |
4204 | 4296 |
4205 /* Returns true if NODE is a reference to an object. Keep these checks | 4297 /* Returns true if NODE is a reference to an object. Keep these checks |
4206 in ascending tree code order. */ | 4298 in ascending tree code order. */ |
4207 #define TYPE_REF_OBJ_P(NODE) \ | 4299 #define TYPE_REF_OBJ_P(NODE) \ |
4208 (TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE))) | 4300 (TYPE_REF_P (NODE) && TYPE_OBJ_P (TREE_TYPE (NODE))) |
4209 | 4301 |
4210 /* Returns true if NODE is a pointer to an object, or a pointer to | 4302 /* Returns true if NODE is a pointer to an object, or a pointer to |
4211 void. Keep these checks in ascending tree code order. */ | 4303 void. Keep these checks in ascending tree code order. */ |
4212 #define TYPE_PTROBV_P(NODE) \ | 4304 #define TYPE_PTROBV_P(NODE) \ |
4213 (TYPE_PTR_P (NODE) \ | 4305 (TYPE_PTR_P (NODE) \ |
4219 (TYPE_PTR_P (NODE) \ | 4311 (TYPE_PTR_P (NODE) \ |
4220 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) | 4312 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) |
4221 | 4313 |
4222 /* Returns true if NODE is a reference to function type. */ | 4314 /* Returns true if NODE is a reference to function type. */ |
4223 #define TYPE_REFFN_P(NODE) \ | 4315 #define TYPE_REFFN_P(NODE) \ |
4224 (TREE_CODE (NODE) == REFERENCE_TYPE \ | 4316 (TYPE_REF_P (NODE) \ |
4225 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) | 4317 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) |
4226 | 4318 |
4227 /* Returns true if NODE is a pointer to member function type. */ | 4319 /* Returns true if NODE is a pointer to member function type. */ |
4228 #define TYPE_PTRMEMFUNC_P(NODE) \ | 4320 #define TYPE_PTRMEMFUNC_P(NODE) \ |
4229 (TREE_CODE (NODE) == RECORD_TYPE \ | 4321 (TREE_CODE (NODE) == RECORD_TYPE \ |
4487 (DECL_LANG_FLAG_0 (NODE) \ | 4579 (DECL_LANG_FLAG_0 (NODE) \ |
4488 && (TREE_CODE (NODE) == CONST_DECL \ | 4580 && (TREE_CODE (NODE) == CONST_DECL \ |
4489 || TREE_CODE (NODE) == PARM_DECL \ | 4581 || TREE_CODE (NODE) == PARM_DECL \ |
4490 || TREE_CODE (NODE) == TYPE_DECL \ | 4582 || TREE_CODE (NODE) == TYPE_DECL \ |
4491 || TREE_CODE (NODE) == TEMPLATE_DECL)) | 4583 || TREE_CODE (NODE) == TEMPLATE_DECL)) |
4584 | |
4585 /* Nonzero for a raw template parameter node. */ | |
4586 #define TEMPLATE_PARM_P(NODE) \ | |
4587 (TREE_CODE (NODE) == TEMPLATE_TYPE_PARM \ | |
4588 || TREE_CODE (NODE) == TEMPLATE_TEMPLATE_PARM \ | |
4589 || TREE_CODE (NODE) == TEMPLATE_PARM_INDEX) | |
4492 | 4590 |
4493 /* Mark NODE as a template parameter. */ | 4591 /* Mark NODE as a template parameter. */ |
4494 #define SET_DECL_TEMPLATE_PARM_P(NODE) \ | 4592 #define SET_DECL_TEMPLATE_PARM_P(NODE) \ |
4495 (DECL_LANG_FLAG_0 (NODE) = 1) | 4593 (DECL_LANG_FLAG_0 (NODE) = 1) |
4496 | 4594 |
4647 | 4745 |
4648 /* Nonzero iff we are currently processing a declaration for an | 4746 /* Nonzero iff we are currently processing a declaration for an |
4649 entity with its own template parameter list, and which is not a | 4747 entity with its own template parameter list, and which is not a |
4650 full specialization. */ | 4748 full specialization. */ |
4651 #define PROCESSING_REAL_TEMPLATE_DECL_P() \ | 4749 #define PROCESSING_REAL_TEMPLATE_DECL_P() \ |
4652 (processing_template_decl > template_class_depth (current_scope ())) | 4750 (!processing_template_parmlist \ |
4751 && processing_template_decl > template_class_depth (current_scope ())) | |
4653 | 4752 |
4654 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been | 4753 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been |
4655 instantiated, i.e. its definition has been generated from the | 4754 instantiated, i.e. its definition has been generated from the |
4656 pattern given in the template. */ | 4755 pattern given in the template. */ |
4657 #define DECL_TEMPLATE_INSTANTIATED(NODE) \ | 4756 #define DECL_TEMPLATE_INSTANTIATED(NODE) \ |
4794 #define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) | 4893 #define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) |
4795 #define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) | 4894 #define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) |
4796 #define IF_SCOPE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 3) | 4895 #define IF_SCOPE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 3) |
4797 #define IF_STMT_CONSTEXPR_P(NODE) TREE_LANG_FLAG_0 (IF_STMT_CHECK (NODE)) | 4896 #define IF_STMT_CONSTEXPR_P(NODE) TREE_LANG_FLAG_0 (IF_STMT_CHECK (NODE)) |
4798 | 4897 |
4898 /* Like PACK_EXPANSION_EXTRA_ARGS, for constexpr if. IF_SCOPE is used while | |
4899 building an IF_STMT; IF_STMT_EXTRA_ARGS is used after it is complete. */ | |
4900 #define IF_STMT_EXTRA_ARGS(NODE) IF_SCOPE (NODE) | |
4901 | |
4799 /* WHILE_STMT accessors. These give access to the condition of the | 4902 /* WHILE_STMT accessors. These give access to the condition of the |
4800 while statement and the body of the while statement, respectively. */ | 4903 while statement and the body of the while statement, respectively. */ |
4801 #define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) | 4904 #define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) |
4802 #define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) | 4905 #define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) |
4803 | 4906 |
4819 expression, body, and scope of the statement, respectively. */ | 4922 expression, body, and scope of the statement, respectively. */ |
4820 #define RANGE_FOR_DECL(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 0) | 4923 #define RANGE_FOR_DECL(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 0) |
4821 #define RANGE_FOR_EXPR(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 1) | 4924 #define RANGE_FOR_EXPR(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 1) |
4822 #define RANGE_FOR_BODY(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 2) | 4925 #define RANGE_FOR_BODY(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 2) |
4823 #define RANGE_FOR_SCOPE(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 3) | 4926 #define RANGE_FOR_SCOPE(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 3) |
4927 #define RANGE_FOR_UNROLL(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 4) | |
4928 #define RANGE_FOR_INIT_STMT(NODE) TREE_OPERAND (RANGE_FOR_STMT_CHECK (NODE), 5) | |
4824 #define RANGE_FOR_IVDEP(NODE) TREE_LANG_FLAG_6 (RANGE_FOR_STMT_CHECK (NODE)) | 4929 #define RANGE_FOR_IVDEP(NODE) TREE_LANG_FLAG_6 (RANGE_FOR_STMT_CHECK (NODE)) |
4825 | 4930 |
4826 #define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) | 4931 #define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) |
4827 #define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) | 4932 #define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) |
4828 #define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) | 4933 #define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) |
4829 #define SWITCH_STMT_SCOPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 3) | 4934 #define SWITCH_STMT_SCOPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 3) |
4935 /* True if there are case labels for all possible values of switch cond, either | |
4936 because there is a default: case label or because the case label ranges cover | |
4937 all values. */ | |
4938 #define SWITCH_STMT_ALL_CASES_P(NODE) \ | |
4939 TREE_LANG_FLAG_0 (SWITCH_STMT_CHECK (NODE)) | |
4940 /* True if the body of a switch stmt contains no BREAK_STMTs. */ | |
4941 #define SWITCH_STMT_NO_BREAK_P(NODE) \ | |
4942 TREE_LANG_FLAG_2 (SWITCH_STMT_CHECK (NODE)) | |
4830 | 4943 |
4831 /* STMT_EXPR accessor. */ | 4944 /* STMT_EXPR accessor. */ |
4832 #define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) | 4945 #define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) |
4833 | 4946 |
4834 /* EXPR_STMT accessor. This gives the expression associated with an | 4947 /* EXPR_STMT accessor. This gives the expression associated with an |
4867 TREE_LANG_FLAG_0 (CONVERT_EXPR_CHECK (NODE)) | 4980 TREE_LANG_FLAG_0 (CONVERT_EXPR_CHECK (NODE)) |
4868 | 4981 |
4869 /* True if SIZEOF_EXPR argument is type. */ | 4982 /* True if SIZEOF_EXPR argument is type. */ |
4870 #define SIZEOF_EXPR_TYPE_P(NODE) \ | 4983 #define SIZEOF_EXPR_TYPE_P(NODE) \ |
4871 TREE_LANG_FLAG_0 (SIZEOF_EXPR_CHECK (NODE)) | 4984 TREE_LANG_FLAG_0 (SIZEOF_EXPR_CHECK (NODE)) |
4985 | |
4986 /* True if the ALIGNOF_EXPR was spelled "alignof". */ | |
4987 #define ALIGNOF_EXPR_STD_P(NODE) \ | |
4988 TREE_LANG_FLAG_0 (ALIGNOF_EXPR_CHECK (NODE)) | |
4872 | 4989 |
4873 /* An enumeration of the kind of tags that C++ accepts. */ | 4990 /* An enumeration of the kind of tags that C++ accepts. */ |
4874 enum tag_types { | 4991 enum tag_types { |
4875 none_type = 0, /* Not a tag type. */ | 4992 none_type = 0, /* Not a tag type. */ |
4876 record_type, /* "struct" types. */ | 4993 record_type, /* "struct" types. */ |
5115 extern GTY(()) vec<tree, va_gc> *static_decls; | 5232 extern GTY(()) vec<tree, va_gc> *static_decls; |
5116 | 5233 |
5117 /* An array of vtable-needing types that have no key function, or have | 5234 /* An array of vtable-needing types that have no key function, or have |
5118 an emitted key function. */ | 5235 an emitted key function. */ |
5119 extern GTY(()) vec<tree, va_gc> *keyed_classes; | 5236 extern GTY(()) vec<tree, va_gc> *keyed_classes; |
5120 | |
5121 | 5237 |
5122 /* Here's where we control how name mangling takes place. */ | 5238 /* Here's where we control how name mangling takes place. */ |
5123 | 5239 |
5124 /* Cannot use '$' up front, because this confuses gdb | 5240 /* Cannot use '$' up front, because this confuses gdb |
5125 (names beginning with '$' are gdb-local identifiers). | 5241 (names beginning with '$' are gdb-local identifiers). |
5151 #define VFIELD_NAME "_vptr$" | 5267 #define VFIELD_NAME "_vptr$" |
5152 #define VFIELD_NAME_FORMAT "_vptr$%s" | 5268 #define VFIELD_NAME_FORMAT "_vptr$%s" |
5153 | 5269 |
5154 #else /* NO_DOLLAR_IN_LABEL */ | 5270 #else /* NO_DOLLAR_IN_LABEL */ |
5155 | 5271 |
5156 #define AUTO_TEMP_NAME "__tmp_" | |
5157 #define TEMP_NAME_P(ID_NODE) \ | |
5158 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \ | |
5159 sizeof (AUTO_TEMP_NAME) - 1)) | |
5160 #define VTABLE_NAME "__vt_" | 5272 #define VTABLE_NAME "__vt_" |
5161 #define VTABLE_NAME_P(ID_NODE) \ | 5273 #define VTABLE_NAME_P(ID_NODE) \ |
5162 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \ | 5274 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \ |
5163 sizeof (VTABLE_NAME) - 1)) | 5275 sizeof (VTABLE_NAME) - 1)) |
5164 #define VFIELD_BASE "__vfb" | 5276 #define VFIELD_BASE "__vfb" |
5189 | 5301 |
5190 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ | 5302 #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ |
5191 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \ | 5303 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \ |
5192 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) | 5304 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) |
5193 | 5305 |
5194 #define TEMP_NAME_P(ID_NODE) \ | |
5195 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1)) | |
5196 #define VFIELD_NAME_P(ID_NODE) \ | 5306 #define VFIELD_NAME_P(ID_NODE) \ |
5197 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1)) | 5307 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1)) |
5198 | 5308 |
5199 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */ | 5309 #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */ |
5200 | 5310 |
5477 | 5587 |
5478 /* in lex.c */ | 5588 /* in lex.c */ |
5479 | 5589 |
5480 extern void init_reswords (void); | 5590 extern void init_reswords (void); |
5481 | 5591 |
5482 typedef struct GTY(()) operator_name_info_t { | 5592 /* Various flags for the overloaded operator information. */ |
5593 enum ovl_op_flags | |
5594 { | |
5595 OVL_OP_FLAG_NONE = 0, /* Don't care. */ | |
5596 OVL_OP_FLAG_UNARY = 1, /* Is unary. */ | |
5597 OVL_OP_FLAG_BINARY = 2, /* Is binary. */ | |
5598 OVL_OP_FLAG_AMBIARY = 3, /* May be unary or binary. */ | |
5599 OVL_OP_FLAG_ALLOC = 4, /* operator new or delete. */ | |
5600 OVL_OP_FLAG_DELETE = 1, /* operator delete. */ | |
5601 OVL_OP_FLAG_VEC = 2 /* vector new or delete. */ | |
5602 }; | |
5603 | |
5604 /* Compressed operator codes. Order is determined by operators.def | |
5605 and does not match that of tree_codes. */ | |
5606 enum ovl_op_code | |
5607 { | |
5608 OVL_OP_ERROR_MARK, | |
5609 OVL_OP_NOP_EXPR, | |
5610 #define DEF_OPERATOR(NAME, CODE, MANGLING, FLAGS) OVL_OP_##CODE, | |
5611 #define DEF_ASSN_OPERATOR(NAME, CODE, MANGLING) /* NOTHING */ | |
5612 #include "operators.def" | |
5613 OVL_OP_MAX | |
5614 }; | |
5615 | |
5616 struct GTY(()) ovl_op_info_t { | |
5483 /* The IDENTIFIER_NODE for the operator. */ | 5617 /* The IDENTIFIER_NODE for the operator. */ |
5484 tree identifier; | 5618 tree identifier; |
5485 /* The name of the operator. */ | 5619 /* The name of the operator. */ |
5486 const char *name; | 5620 const char *name; |
5487 /* The mangled name of the operator. */ | 5621 /* The mangled name of the operator. */ |
5488 const char *mangled_name; | 5622 const char *mangled_name; |
5489 /* The arity of the operator. */ | 5623 /* The (regular) tree code. */ |
5490 int arity; | 5624 enum tree_code tree_code : 16; |
5491 } operator_name_info_t; | 5625 /* The (compressed) operator code. */ |
5492 | 5626 enum ovl_op_code ovl_op_code : 8; |
5493 /* A mapping from tree codes to operator name information. */ | 5627 /* The ovl_op_flags of the operator */ |
5494 extern GTY(()) operator_name_info_t operator_name_info | 5628 unsigned flags : 8; |
5495 [(int) MAX_TREE_CODES]; | 5629 }; |
5496 /* Similar, but for assignment operators. */ | 5630 |
5497 extern GTY(()) operator_name_info_t assignment_operator_name_info | 5631 /* Overloaded operator info indexed by ass_op_p & ovl_op_code. */ |
5498 [(int) MAX_TREE_CODES]; | 5632 extern GTY(()) ovl_op_info_t ovl_op_info[2][OVL_OP_MAX]; |
5633 /* Mapping from tree_codes to ovl_op_codes. */ | |
5634 extern GTY(()) unsigned char ovl_op_mapping[MAX_TREE_CODES]; | |
5635 /* Mapping for ambi-ary operators from the binary to the unary. */ | |
5636 extern GTY(()) unsigned char ovl_op_alternate[OVL_OP_MAX]; | |
5637 | |
5638 /* Given an ass_op_p boolean and a tree code, return a pointer to its | |
5639 overloaded operator info. Tree codes for non-overloaded operators | |
5640 map to the error-operator. */ | |
5641 #define OVL_OP_INFO(IS_ASS_P, TREE_CODE) \ | |
5642 (&ovl_op_info[(IS_ASS_P) != 0][ovl_op_mapping[(TREE_CODE)]]) | |
5643 /* Overloaded operator info for an identifier for which | |
5644 IDENTIFIER_OVL_OP_P is true. */ | |
5645 #define IDENTIFIER_OVL_OP_INFO(NODE) \ | |
5646 (&ovl_op_info[IDENTIFIER_KIND_BIT_0 (NODE)][IDENTIFIER_CP_INDEX (NODE)]) | |
5647 #define IDENTIFIER_OVL_OP_FLAGS(NODE) \ | |
5648 (IDENTIFIER_OVL_OP_INFO (NODE)->flags) | |
5499 | 5649 |
5500 /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL | 5650 /* A type-qualifier, or bitmask therefore, using the TYPE_QUAL |
5501 constants. */ | 5651 constants. */ |
5502 | 5652 |
5503 typedef int cp_cv_quals; | 5653 typedef int cp_cv_quals; |
5745 /* A level of template instantiation. */ | 5895 /* A level of template instantiation. */ |
5746 struct GTY((chain_next ("%h.next"))) tinst_level { | 5896 struct GTY((chain_next ("%h.next"))) tinst_level { |
5747 /* The immediately deeper level in the chain. */ | 5897 /* The immediately deeper level in the chain. */ |
5748 struct tinst_level *next; | 5898 struct tinst_level *next; |
5749 | 5899 |
5750 /* The original node. Can be either a DECL (for a function or static | 5900 /* The original node. TLDCL can be a DECL (for a function or static |
5751 data member) or a TYPE (for a class), depending on what we were | 5901 data member), a TYPE (for a class), depending on what we were |
5752 asked to instantiate. */ | 5902 asked to instantiate, or a TREE_LIST with the template as PURPOSE |
5753 tree decl; | 5903 and the template args as VALUE, if we are substituting for |
5904 overload resolution. In all these cases, TARGS is NULL. | |
5905 However, to avoid creating TREE_LIST objects for substitutions if | |
5906 we can help, we store PURPOSE and VALUE in TLDCL and TARGS, | |
5907 respectively. So TLDCL stands for TREE_LIST or DECL (the | |
5908 template is a DECL too), whereas TARGS stands for the template | |
5909 arguments. */ | |
5910 tree tldcl, targs; | |
5911 | |
5912 private: | |
5913 /* Return TRUE iff the original node is a split list. */ | |
5914 bool split_list_p () const { return targs; } | |
5915 | |
5916 /* Return TRUE iff the original node is a TREE_LIST object. */ | |
5917 bool tree_list_p () const | |
5918 { | |
5919 return !split_list_p () && TREE_CODE (tldcl) == TREE_LIST; | |
5920 } | |
5921 | |
5922 /* Return TRUE iff the original node is not a list, split or not. */ | |
5923 bool not_list_p () const | |
5924 { | |
5925 return !split_list_p () && !tree_list_p (); | |
5926 } | |
5927 | |
5928 /* Convert (in place) the original node from a split list to a | |
5929 TREE_LIST. */ | |
5930 tree to_list (); | |
5931 | |
5932 public: | |
5933 /* Release storage for OBJ and node, if it's a TREE_LIST. */ | |
5934 static void free (tinst_level *obj); | |
5935 | |
5936 /* Return TRUE iff the original node is a list, split or not. */ | |
5937 bool list_p () const { return !not_list_p (); } | |
5938 | |
5939 /* Return the original node; if it's a split list, make it a | |
5940 TREE_LIST first, so that it can be returned as a single tree | |
5941 object. */ | |
5942 tree get_node () { | |
5943 if (!split_list_p ()) return tldcl; | |
5944 else return to_list (); | |
5945 } | |
5946 | |
5947 /* Return the original node if it's a DECL or a TREE_LIST, but do | |
5948 NOT convert a split list to a TREE_LIST: return NULL instead. */ | |
5949 tree maybe_get_node () const { | |
5950 if (!split_list_p ()) return tldcl; | |
5951 else return NULL_TREE; | |
5952 } | |
5754 | 5953 |
5755 /* The location where the template is instantiated. */ | 5954 /* The location where the template is instantiated. */ |
5756 location_t locus; | 5955 location_t locus; |
5757 | 5956 |
5758 /* errorcount+sorrycount when we pushed this level. */ | 5957 /* errorcount + sorrycount when we pushed this level. */ |
5759 int errors; | 5958 unsigned short errors; |
5760 | 5959 |
5761 /* True if the location is in a system header. */ | 5960 /* Count references to this object. If refcount reaches |
5762 bool in_system_header_p; | 5961 refcount_infinity value, we don't increment or decrement the |
5962 refcount anymore, as the refcount isn't accurate anymore. | |
5963 The object can be still garbage collected if unreferenced from | |
5964 anywhere, which might keep referenced objects referenced longer than | |
5965 otherwise necessary. Hitting the infinity is rare though. */ | |
5966 unsigned short refcount; | |
5967 | |
5968 /* Infinity value for the above refcount. */ | |
5969 static const unsigned short refcount_infinity = (unsigned short) ~0; | |
5970 }; | |
5971 | |
5972 /* BUILT_IN_FRONTEND function codes. */ | |
5973 enum cp_built_in_function { | |
5974 CP_BUILT_IN_IS_CONSTANT_EVALUATED, | |
5975 CP_BUILT_IN_INTEGER_PACK, | |
5976 CP_BUILT_IN_LAST | |
5763 }; | 5977 }; |
5764 | 5978 |
5765 bool decl_spec_seq_has_spec_p (const cp_decl_specifier_seq *, cp_decl_spec); | 5979 bool decl_spec_seq_has_spec_p (const cp_decl_specifier_seq *, cp_decl_spec); |
5766 | 5980 |
5767 /* Return the type of the `this' parameter of FNTYPE. */ | 5981 /* Return the type of the `this' parameter of FNTYPE. */ |
5841 extern bool null_ptr_cst_p (tree); | 6055 extern bool null_ptr_cst_p (tree); |
5842 extern bool null_member_pointer_value_p (tree); | 6056 extern bool null_member_pointer_value_p (tree); |
5843 extern bool sufficient_parms_p (const_tree); | 6057 extern bool sufficient_parms_p (const_tree); |
5844 extern tree type_decays_to (tree); | 6058 extern tree type_decays_to (tree); |
5845 extern tree extract_call_expr (tree); | 6059 extern tree extract_call_expr (tree); |
6060 extern tree build_trivial_dtor_call (tree); | |
5846 extern tree build_user_type_conversion (tree, tree, int, | 6061 extern tree build_user_type_conversion (tree, tree, int, |
5847 tsubst_flags_t); | 6062 tsubst_flags_t); |
5848 extern tree build_new_function_call (tree, vec<tree, va_gc> **, | 6063 extern tree build_new_function_call (tree, vec<tree, va_gc> **, |
5849 tsubst_flags_t); | 6064 tsubst_flags_t); |
5850 extern tree build_operator_new_call (tree, vec<tree, va_gc> **, | 6065 extern tree build_operator_new_call (tree, vec<tree, va_gc> **, |
5870 extern bool can_convert_standard (tree, tree, tsubst_flags_t); | 6085 extern bool can_convert_standard (tree, tree, tsubst_flags_t); |
5871 extern bool can_convert_arg (tree, tree, tree, int, | 6086 extern bool can_convert_arg (tree, tree, tree, int, |
5872 tsubst_flags_t); | 6087 tsubst_flags_t); |
5873 extern bool can_convert_arg_bad (tree, tree, tree, int, | 6088 extern bool can_convert_arg_bad (tree, tree, tree, int, |
5874 tsubst_flags_t); | 6089 tsubst_flags_t); |
6090 extern int conv_flags (int, int, tree, tree, int); | |
6091 extern struct conversion * good_conversion (tree, tree, tree, int, tsubst_flags_t); | |
6092 extern location_t get_fndecl_argument_location (tree, int); | |
6093 extern void complain_about_bad_argument (location_t arg_loc, | |
6094 tree from_type, tree to_type, | |
6095 tree fndecl, int parmnum); | |
6096 | |
5875 | 6097 |
5876 /* A class for recording information about access failures (e.g. private | 6098 /* A class for recording information about access failures (e.g. private |
5877 fields), so that we can potentially supply a fix-it hint about | 6099 fields), so that we can potentially supply a fix-it hint about |
5878 an accessor (from a context in which the constness of the object | 6100 an accessor (from a context in which the constness of the object |
5879 is known). */ | 6101 is known). */ |
5880 | 6102 |
5881 class access_failure_info | 6103 class access_failure_info |
5882 { | 6104 { |
5883 public: | 6105 public: |
5884 access_failure_info () : m_was_inaccessible (false), m_basetype_path (NULL_TREE), | 6106 access_failure_info () : m_was_inaccessible (false), |
5885 m_field_decl (NULL_TREE) {} | 6107 m_basetype_path (NULL_TREE), |
5886 | 6108 m_decl (NULL_TREE), m_diag_decl (NULL_TREE) {} |
5887 void record_access_failure (tree basetype_path, tree field_decl); | 6109 |
6110 void record_access_failure (tree basetype_path, tree decl, tree diag_decl); | |
6111 | |
6112 bool was_inaccessible_p () const { return m_was_inaccessible; } | |
6113 tree get_decl () const { return m_decl; } | |
6114 tree get_diag_decl () const { return m_diag_decl; } | |
6115 tree get_any_accessor (bool const_p) const; | |
5888 void maybe_suggest_accessor (bool const_p) const; | 6116 void maybe_suggest_accessor (bool const_p) const; |
6117 static void add_fixit_hint (rich_location *richloc, tree accessor); | |
5889 | 6118 |
5890 private: | 6119 private: |
5891 bool m_was_inaccessible; | 6120 bool m_was_inaccessible; |
5892 tree m_basetype_path; | 6121 tree m_basetype_path; |
5893 tree m_field_decl; | 6122 tree m_decl; |
5894 }; | 6123 tree m_diag_decl; |
5895 | 6124 }; |
6125 | |
6126 extern void complain_about_access (tree, tree, bool); | |
5896 extern bool enforce_access (tree, tree, tree, | 6127 extern bool enforce_access (tree, tree, tree, |
5897 tsubst_flags_t, | 6128 tsubst_flags_t, |
5898 access_failure_info *afi = NULL); | 6129 access_failure_info *afi = NULL); |
5899 extern void push_defarg_context (tree); | 6130 extern void push_defarg_context (tree); |
5900 extern void pop_defarg_context (void); | 6131 extern void pop_defarg_context (void); |
5924 tsubst_flags_t); | 6155 tsubst_flags_t); |
5925 extern bool is_std_init_list (tree); | 6156 extern bool is_std_init_list (tree); |
5926 extern bool is_list_ctor (tree); | 6157 extern bool is_list_ctor (tree); |
5927 extern void validate_conversion_obstack (void); | 6158 extern void validate_conversion_obstack (void); |
5928 extern void mark_versions_used (tree); | 6159 extern void mark_versions_used (tree); |
6160 extern bool cp_warn_deprecated_use (tree, tsubst_flags_t = tf_warning_or_error); | |
5929 extern tree get_function_version_dispatcher (tree); | 6161 extern tree get_function_version_dispatcher (tree); |
5930 | 6162 |
5931 /* in class.c */ | 6163 /* in class.c */ |
5932 extern tree build_vfield_ref (tree, tree); | 6164 extern tree build_vfield_ref (tree, tree); |
5933 extern tree build_if_in_charge (tree true_stmt, tree false_stmt = void_node); | 6165 extern tree build_if_in_charge (tree true_stmt, tree false_stmt = void_node); |
5957 extern void pop_nested_class (void); | 6189 extern void pop_nested_class (void); |
5958 extern int current_lang_depth (void); | 6190 extern int current_lang_depth (void); |
5959 extern void push_lang_context (tree); | 6191 extern void push_lang_context (tree); |
5960 extern void pop_lang_context (void); | 6192 extern void pop_lang_context (void); |
5961 extern tree instantiate_type (tree, tree, tsubst_flags_t); | 6193 extern tree instantiate_type (tree, tree, tsubst_flags_t); |
5962 extern void print_class_statistics (void); | |
5963 extern void build_self_reference (void); | 6194 extern void build_self_reference (void); |
5964 extern int same_signature_p (const_tree, const_tree); | 6195 extern int same_signature_p (const_tree, const_tree); |
5965 extern void maybe_add_class_template_decl_list (tree, tree, int); | 6196 extern void maybe_add_class_template_decl_list (tree, tree, int); |
5966 extern void unreverse_member_declarations (tree); | 6197 extern void unreverse_member_declarations (tree); |
5967 extern void invalidate_class_lookup_cache (void); | 6198 extern void invalidate_class_lookup_cache (void); |
5986 extern tree default_init_uninitialized_part (tree); | 6217 extern tree default_init_uninitialized_part (tree); |
5987 extern bool trivial_default_constructor_is_constexpr (tree); | 6218 extern bool trivial_default_constructor_is_constexpr (tree); |
5988 extern bool type_has_constexpr_default_constructor (tree); | 6219 extern bool type_has_constexpr_default_constructor (tree); |
5989 extern bool type_has_virtual_destructor (tree); | 6220 extern bool type_has_virtual_destructor (tree); |
5990 extern bool classtype_has_move_assign_or_move_ctor_p (tree, bool user_declared); | 6221 extern bool classtype_has_move_assign_or_move_ctor_p (tree, bool user_declared); |
6222 extern bool classtype_has_non_deleted_move_ctor (tree); | |
6223 extern tree classtype_has_user_copy_or_dtor (tree); | |
5991 extern bool type_build_ctor_call (tree); | 6224 extern bool type_build_ctor_call (tree); |
5992 extern bool type_build_dtor_call (tree); | 6225 extern bool type_build_dtor_call (tree); |
5993 extern void explain_non_literal_class (tree); | 6226 extern void explain_non_literal_class (tree); |
5994 extern void inherit_targ_abi_tags (tree); | 6227 extern void inherit_targ_abi_tags (tree); |
5995 extern void defaulted_late_check (tree); | 6228 extern void defaulted_late_check (tree); |
6016 extern tree cp_convert (tree, tree, tsubst_flags_t); | 6249 extern tree cp_convert (tree, tree, tsubst_flags_t); |
6017 extern tree cp_convert_and_check (tree, tree, tsubst_flags_t); | 6250 extern tree cp_convert_and_check (tree, tree, tsubst_flags_t); |
6018 extern tree cp_fold_convert (tree, tree); | 6251 extern tree cp_fold_convert (tree, tree); |
6019 extern tree cp_get_callee (tree); | 6252 extern tree cp_get_callee (tree); |
6020 extern tree cp_get_callee_fndecl (tree); | 6253 extern tree cp_get_callee_fndecl (tree); |
6021 extern tree cp_get_fndecl_from_callee (tree); | 6254 extern tree cp_get_callee_fndecl_nofold (tree); |
6255 extern tree cp_get_fndecl_from_callee (tree, bool fold = true); | |
6022 extern tree convert_to_void (tree, impl_conv_void, | 6256 extern tree convert_to_void (tree, impl_conv_void, |
6023 tsubst_flags_t); | 6257 tsubst_flags_t); |
6024 extern tree convert_force (tree, tree, int, | 6258 extern tree convert_force (tree, tree, int, |
6025 tsubst_flags_t); | 6259 tsubst_flags_t); |
6026 extern tree build_expr_type_conversion (int, tree, bool); | 6260 extern tree build_expr_type_conversion (int, tree, bool); |
6033 extern tree strip_fnptr_conv (tree); | 6267 extern tree strip_fnptr_conv (tree); |
6034 | 6268 |
6035 /* in name-lookup.c */ | 6269 /* in name-lookup.c */ |
6036 extern void maybe_push_cleanup_level (tree); | 6270 extern void maybe_push_cleanup_level (tree); |
6037 extern tree make_anon_name (void); | 6271 extern tree make_anon_name (void); |
6038 extern tree check_for_out_of_scope_variable (tree); | |
6039 extern void dump (cp_binding_level &ref); | |
6040 extern void dump (cp_binding_level *ptr); | |
6041 extern void print_other_binding_stack (cp_binding_level *); | |
6042 extern tree maybe_push_decl (tree); | 6272 extern tree maybe_push_decl (tree); |
6043 extern tree current_decl_namespace (void); | 6273 extern tree current_decl_namespace (void); |
6044 | 6274 |
6045 /* decl.c */ | 6275 /* decl.c */ |
6046 extern tree poplevel (int, int, int); | 6276 extern tree poplevel (int, int, int); |
6048 enum cp_tree_node_structure_enum cp_tree_node_structure | 6278 enum cp_tree_node_structure_enum cp_tree_node_structure |
6049 (union lang_tree_node *); | 6279 (union lang_tree_node *); |
6050 extern void finish_scope (void); | 6280 extern void finish_scope (void); |
6051 extern void push_switch (tree); | 6281 extern void push_switch (tree); |
6052 extern void pop_switch (void); | 6282 extern void pop_switch (void); |
6283 extern void note_break_stmt (void); | |
6284 extern bool note_iteration_stmt_body_start (void); | |
6285 extern void note_iteration_stmt_body_end (bool); | |
6053 extern tree make_lambda_name (void); | 6286 extern tree make_lambda_name (void); |
6054 extern int decls_match (tree, tree); | 6287 extern int decls_match (tree, tree, bool = true); |
6055 extern bool maybe_version_functions (tree, tree); | 6288 extern bool maybe_version_functions (tree, tree, bool); |
6056 extern tree duplicate_decls (tree, tree, bool); | 6289 extern tree duplicate_decls (tree, tree, bool); |
6057 extern tree declare_local_label (tree); | 6290 extern tree declare_local_label (tree); |
6058 extern tree define_label (location_t, tree); | 6291 extern tree define_label (location_t, tree); |
6059 extern void check_goto (tree); | 6292 extern void check_goto (tree); |
6060 extern bool check_omp_return (void); | 6293 extern bool check_omp_return (void); |
6074 extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree, tree *); | 6307 extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree, tree *); |
6075 extern void start_decl_1 (tree, bool); | 6308 extern void start_decl_1 (tree, bool); |
6076 extern bool check_array_initializer (tree, tree, tree); | 6309 extern bool check_array_initializer (tree, tree, tree); |
6077 extern void cp_finish_decl (tree, tree, bool, tree, int); | 6310 extern void cp_finish_decl (tree, tree, bool, tree, int); |
6078 extern tree lookup_decomp_type (tree); | 6311 extern tree lookup_decomp_type (tree); |
6312 extern void cp_maybe_mangle_decomp (tree, tree, unsigned int); | |
6079 extern void cp_finish_decomp (tree, tree, unsigned int); | 6313 extern void cp_finish_decomp (tree, tree, unsigned int); |
6080 extern int cp_complete_array_type (tree *, tree, bool); | 6314 extern int cp_complete_array_type (tree *, tree, bool); |
6081 extern int cp_complete_array_type_or_error (tree *, tree, bool, tsubst_flags_t); | 6315 extern int cp_complete_array_type_or_error (tree *, tree, bool, tsubst_flags_t); |
6082 extern tree build_ptrmemfunc_type (tree); | 6316 extern tree build_ptrmemfunc_type (tree); |
6083 extern tree build_ptrmem_type (tree, tree); | 6317 extern tree build_ptrmem_type (tree, tree); |
6136 extern bool undeduced_auto_decl (tree); | 6370 extern bool undeduced_auto_decl (tree); |
6137 extern bool require_deduced_type (tree, tsubst_flags_t = tf_warning_or_error); | 6371 extern bool require_deduced_type (tree, tsubst_flags_t = tf_warning_or_error); |
6138 | 6372 |
6139 extern tree finish_case_label (location_t, tree, tree); | 6373 extern tree finish_case_label (location_t, tree, tree); |
6140 extern tree cxx_maybe_build_cleanup (tree, tsubst_flags_t); | 6374 extern tree cxx_maybe_build_cleanup (tree, tsubst_flags_t); |
6375 extern bool check_array_designated_initializer (constructor_elt *, | |
6376 unsigned HOST_WIDE_INT); | |
6377 extern bool check_for_uninitialized_const_var (tree, bool, tsubst_flags_t); | |
6141 | 6378 |
6142 /* in decl2.c */ | 6379 /* in decl2.c */ |
6143 extern void record_mangling (tree, bool); | 6380 extern void record_mangling (tree, bool); |
6381 extern void overwrite_mangling (tree, tree); | |
6144 extern void note_mangling_alias (tree, tree); | 6382 extern void note_mangling_alias (tree, tree); |
6145 extern void generate_mangling_aliases (void); | 6383 extern void generate_mangling_aliases (void); |
6146 extern tree build_memfn_type (tree, tree, cp_cv_quals, cp_ref_qualifier); | 6384 extern tree build_memfn_type (tree, tree, cp_cv_quals, cp_ref_qualifier); |
6147 extern tree build_pointer_ptrmemfn_type (tree); | 6385 extern tree build_pointer_ptrmemfn_type (tree); |
6148 extern tree change_return_type (tree, tree); | 6386 extern tree change_return_type (tree, tree); |
6163 extern tree cp_reconstruct_complex_type (tree, tree); | 6401 extern tree cp_reconstruct_complex_type (tree, tree); |
6164 extern bool attributes_naming_typedef_ok (tree); | 6402 extern bool attributes_naming_typedef_ok (tree); |
6165 extern void cplus_decl_attributes (tree *, tree, int); | 6403 extern void cplus_decl_attributes (tree *, tree, int); |
6166 extern void finish_anon_union (tree); | 6404 extern void finish_anon_union (tree); |
6167 extern void cxx_post_compilation_parsing_cleanups (void); | 6405 extern void cxx_post_compilation_parsing_cleanups (void); |
6168 extern tree coerce_new_type (tree); | 6406 extern tree coerce_new_type (tree, location_t); |
6169 extern tree coerce_delete_type (tree); | 6407 extern tree coerce_delete_type (tree, location_t); |
6170 extern void comdat_linkage (tree); | 6408 extern void comdat_linkage (tree); |
6171 extern void determine_visibility (tree); | 6409 extern void determine_visibility (tree); |
6172 extern void constrain_class_visibility (tree); | 6410 extern void constrain_class_visibility (tree); |
6173 extern void reset_type_linkage (tree); | 6411 extern void reset_type_linkage (tree); |
6174 extern void tentative_decl_linkage (tree); | 6412 extern void tentative_decl_linkage (tree); |
6230 extern bool expr_noexcept_p (tree, tsubst_flags_t); | 6468 extern bool expr_noexcept_p (tree, tsubst_flags_t); |
6231 extern void perform_deferred_noexcept_checks (void); | 6469 extern void perform_deferred_noexcept_checks (void); |
6232 extern bool nothrow_spec_p (const_tree); | 6470 extern bool nothrow_spec_p (const_tree); |
6233 extern bool type_noexcept_p (const_tree); | 6471 extern bool type_noexcept_p (const_tree); |
6234 extern bool type_throw_all_p (const_tree); | 6472 extern bool type_throw_all_p (const_tree); |
6235 extern tree build_noexcept_spec (tree, int); | 6473 extern tree build_noexcept_spec (tree, tsubst_flags_t); |
6236 extern void choose_personality_routine (enum languages); | 6474 extern void choose_personality_routine (enum languages); |
6237 extern tree build_must_not_throw_expr (tree,tree); | 6475 extern tree build_must_not_throw_expr (tree,tree); |
6238 extern tree eh_type_info (tree); | 6476 extern tree eh_type_info (tree); |
6239 extern tree begin_eh_spec_block (void); | 6477 extern tree begin_eh_spec_block (void); |
6240 extern void finish_eh_spec_block (tree, tree); | 6478 extern void finish_eh_spec_block (tree, tree); |
6242 extern tree cp_protect_cleanup_actions (void); | 6480 extern tree cp_protect_cleanup_actions (void); |
6243 extern tree create_try_catch_expr (tree, tree); | 6481 extern tree create_try_catch_expr (tree, tree); |
6244 | 6482 |
6245 /* in expr.c */ | 6483 /* in expr.c */ |
6246 extern tree cplus_expand_constant (tree); | 6484 extern tree cplus_expand_constant (tree); |
6485 extern tree mark_use (tree expr, bool rvalue_p, bool read_p, | |
6486 location_t = UNKNOWN_LOCATION, | |
6487 bool reject_builtin = true); | |
6247 extern tree mark_rvalue_use (tree, | 6488 extern tree mark_rvalue_use (tree, |
6248 location_t = UNKNOWN_LOCATION, | 6489 location_t = UNKNOWN_LOCATION, |
6249 bool = true); | 6490 bool reject_builtin = true); |
6250 extern tree mark_lvalue_use (tree); | 6491 extern tree mark_lvalue_use (tree); |
6251 extern tree mark_lvalue_use_nonread (tree); | 6492 extern tree mark_lvalue_use_nonread (tree); |
6252 extern tree mark_type_use (tree); | 6493 extern tree mark_type_use (tree); |
6253 extern tree mark_discarded_use (tree); | 6494 extern tree mark_discarded_use (tree); |
6254 extern void mark_exp_read (tree); | 6495 extern void mark_exp_read (tree); |
6255 | 6496 |
6256 /* friend.c */ | 6497 /* friend.c */ |
6257 extern int is_friend (tree, tree); | 6498 extern int is_friend (tree, tree); |
6258 extern void make_friend_class (tree, tree, bool); | 6499 extern void make_friend_class (tree, tree, bool); |
6259 extern void add_friend (tree, tree, bool); | 6500 extern void add_friend (tree, tree, bool); |
6260 extern tree do_friend (tree, tree, tree, tree, enum overload_flags, bool); | 6501 extern tree do_friend (tree, tree, tree, tree, |
6502 enum overload_flags, bool); | |
6261 | 6503 |
6262 extern void set_global_friend (tree); | 6504 extern void set_global_friend (tree); |
6263 extern bool is_global_friend (tree); | 6505 extern bool is_global_friend (tree); |
6264 | 6506 |
6265 /* in init.c */ | 6507 /* in init.c */ |
6311 extern tree build_lang_decl_loc (location_t, enum tree_code, tree, tree); | 6553 extern tree build_lang_decl_loc (location_t, enum tree_code, tree, tree); |
6312 extern void retrofit_lang_decl (tree); | 6554 extern void retrofit_lang_decl (tree); |
6313 extern void fit_decomposition_lang_decl (tree, tree); | 6555 extern void fit_decomposition_lang_decl (tree, tree); |
6314 extern tree copy_decl (tree CXX_MEM_STAT_INFO); | 6556 extern tree copy_decl (tree CXX_MEM_STAT_INFO); |
6315 extern tree copy_type (tree CXX_MEM_STAT_INFO); | 6557 extern tree copy_type (tree CXX_MEM_STAT_INFO); |
6316 extern tree cxx_make_type (enum tree_code); | 6558 extern tree cxx_make_type (enum tree_code CXX_MEM_STAT_INFO); |
6317 extern tree make_class_type (enum tree_code); | 6559 extern tree make_class_type (enum tree_code CXX_MEM_STAT_INFO); |
6318 extern const char *get_identifier_kind_name (tree); | 6560 extern const char *get_identifier_kind_name (tree); |
6319 extern void set_identifier_kind (tree, cp_identifier_kind); | 6561 extern void set_identifier_kind (tree, cp_identifier_kind); |
6320 extern bool cxx_init (void); | 6562 extern bool cxx_init (void); |
6321 extern void cxx_finish (void); | 6563 extern void cxx_finish (void); |
6322 extern bool in_main_input_context (void); | 6564 extern bool in_main_input_context (void); |
6354 | 6596 |
6355 /* In optimize.c */ | 6597 /* In optimize.c */ |
6356 extern bool maybe_clone_body (tree); | 6598 extern bool maybe_clone_body (tree); |
6357 | 6599 |
6358 /* In parser.c */ | 6600 /* In parser.c */ |
6359 extern tree cp_convert_range_for (tree, tree, tree, tree, unsigned int, bool); | 6601 extern tree cp_convert_range_for (tree, tree, tree, tree, unsigned int, bool, |
6602 unsigned short); | |
6360 extern bool parsing_nsdmi (void); | 6603 extern bool parsing_nsdmi (void); |
6361 extern bool parsing_default_capturing_generic_lambda_in_template (void); | 6604 extern bool parsing_default_capturing_generic_lambda_in_template (void); |
6362 extern void inject_this_parameter (tree, cp_cv_quals); | 6605 extern void inject_this_parameter (tree, cp_cv_quals); |
6363 extern location_t defarg_location (tree); | 6606 extern location_t defarg_location (tree); |
6364 extern void maybe_show_extern_c_location (void); | 6607 extern void maybe_show_extern_c_location (void); |
6608 extern bool literal_integer_zerop (const_tree); | |
6365 | 6609 |
6366 /* in pt.c */ | 6610 /* in pt.c */ |
6367 extern bool check_template_shadow (tree); | 6611 extern bool check_template_shadow (tree); |
6612 extern bool check_auto_in_tmpl_args (tree, tree); | |
6368 extern tree get_innermost_template_args (tree, int); | 6613 extern tree get_innermost_template_args (tree, int); |
6369 extern void maybe_begin_member_template_processing (tree); | 6614 extern void maybe_begin_member_template_processing (tree); |
6370 extern void maybe_end_member_template_processing (void); | 6615 extern void maybe_end_member_template_processing (void); |
6371 extern tree finish_member_template_decl (tree); | 6616 extern tree finish_member_template_decl (tree); |
6372 extern void begin_template_parm_list (void); | 6617 extern void begin_template_parm_list (void); |
6374 extern void reset_specialization (void); | 6619 extern void reset_specialization (void); |
6375 extern void end_specialization (void); | 6620 extern void end_specialization (void); |
6376 extern void begin_explicit_instantiation (void); | 6621 extern void begin_explicit_instantiation (void); |
6377 extern void end_explicit_instantiation (void); | 6622 extern void end_explicit_instantiation (void); |
6378 extern void check_unqualified_spec_or_inst (tree, location_t); | 6623 extern void check_unqualified_spec_or_inst (tree, location_t); |
6379 extern tree check_explicit_specialization (tree, tree, int, int); | 6624 extern tree check_explicit_specialization (tree, tree, int, int, |
6625 tree = NULL_TREE); | |
6380 extern int num_template_headers_for_class (tree); | 6626 extern int num_template_headers_for_class (tree); |
6381 extern void check_template_variable (tree); | 6627 extern void check_template_variable (tree); |
6382 extern tree make_auto (void); | 6628 extern tree make_auto (void); |
6383 extern tree make_decltype_auto (void); | 6629 extern tree make_decltype_auto (void); |
6384 extern tree make_template_placeholder (tree); | 6630 extern tree make_template_placeholder (tree); |
6385 extern bool template_placeholder_p (tree); | 6631 extern bool template_placeholder_p (tree); |
6386 extern tree do_auto_deduction (tree, tree, tree); | |
6387 extern tree do_auto_deduction (tree, tree, tree, | 6632 extern tree do_auto_deduction (tree, tree, tree, |
6388 tsubst_flags_t, | 6633 tsubst_flags_t |
6389 auto_deduction_context, | 6634 = tf_warning_or_error, |
6635 auto_deduction_context | |
6636 = adc_unspecified, | |
6390 tree = NULL_TREE, | 6637 tree = NULL_TREE, |
6391 int = LOOKUP_NORMAL); | 6638 int = LOOKUP_NORMAL); |
6392 extern tree type_uses_auto (tree); | 6639 extern tree type_uses_auto (tree); |
6393 extern tree type_uses_auto_or_concept (tree); | 6640 extern tree type_uses_auto_or_concept (tree); |
6394 extern void append_type_to_template_for_access_check (tree, tree, tree, | 6641 extern void append_type_to_template_for_access_check (tree, tree, tree, |
6413 extern tree lookup_template_variable (tree, tree); | 6660 extern tree lookup_template_variable (tree, tree); |
6414 extern int uses_template_parms (tree); | 6661 extern int uses_template_parms (tree); |
6415 extern bool uses_template_parms_level (tree, int); | 6662 extern bool uses_template_parms_level (tree, int); |
6416 extern bool in_template_function (void); | 6663 extern bool in_template_function (void); |
6417 extern bool need_generic_capture (void); | 6664 extern bool need_generic_capture (void); |
6418 extern bool processing_nonlambda_template (void); | |
6419 extern tree instantiate_class_template (tree); | 6665 extern tree instantiate_class_template (tree); |
6420 extern tree instantiate_template (tree, tree, tsubst_flags_t); | 6666 extern tree instantiate_template (tree, tree, tsubst_flags_t); |
6421 extern tree fn_type_unification (tree, tree, tree, | 6667 extern tree fn_type_unification (tree, tree, tree, |
6422 const tree *, unsigned int, | 6668 const tree *, unsigned int, |
6423 tree, unification_kind_t, int, | 6669 tree, unification_kind_t, int, |
6670 struct conversion **, | |
6424 bool, bool); | 6671 bool, bool); |
6425 extern void mark_decl_instantiated (tree, int); | 6672 extern void mark_decl_instantiated (tree, int); |
6426 extern int more_specialized_fn (tree, tree, int); | 6673 extern int more_specialized_fn (tree, tree, int); |
6427 extern void do_decl_instantiation (tree, tree); | 6674 extern void do_decl_instantiation (tree, tree); |
6428 extern void do_type_instantiation (tree, tree, tsubst_flags_t); | 6675 extern void do_type_instantiation (tree, tree, tsubst_flags_t); |
6433 extern bool builtin_pack_fn_p (tree); | 6680 extern bool builtin_pack_fn_p (tree); |
6434 extern bool uses_parameter_packs (tree); | 6681 extern bool uses_parameter_packs (tree); |
6435 extern bool template_parameter_pack_p (const_tree); | 6682 extern bool template_parameter_pack_p (const_tree); |
6436 extern bool function_parameter_pack_p (const_tree); | 6683 extern bool function_parameter_pack_p (const_tree); |
6437 extern bool function_parameter_expanded_from_pack_p (tree, tree); | 6684 extern bool function_parameter_expanded_from_pack_p (tree, tree); |
6438 extern tree make_pack_expansion (tree); | 6685 extern tree make_pack_expansion (tree, tsubst_flags_t = tf_warning_or_error); |
6439 extern bool check_for_bare_parameter_packs (tree); | 6686 extern bool check_for_bare_parameter_packs (tree, location_t = UNKNOWN_LOCATION); |
6440 extern tree build_template_info (tree, tree); | 6687 extern tree build_template_info (tree, tree); |
6441 extern tree get_template_info (const_tree); | 6688 extern tree get_template_info (const_tree); |
6442 extern vec<qualified_typedef_usage_t, va_gc> *get_types_needing_access_check (tree); | 6689 extern vec<qualified_typedef_usage_t, va_gc> *get_types_needing_access_check (tree); |
6443 extern int template_class_depth (tree); | 6690 extern int template_class_depth (tree); |
6444 extern int is_specialization_of (tree, tree); | 6691 extern int is_specialization_of (tree, tree); |
6468 extern tree maybe_get_template_decl_from_type_decl (tree); | 6715 extern tree maybe_get_template_decl_from_type_decl (tree); |
6469 extern int processing_template_parmlist; | 6716 extern int processing_template_parmlist; |
6470 extern bool dependent_type_p (tree); | 6717 extern bool dependent_type_p (tree); |
6471 extern bool dependent_scope_p (tree); | 6718 extern bool dependent_scope_p (tree); |
6472 extern bool any_dependent_template_arguments_p (const_tree); | 6719 extern bool any_dependent_template_arguments_p (const_tree); |
6720 extern bool any_erroneous_template_args_p (const_tree); | |
6473 extern bool dependent_template_p (tree); | 6721 extern bool dependent_template_p (tree); |
6474 extern bool dependent_template_id_p (tree, tree); | 6722 extern bool dependent_template_id_p (tree, tree); |
6475 extern bool type_dependent_expression_p (tree); | 6723 extern bool type_dependent_expression_p (tree); |
6476 extern bool type_dependent_object_expression_p (tree); | 6724 extern bool type_dependent_object_expression_p (tree); |
6477 extern bool any_type_dependent_arguments_p (const vec<tree, va_gc> *); | 6725 extern bool any_type_dependent_arguments_p (const vec<tree, va_gc> *); |
6502 extern struct tinst_level *outermost_tinst_level(void); | 6750 extern struct tinst_level *outermost_tinst_level(void); |
6503 extern void init_template_processing (void); | 6751 extern void init_template_processing (void); |
6504 extern void print_template_statistics (void); | 6752 extern void print_template_statistics (void); |
6505 bool template_template_parameter_p (const_tree); | 6753 bool template_template_parameter_p (const_tree); |
6506 bool template_type_parameter_p (const_tree); | 6754 bool template_type_parameter_p (const_tree); |
6507 extern bool primary_template_instantiation_p (const_tree); | 6755 extern bool primary_template_specialization_p (const_tree); |
6508 extern tree get_primary_template_innermost_parameters (const_tree); | 6756 extern tree get_primary_template_innermost_parameters (const_tree); |
6509 extern tree get_template_parms_at_level (tree, int); | 6757 extern tree get_template_parms_at_level (tree, int); |
6510 extern tree get_template_innermost_arguments (const_tree); | 6758 extern tree get_template_innermost_arguments (const_tree); |
6511 extern tree get_template_argument_pack_elems (const_tree); | 6759 extern tree get_template_argument_pack_elems (const_tree); |
6512 extern tree get_function_template_decl (const_tree); | 6760 extern tree get_function_template_decl (const_tree); |
6616 /* RAII sentinel to ensures that deferred access checks are popped before | 6864 /* RAII sentinel to ensures that deferred access checks are popped before |
6617 a function returns. */ | 6865 a function returns. */ |
6618 | 6866 |
6619 struct deferring_access_check_sentinel | 6867 struct deferring_access_check_sentinel |
6620 { | 6868 { |
6621 deferring_access_check_sentinel () | 6869 deferring_access_check_sentinel (enum deferring_kind kind = dk_deferred) |
6622 { | 6870 { |
6623 push_deferring_access_checks (dk_deferred); | 6871 push_deferring_access_checks (kind); |
6624 } | 6872 } |
6625 ~deferring_access_check_sentinel () | 6873 ~deferring_access_check_sentinel () |
6626 { | 6874 { |
6627 pop_deferring_access_checks (); | 6875 pop_deferring_access_checks (); |
6628 } | 6876 } |
6640 extern tree finish_then_clause (tree); | 6888 extern tree finish_then_clause (tree); |
6641 extern void begin_else_clause (tree); | 6889 extern void begin_else_clause (tree); |
6642 extern void finish_else_clause (tree); | 6890 extern void finish_else_clause (tree); |
6643 extern void finish_if_stmt (tree); | 6891 extern void finish_if_stmt (tree); |
6644 extern tree begin_while_stmt (void); | 6892 extern tree begin_while_stmt (void); |
6645 extern void finish_while_stmt_cond (tree, tree, bool); | 6893 extern void finish_while_stmt_cond (tree, tree, bool, unsigned short); |
6646 extern void finish_while_stmt (tree); | 6894 extern void finish_while_stmt (tree); |
6647 extern tree begin_do_stmt (void); | 6895 extern tree begin_do_stmt (void); |
6648 extern void finish_do_body (tree); | 6896 extern void finish_do_body (tree); |
6649 extern void finish_do_stmt (tree, tree, bool); | 6897 extern void finish_do_stmt (tree, tree, bool, unsigned short); |
6650 extern tree finish_return_stmt (tree); | 6898 extern tree finish_return_stmt (tree); |
6651 extern tree begin_for_scope (tree *); | 6899 extern tree begin_for_scope (tree *); |
6652 extern tree begin_for_stmt (tree, tree); | 6900 extern tree begin_for_stmt (tree, tree); |
6653 extern void finish_init_stmt (tree); | 6901 extern void finish_init_stmt (tree); |
6654 extern void finish_for_cond (tree, tree, bool); | 6902 extern void finish_for_cond (tree, tree, bool, unsigned short); |
6655 extern void finish_for_expr (tree, tree); | 6903 extern void finish_for_expr (tree, tree); |
6656 extern void finish_for_stmt (tree); | 6904 extern void finish_for_stmt (tree); |
6657 extern tree begin_range_for_stmt (tree, tree); | 6905 extern tree begin_range_for_stmt (tree, tree); |
6658 extern void finish_range_for_decl (tree, tree, tree); | 6906 extern void finish_range_for_decl (tree, tree, tree); |
6659 extern void finish_range_for_stmt (tree); | 6907 extern void finish_range_for_stmt (tree); |
6691 extern tree finish_label_stmt (tree); | 6939 extern tree finish_label_stmt (tree); |
6692 extern void finish_label_decl (tree); | 6940 extern void finish_label_decl (tree); |
6693 extern cp_expr finish_parenthesized_expr (cp_expr); | 6941 extern cp_expr finish_parenthesized_expr (cp_expr); |
6694 extern tree force_paren_expr (tree); | 6942 extern tree force_paren_expr (tree); |
6695 extern tree maybe_undo_parenthesized_ref (tree); | 6943 extern tree maybe_undo_parenthesized_ref (tree); |
6944 extern tree maybe_strip_ref_conversion (tree); | |
6696 extern tree finish_non_static_data_member (tree, tree, tree); | 6945 extern tree finish_non_static_data_member (tree, tree, tree); |
6697 extern tree begin_stmt_expr (void); | 6946 extern tree begin_stmt_expr (void); |
6698 extern tree finish_stmt_expr_expr (tree, tree); | 6947 extern tree finish_stmt_expr_expr (tree, tree); |
6699 extern tree finish_stmt_expr (tree, bool); | 6948 extern tree finish_stmt_expr (tree, bool); |
6700 extern tree stmt_expr_value_expr (tree); | 6949 extern tree stmt_expr_value_expr (tree); |
6731 bool, bool, bool, bool, | 6980 bool, bool, bool, bool, |
6732 const char **, | 6981 const char **, |
6733 location_t); | 6982 location_t); |
6734 extern tree finish_typeof (tree); | 6983 extern tree finish_typeof (tree); |
6735 extern tree finish_underlying_type (tree); | 6984 extern tree finish_underlying_type (tree); |
6736 extern tree calculate_bases (tree); | 6985 extern tree calculate_bases (tree, tsubst_flags_t); |
6737 extern tree finish_bases (tree, bool); | 6986 extern tree finish_bases (tree, bool); |
6738 extern tree calculate_direct_bases (tree); | 6987 extern tree calculate_direct_bases (tree, tsubst_flags_t); |
6739 extern tree finish_offsetof (tree, tree, location_t); | 6988 extern tree finish_offsetof (tree, tree, location_t); |
6740 extern void finish_decl_cleanup (tree, tree); | 6989 extern void finish_decl_cleanup (tree, tree); |
6741 extern void finish_eh_cleanup (tree); | 6990 extern void finish_eh_cleanup (tree); |
6742 extern void emit_associated_thunks (tree); | 6991 extern void emit_associated_thunks (tree); |
6743 extern void finish_mem_initializers (tree); | 6992 extern void finish_mem_initializers (tree); |
6801 extern tree lambda_proxy_type (tree); | 7050 extern tree lambda_proxy_type (tree); |
6802 extern tree lambda_function (tree); | 7051 extern tree lambda_function (tree); |
6803 extern void apply_deduced_return_type (tree, tree); | 7052 extern void apply_deduced_return_type (tree, tree); |
6804 extern tree add_capture (tree, tree, tree, bool, bool); | 7053 extern tree add_capture (tree, tree, tree, bool, bool); |
6805 extern tree add_default_capture (tree, tree, tree); | 7054 extern tree add_default_capture (tree, tree, tree); |
6806 extern tree build_capture_proxy (tree, tree); | |
6807 extern void insert_capture_proxy (tree); | 7055 extern void insert_capture_proxy (tree); |
6808 extern void insert_pending_capture_proxies (void); | 7056 extern void insert_pending_capture_proxies (void); |
6809 extern bool is_capture_proxy (tree); | 7057 extern bool is_capture_proxy (tree); |
6810 extern bool is_normal_capture_proxy (tree); | 7058 extern bool is_normal_capture_proxy (tree); |
7059 extern bool is_constant_capture_proxy (tree); | |
6811 extern void register_capture_members (tree); | 7060 extern void register_capture_members (tree); |
6812 extern tree lambda_expr_this_capture (tree, bool); | 7061 extern tree lambda_expr_this_capture (tree, bool); |
6813 extern void maybe_generic_this_capture (tree, tree); | 7062 extern void maybe_generic_this_capture (tree, tree); |
6814 extern tree maybe_resolve_dummy (tree, bool); | 7063 extern tree maybe_resolve_dummy (tree, bool); |
6815 extern tree current_nonlambda_function (void); | 7064 extern tree current_nonlambda_function (void); |
6816 extern tree nonlambda_method_basetype (void); | 7065 extern tree nonlambda_method_basetype (void); |
6817 extern tree current_nonlambda_scope (void); | 7066 extern tree current_nonlambda_scope (void); |
7067 extern tree current_lambda_expr (void); | |
6818 extern bool generic_lambda_fn_p (tree); | 7068 extern bool generic_lambda_fn_p (tree); |
6819 extern tree do_dependent_capture (tree, bool = false); | 7069 extern tree do_dependent_capture (tree, bool = false); |
6820 extern bool lambda_fn_in_template_p (tree); | 7070 extern bool lambda_fn_in_template_p (tree); |
6821 extern void maybe_add_lambda_conv_op (tree); | 7071 extern void maybe_add_lambda_conv_op (tree); |
6822 extern bool is_lambda_ignored_entity (tree); | 7072 extern bool is_lambda_ignored_entity (tree); |
6823 extern bool lambda_static_thunk_p (tree); | 7073 extern bool lambda_static_thunk_p (tree); |
6824 extern tree finish_builtin_launder (location_t, tree, | 7074 extern tree finish_builtin_launder (location_t, tree, |
6825 tsubst_flags_t); | 7075 tsubst_flags_t); |
6826 extern void start_lambda_scope (tree); | 7076 extern void start_lambda_scope (tree); |
6827 extern void record_lambda_scope (tree); | 7077 extern void record_lambda_scope (tree); |
7078 extern void record_null_lambda_scope (tree); | |
6828 extern void finish_lambda_scope (void); | 7079 extern void finish_lambda_scope (void); |
6829 extern tree start_lambda_function (tree fn, tree lambda_expr); | 7080 extern tree start_lambda_function (tree fn, tree lambda_expr); |
6830 extern void finish_lambda_function (tree body); | 7081 extern void finish_lambda_function (tree body); |
6831 | 7082 |
6832 /* in tree.c */ | 7083 /* in tree.c */ |
6884 extern tree get_target_expr (tree); | 7135 extern tree get_target_expr (tree); |
6885 extern tree get_target_expr_sfinae (tree, tsubst_flags_t); | 7136 extern tree get_target_expr_sfinae (tree, tsubst_flags_t); |
6886 extern tree build_cplus_array_type (tree, tree); | 7137 extern tree build_cplus_array_type (tree, tree); |
6887 extern tree build_array_of_n_type (tree, int); | 7138 extern tree build_array_of_n_type (tree, int); |
6888 extern bool array_of_runtime_bound_p (tree); | 7139 extern bool array_of_runtime_bound_p (tree); |
7140 extern bool vla_type_p (tree); | |
6889 extern tree build_array_copy (tree); | 7141 extern tree build_array_copy (tree); |
6890 extern tree build_vec_init_expr (tree, tree, tsubst_flags_t); | 7142 extern tree build_vec_init_expr (tree, tree, tsubst_flags_t); |
6891 extern void diagnose_non_constexpr_vec_init (tree); | 7143 extern void diagnose_non_constexpr_vec_init (tree); |
6892 extern tree hash_tree_cons (tree, tree, tree); | 7144 extern tree hash_tree_cons (tree, tree, tree); |
6893 extern tree hash_tree_chain (tree, tree); | 7145 extern tree hash_tree_chain (tree, tree); |
6901 extern tree ovl_skip_hidden (tree) ATTRIBUTE_PURE; | 7153 extern tree ovl_skip_hidden (tree) ATTRIBUTE_PURE; |
6902 extern void lookup_mark (tree lookup, bool val); | 7154 extern void lookup_mark (tree lookup, bool val); |
6903 extern tree lookup_add (tree fns, tree lookup); | 7155 extern tree lookup_add (tree fns, tree lookup); |
6904 extern tree lookup_maybe_add (tree fns, tree lookup, | 7156 extern tree lookup_maybe_add (tree fns, tree lookup, |
6905 bool deduping); | 7157 bool deduping); |
6906 extern void lookup_keep (tree lookup, bool keep); | 7158 extern void lookup_keep (tree lookup); |
6907 extern int is_overloaded_fn (tree) ATTRIBUTE_PURE; | 7159 extern int is_overloaded_fn (tree) ATTRIBUTE_PURE; |
6908 extern bool really_overloaded_fn (tree) ATTRIBUTE_PURE; | 7160 extern bool really_overloaded_fn (tree) ATTRIBUTE_PURE; |
6909 extern tree dependent_name (tree); | 7161 extern tree dependent_name (tree); |
7162 extern tree maybe_get_fns (tree) ATTRIBUTE_PURE; | |
6910 extern tree get_fns (tree) ATTRIBUTE_PURE; | 7163 extern tree get_fns (tree) ATTRIBUTE_PURE; |
6911 extern tree get_first_fn (tree) ATTRIBUTE_PURE; | 7164 extern tree get_first_fn (tree) ATTRIBUTE_PURE; |
6912 extern tree ovl_scope (tree); | 7165 extern tree ovl_scope (tree); |
6913 extern const char *cxx_printable_name (tree, int); | 7166 extern const char *cxx_printable_name (tree, int); |
6914 extern const char *cxx_printable_name_translate (tree, int); | 7167 extern const char *cxx_printable_name_translate (tree, int); |
6915 extern tree canonical_eh_spec (tree); | 7168 extern tree canonical_eh_spec (tree); |
7169 extern tree build_cp_fntype_variant (tree, cp_ref_qualifier, tree, bool); | |
6916 extern tree build_exception_variant (tree, tree); | 7170 extern tree build_exception_variant (tree, tree); |
6917 extern tree bind_template_template_parm (tree, tree); | 7171 extern tree bind_template_template_parm (tree, tree); |
6918 extern tree array_type_nelts_total (tree); | 7172 extern tree array_type_nelts_total (tree); |
6919 extern tree array_type_nelts_top (tree); | 7173 extern tree array_type_nelts_top (tree); |
6920 extern tree break_out_target_exprs (tree); | 7174 extern tree break_out_target_exprs (tree, bool = false); |
6921 extern tree build_ctor_subob_ref (tree, tree, tree); | 7175 extern tree build_ctor_subob_ref (tree, tree, tree); |
6922 extern tree replace_placeholders (tree, tree, bool * = NULL); | 7176 extern tree replace_placeholders (tree, tree, bool * = NULL); |
7177 extern bool find_placeholders (tree); | |
6923 extern tree get_type_decl (tree); | 7178 extern tree get_type_decl (tree); |
6924 extern tree decl_namespace_context (tree); | 7179 extern tree decl_namespace_context (tree); |
6925 extern bool decl_anon_ns_mem_p (const_tree); | 7180 extern bool decl_anon_ns_mem_p (const_tree); |
6926 extern tree lvalue_type (tree); | 7181 extern tree lvalue_type (tree); |
6927 extern tree error_type (tree); | 7182 extern tree error_type (tree); |
6991 extern bool compparms (const_tree, const_tree); | 7246 extern bool compparms (const_tree, const_tree); |
6992 extern int comp_cv_qualification (const_tree, const_tree); | 7247 extern int comp_cv_qualification (const_tree, const_tree); |
6993 extern int comp_cv_qualification (int, int); | 7248 extern int comp_cv_qualification (int, int); |
6994 extern int comp_cv_qual_signature (tree, tree); | 7249 extern int comp_cv_qual_signature (tree, tree); |
6995 extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code, bool); | 7250 extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code, bool); |
6996 extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); | 7251 extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool, bool); |
6997 extern tree cxx_alignas_expr (tree); | 7252 extern tree cxx_alignas_expr (tree); |
6998 extern tree cxx_sizeof_nowarn (tree); | 7253 extern tree cxx_sizeof_nowarn (tree); |
6999 extern tree is_bitfield_expr_with_lowered_type (const_tree); | 7254 extern tree is_bitfield_expr_with_lowered_type (const_tree); |
7000 extern tree unlowered_expr_type (const_tree); | 7255 extern tree unlowered_expr_type (const_tree); |
7001 extern tree decay_conversion (tree, | 7256 extern tree decay_conversion (tree, |
7007 tsubst_flags_t); | 7262 tsubst_flags_t); |
7008 extern tree build_x_indirect_ref (location_t, tree, | 7263 extern tree build_x_indirect_ref (location_t, tree, |
7009 ref_operator, tsubst_flags_t); | 7264 ref_operator, tsubst_flags_t); |
7010 extern tree cp_build_indirect_ref (tree, ref_operator, | 7265 extern tree cp_build_indirect_ref (tree, ref_operator, |
7011 tsubst_flags_t); | 7266 tsubst_flags_t); |
7267 extern tree cp_build_fold_indirect_ref (tree); | |
7012 extern tree build_array_ref (location_t, tree, tree); | 7268 extern tree build_array_ref (location_t, tree, tree); |
7013 extern tree cp_build_array_ref (location_t, tree, tree, | 7269 extern tree cp_build_array_ref (location_t, tree, tree, |
7014 tsubst_flags_t); | 7270 tsubst_flags_t); |
7015 extern tree get_member_function_from_ptrfunc (tree *, tree, tsubst_flags_t); | 7271 extern tree get_member_function_from_ptrfunc (tree *, tree, tsubst_flags_t); |
7016 extern tree cp_build_function_call_nary (tree, tsubst_flags_t, ...) | 7272 extern tree cp_build_function_call_nary (tree, tsubst_flags_t, ...) |
7030 extern tree cp_build_addressof (location_t, tree, | 7286 extern tree cp_build_addressof (location_t, tree, |
7031 tsubst_flags_t); | 7287 tsubst_flags_t); |
7032 extern tree cp_build_addr_expr (tree, tsubst_flags_t); | 7288 extern tree cp_build_addr_expr (tree, tsubst_flags_t); |
7033 extern tree cp_build_unary_op (enum tree_code, tree, bool, | 7289 extern tree cp_build_unary_op (enum tree_code, tree, bool, |
7034 tsubst_flags_t); | 7290 tsubst_flags_t); |
7291 extern tree genericize_compound_lvalue (tree); | |
7035 extern tree unary_complex_lvalue (enum tree_code, tree); | 7292 extern tree unary_complex_lvalue (enum tree_code, tree); |
7036 extern tree build_x_conditional_expr (location_t, tree, tree, tree, | 7293 extern tree build_x_conditional_expr (location_t, tree, tree, tree, |
7037 tsubst_flags_t); | 7294 tsubst_flags_t); |
7038 extern tree build_x_compound_expr_from_list (tree, expr_list_kind, | 7295 extern tree build_x_compound_expr_from_list (tree, expr_list_kind, |
7039 tsubst_flags_t); | 7296 tsubst_flags_t); |
7066 extern tree build_ptrmemfunc (tree, tree, int, bool, | 7323 extern tree build_ptrmemfunc (tree, tree, int, bool, |
7067 tsubst_flags_t); | 7324 tsubst_flags_t); |
7068 extern int cp_type_quals (const_tree); | 7325 extern int cp_type_quals (const_tree); |
7069 extern int type_memfn_quals (const_tree); | 7326 extern int type_memfn_quals (const_tree); |
7070 extern cp_ref_qualifier type_memfn_rqual (const_tree); | 7327 extern cp_ref_qualifier type_memfn_rqual (const_tree); |
7071 extern tree apply_memfn_quals (tree, cp_cv_quals, cp_ref_qualifier); | 7328 extern tree apply_memfn_quals (tree, cp_cv_quals, |
7329 cp_ref_qualifier = REF_QUAL_NONE); | |
7072 extern bool cp_has_mutable_p (const_tree); | 7330 extern bool cp_has_mutable_p (const_tree); |
7073 extern bool at_least_as_qualified_p (const_tree, const_tree); | 7331 extern bool at_least_as_qualified_p (const_tree, const_tree); |
7074 extern void cp_apply_type_quals_to_decl (int, tree); | 7332 extern void cp_apply_type_quals_to_decl (int, tree); |
7075 extern tree build_ptrmemfunc1 (tree, tree, tree); | 7333 extern tree build_ptrmemfunc1 (tree, tree, tree); |
7076 extern void expand_ptrmemfunc_cst (tree, tree *, tree *); | 7334 extern void expand_ptrmemfunc_cst (tree, tree *, tree *); |
7086 enum tree_code, tree, tree, | 7344 enum tree_code, tree, tree, |
7087 tsubst_flags_t); | 7345 tsubst_flags_t); |
7088 extern tree build_x_vec_perm_expr (location_t, | 7346 extern tree build_x_vec_perm_expr (location_t, |
7089 tree, tree, tree, | 7347 tree, tree, tree, |
7090 tsubst_flags_t); | 7348 tsubst_flags_t); |
7091 #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) | 7349 #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false, true) |
7092 extern tree build_simple_component_ref (tree, tree); | 7350 extern tree build_simple_component_ref (tree, tree); |
7093 extern tree build_ptrmemfunc_access_expr (tree, tree); | 7351 extern tree build_ptrmemfunc_access_expr (tree, tree); |
7094 extern tree build_address (tree); | 7352 extern tree build_address (tree); |
7095 extern tree build_nop (tree, tree); | 7353 extern tree build_nop (tree, tree); |
7096 extern tree non_reference (tree); | 7354 extern tree non_reference (tree); |
7109 extern tree cp_perform_integral_promotions (tree, tsubst_flags_t); | 7367 extern tree cp_perform_integral_promotions (tree, tsubst_flags_t); |
7110 | 7368 |
7111 extern tree finish_left_unary_fold_expr (tree, int); | 7369 extern tree finish_left_unary_fold_expr (tree, int); |
7112 extern tree finish_right_unary_fold_expr (tree, int); | 7370 extern tree finish_right_unary_fold_expr (tree, int); |
7113 extern tree finish_binary_fold_expr (tree, tree, int); | 7371 extern tree finish_binary_fold_expr (tree, tree, int); |
7372 extern bool treat_lvalue_as_rvalue_p (tree, bool); | |
7114 | 7373 |
7115 /* in typeck2.c */ | 7374 /* in typeck2.c */ |
7116 extern void require_complete_eh_spec_types (tree, tree); | 7375 extern void require_complete_eh_spec_types (tree, tree); |
7117 extern void cxx_incomplete_type_diagnostic (location_t, const_tree, | 7376 extern void cxx_incomplete_type_diagnostic (location_t, const_tree, |
7118 const_tree, diagnostic_t); | 7377 const_tree, diagnostic_t); |
7378 | |
7379 inline location_t | |
7380 cp_expr_loc_or_loc (const_tree t, location_t or_loc) | |
7381 { | |
7382 location_t loc = cp_expr_location (t); | |
7383 if (loc == UNKNOWN_LOCATION) | |
7384 loc = or_loc; | |
7385 return loc; | |
7386 } | |
7387 | |
7119 inline void | 7388 inline void |
7120 cxx_incomplete_type_diagnostic (const_tree value, const_tree type, | 7389 cxx_incomplete_type_diagnostic (const_tree value, const_tree type, |
7121 diagnostic_t diag_kind) | 7390 diagnostic_t diag_kind) |
7122 { | 7391 { |
7123 cxx_incomplete_type_diagnostic (EXPR_LOC_OR_LOC (value, input_location), | 7392 cxx_incomplete_type_diagnostic (cp_expr_loc_or_loc (value, input_location), |
7124 value, type, diag_kind); | 7393 value, type, diag_kind); |
7125 } | 7394 } |
7126 | 7395 |
7127 extern void cxx_incomplete_type_error (location_t, const_tree, | 7396 extern void cxx_incomplete_type_error (location_t, const_tree, |
7128 const_tree); | 7397 const_tree); |
7133 } | 7402 } |
7134 | 7403 |
7135 extern void cxx_incomplete_type_inform (const_tree); | 7404 extern void cxx_incomplete_type_inform (const_tree); |
7136 extern tree error_not_base_type (tree, tree); | 7405 extern tree error_not_base_type (tree, tree); |
7137 extern tree binfo_or_else (tree, tree); | 7406 extern tree binfo_or_else (tree, tree); |
7138 extern void cxx_readonly_error (tree, enum lvalue_use); | 7407 extern void cxx_readonly_error (location_t, tree, |
7408 enum lvalue_use); | |
7139 extern void complete_type_check_abstract (tree); | 7409 extern void complete_type_check_abstract (tree); |
7140 extern int abstract_virtuals_error (tree, tree); | 7410 extern int abstract_virtuals_error (tree, tree); |
7141 extern int abstract_virtuals_error (abstract_class_use, tree); | 7411 extern int abstract_virtuals_error (abstract_class_use, tree); |
7142 extern int abstract_virtuals_error_sfinae (tree, tree, tsubst_flags_t); | 7412 extern int abstract_virtuals_error_sfinae (tree, tree, tsubst_flags_t); |
7143 extern int abstract_virtuals_error_sfinae (abstract_class_use, tree, tsubst_flags_t); | 7413 extern int abstract_virtuals_error_sfinae (abstract_class_use, tree, tsubst_flags_t); |
7144 | 7414 |
7145 extern tree store_init_value (tree, tree, vec<tree, va_gc>**, int); | 7415 extern tree store_init_value (tree, tree, vec<tree, va_gc>**, int); |
7146 extern tree split_nonconstant_init (tree, tree); | 7416 extern tree split_nonconstant_init (tree, tree); |
7147 extern bool check_narrowing (tree, tree, tsubst_flags_t); | 7417 extern bool check_narrowing (tree, tree, tsubst_flags_t, |
7418 bool = false); | |
7148 extern tree digest_init (tree, tree, tsubst_flags_t); | 7419 extern tree digest_init (tree, tree, tsubst_flags_t); |
7149 extern tree digest_init_flags (tree, tree, int, tsubst_flags_t); | 7420 extern tree digest_init_flags (tree, tree, int, tsubst_flags_t); |
7150 extern tree digest_nsdmi_init (tree, tree, tsubst_flags_t); | 7421 extern tree digest_nsdmi_init (tree, tree, tsubst_flags_t); |
7151 extern tree build_scoped_ref (tree, tree, tree *); | 7422 extern tree build_scoped_ref (tree, tree, tree *); |
7152 extern tree build_x_arrow (location_t, tree, | 7423 extern tree build_x_arrow (location_t, tree, |
7153 tsubst_flags_t); | 7424 tsubst_flags_t); |
7154 extern tree build_m_component_ref (tree, tree, tsubst_flags_t); | 7425 extern tree build_m_component_ref (tree, tree, tsubst_flags_t); |
7155 extern tree build_functional_cast (tree, tree, tsubst_flags_t); | 7426 extern tree build_functional_cast (tree, tree, tsubst_flags_t); |
7156 extern tree add_exception_specifier (tree, tree, int); | 7427 extern tree add_exception_specifier (tree, tree, tsubst_flags_t); |
7157 extern tree merge_exception_specifiers (tree, tree); | 7428 extern tree merge_exception_specifiers (tree, tree); |
7158 | 7429 |
7159 /* in mangle.c */ | 7430 /* in mangle.c */ |
7160 extern void init_mangle (void); | 7431 extern void init_mangle (void); |
7161 extern void mangle_decl (tree); | 7432 extern void mangle_decl (tree); |
7184 extern bool cxx_warn_unused_global_decl (const_tree); | 7455 extern bool cxx_warn_unused_global_decl (const_tree); |
7185 extern size_t cp_tree_size (enum tree_code); | 7456 extern size_t cp_tree_size (enum tree_code); |
7186 extern bool cp_var_mod_type_p (tree, tree); | 7457 extern bool cp_var_mod_type_p (tree, tree); |
7187 extern void cxx_initialize_diagnostics (diagnostic_context *); | 7458 extern void cxx_initialize_diagnostics (diagnostic_context *); |
7188 extern int cxx_types_compatible_p (tree, tree); | 7459 extern int cxx_types_compatible_p (tree, tree); |
7189 extern void init_shadowed_var_for_decl (void); | |
7190 extern bool cxx_block_may_fallthru (const_tree); | 7460 extern bool cxx_block_may_fallthru (const_tree); |
7191 | 7461 |
7192 /* in cp-gimplify.c */ | 7462 /* in cp-gimplify.c */ |
7193 extern int cp_gimplify_expr (tree *, gimple_seq *, | 7463 extern int cp_gimplify_expr (tree *, gimple_seq *, |
7194 gimple_seq *); | 7464 gimple_seq *); |
7195 extern void cp_genericize (tree); | 7465 extern void cp_genericize (tree); |
7196 extern bool cxx_omp_const_qual_no_mutable (tree); | 7466 extern bool cxx_omp_const_qual_no_mutable (tree); |
7467 extern enum omp_clause_default_kind cxx_omp_predetermined_sharing_1 (tree); | |
7197 extern enum omp_clause_default_kind cxx_omp_predetermined_sharing (tree); | 7468 extern enum omp_clause_default_kind cxx_omp_predetermined_sharing (tree); |
7198 extern tree cxx_omp_clause_default_ctor (tree, tree, tree); | 7469 extern tree cxx_omp_clause_default_ctor (tree, tree, tree); |
7199 extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); | 7470 extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); |
7200 extern tree cxx_omp_clause_assign_op (tree, tree, tree); | 7471 extern tree cxx_omp_clause_assign_op (tree, tree, tree); |
7201 extern tree cxx_omp_clause_dtor (tree, tree); | 7472 extern tree cxx_omp_clause_dtor (tree, tree); |
7303 extern void vtv_generate_init_routine (void); | 7574 extern void vtv_generate_init_routine (void); |
7304 extern void vtv_save_class_info (tree); | 7575 extern void vtv_save_class_info (tree); |
7305 extern void vtv_recover_class_info (void); | 7576 extern void vtv_recover_class_info (void); |
7306 extern void vtv_build_vtable_verify_fndecl (void); | 7577 extern void vtv_build_vtable_verify_fndecl (void); |
7307 | 7578 |
7308 /* In cp/cp-array-notations.c */ | |
7309 extern tree expand_array_notation_exprs (tree); | |
7310 bool cilkplus_an_triplet_types_ok_p (location_t, tree, tree, tree, | |
7311 tree); | |
7312 | |
7313 /* In constexpr.c */ | 7579 /* In constexpr.c */ |
7314 extern void fini_constexpr (void); | 7580 extern void fini_constexpr (void); |
7315 extern bool literal_type_p (tree); | 7581 extern bool literal_type_p (tree); |
7316 extern tree register_constexpr_fundef (tree, tree); | 7582 extern tree register_constexpr_fundef (tree, tree); |
7317 extern bool is_valid_constexpr_fn (tree, bool); | 7583 extern bool is_valid_constexpr_fn (tree, bool); |
7318 extern bool check_constexpr_ctor_body (tree, tree, bool); | 7584 extern bool check_constexpr_ctor_body (tree, tree, bool); |
7585 extern tree constexpr_fn_retval (tree); | |
7319 extern tree ensure_literal_type_for_constexpr_object (tree); | 7586 extern tree ensure_literal_type_for_constexpr_object (tree); |
7320 extern bool potential_constant_expression (tree); | 7587 extern bool potential_constant_expression (tree); |
7321 extern bool is_constant_expression (tree); | 7588 extern bool is_constant_expression (tree); |
7322 extern bool is_nondependent_constant_expression (tree); | 7589 extern bool is_nondependent_constant_expression (tree); |
7323 extern bool is_nondependent_static_init_expression (tree); | 7590 extern bool is_nondependent_static_init_expression (tree); |
7324 extern bool is_static_init_expression (tree); | 7591 extern bool is_static_init_expression (tree); |
7325 extern bool potential_rvalue_constant_expression (tree); | 7592 extern bool potential_rvalue_constant_expression (tree); |
7326 extern bool require_potential_constant_expression (tree); | 7593 extern bool require_potential_constant_expression (tree); |
7327 extern bool require_constant_expression (tree); | 7594 extern bool require_constant_expression (tree); |
7595 extern bool require_rvalue_constant_expression (tree); | |
7328 extern bool require_potential_rvalue_constant_expression (tree); | 7596 extern bool require_potential_rvalue_constant_expression (tree); |
7329 extern tree cxx_constant_value (tree, tree = NULL_TREE); | 7597 extern tree cxx_constant_value (tree, tree = NULL_TREE); |
7598 extern tree cxx_constant_init (tree, tree = NULL_TREE); | |
7330 extern tree maybe_constant_value (tree, tree = NULL_TREE); | 7599 extern tree maybe_constant_value (tree, tree = NULL_TREE); |
7331 extern tree maybe_constant_init (tree, tree = NULL_TREE); | 7600 extern tree maybe_constant_init (tree, tree = NULL_TREE, bool = false); |
7332 extern tree fold_non_dependent_expr (tree); | 7601 extern tree fold_non_dependent_expr (tree, tsubst_flags_t = tf_warning_or_error); |
7333 extern tree fold_simple (tree); | 7602 extern tree fold_simple (tree); |
7334 extern bool is_sub_constant_expr (tree); | 7603 extern bool is_sub_constant_expr (tree); |
7335 extern bool reduced_constant_expression_p (tree); | 7604 extern bool reduced_constant_expression_p (tree); |
7336 extern bool is_instantiation_of_constexpr (tree); | 7605 extern bool is_instantiation_of_constexpr (tree); |
7337 extern bool var_in_constexpr_fn (tree); | 7606 extern bool var_in_constexpr_fn (tree); |
7339 extern void explain_invalid_constexpr_fn (tree); | 7608 extern void explain_invalid_constexpr_fn (tree); |
7340 extern vec<tree> cx_error_context (void); | 7609 extern vec<tree> cx_error_context (void); |
7341 extern tree fold_sizeof_expr (tree); | 7610 extern tree fold_sizeof_expr (tree); |
7342 extern void clear_cv_and_fold_caches (void); | 7611 extern void clear_cv_and_fold_caches (void); |
7343 | 7612 |
7344 /* In c-family/cilk.c */ | |
7345 extern bool cilk_valid_spawn (tree); | |
7346 | |
7347 /* In cp-ubsan.c */ | 7613 /* In cp-ubsan.c */ |
7348 extern void cp_ubsan_maybe_instrument_member_call (tree); | 7614 extern void cp_ubsan_maybe_instrument_member_call (tree); |
7349 extern void cp_ubsan_instrument_member_accesses (tree *); | 7615 extern void cp_ubsan_instrument_member_accesses (tree *); |
7350 extern tree cp_ubsan_maybe_instrument_downcast (location_t, tree, tree, tree); | 7616 extern tree cp_ubsan_maybe_instrument_downcast (location_t, tree, tree, tree); |
7351 extern tree cp_ubsan_maybe_instrument_cast_to_vbase (location_t, tree, tree); | 7617 extern tree cp_ubsan_maybe_instrument_cast_to_vbase (location_t, tree, tree); |
7352 extern void cp_ubsan_maybe_initialize_vtbl_ptrs (tree); | 7618 extern void cp_ubsan_maybe_initialize_vtbl_ptrs (tree); |
7353 | |
7354 #if CHECKING_P | |
7355 namespace selftest { | |
7356 extern void run_cp_tests (void); | |
7357 } // namespace selftest | |
7358 #endif /* #if CHECKING_P */ | |
7359 | 7619 |
7360 /* Inline bodies. */ | 7620 /* Inline bodies. */ |
7361 | 7621 |
7362 inline tree | 7622 inline tree |
7363 ovl_first (tree node) | 7623 ovl_first (tree node) |
7385 { | 7645 { |
7386 tree name = OVL_NAME (existing); | 7646 tree name = OVL_NAME (existing); |
7387 return candidate == name; | 7647 return candidate == name; |
7388 } | 7648 } |
7389 | 7649 |
7650 inline bool | |
7651 null_node_p (const_tree expr) | |
7652 { | |
7653 STRIP_ANY_LOCATION_WRAPPER (expr); | |
7654 return expr == null_node; | |
7655 } | |
7656 | |
7657 #if CHECKING_P | |
7658 namespace selftest { | |
7659 extern void run_cp_tests (void); | |
7660 | |
7661 /* Declarations for specific families of tests within cp, | |
7662 by source file, in alphabetical order. */ | |
7663 extern void cp_pt_c_tests (); | |
7664 extern void cp_tree_c_tests (void); | |
7665 } // namespace selftest | |
7666 #endif /* #if CHECKING_P */ | |
7667 | |
7390 /* -- end of C++ */ | 7668 /* -- end of C++ */ |
7391 | 7669 |
7392 #endif /* ! GCC_CP_TREE_H */ | 7670 #endif /* ! GCC_CP_TREE_H */ |