]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/cp-objcp-common.c
Update copyright years.
[thirdparty/gcc.git] / gcc / cp / cp-objcp-common.c
CommitLineData
11bb4b27 1/* Some code common to C++ and ObjC++ front ends.
99dee823 2 Copyright (C) 2004-2021 Free Software Foundation, Inc.
11bb4b27
ZL
3 Contributed by Ziemowit Laski <zlaski@apple.com>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
e77f031d 9Software Foundation; either version 3, or (at your option) any later
11bb4b27
ZL
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
e77f031d
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
11bb4b27
ZL
20
21#include "config.h"
22#include "system.h"
23#include "coretypes.h"
11bb4b27 24#include "cp-tree.h"
11bb4b27 25#include "cp-objcp-common.h"
81b42cc6 26#include "dwarf2.h"
ad1539d5 27#include "stringpool.h"
11bb4b27
ZL
28
29/* Special routine to get the alias set for C++. */
30
4862826d 31alias_set_type
11bb4b27
ZL
32cxx_get_alias_set (tree t)
33{
34 if (IS_FAKE_BASE_TYPE (t))
35 /* The base variant of a type must be in the same alias set as the
36 complete type. */
37 return get_alias_set (TYPE_CONTEXT (t));
38
39 /* Punt on PMFs until we canonicalize functions properly. */
a489b1f0 40 if (TYPE_PTRMEMFUNC_P (t)
71a93b08 41 || (INDIRECT_TYPE_P (t)
a489b1f0 42 && TYPE_PTRMEMFUNC_P (TREE_TYPE (t))))
11bb4b27
ZL
43 return 0;
44
45 return c_common_get_alias_set (t);
46}
47
d7438551 48/* Called from check_global_declaration. */
11bb4b27
ZL
49
50bool
ac7d7749 51cxx_warn_unused_global_decl (const_tree decl)
11bb4b27
ZL
52{
53 if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
54 return false;
55 if (DECL_IN_SYSTEM_HEADER (decl))
56 return false;
57
11bb4b27
ZL
58 return true;
59}
60
11bb4b27
ZL
61/* Langhook for tree_size: determine size of our 'x' and 'c' nodes. */
62size_t
63cp_tree_size (enum tree_code code)
64{
f419fd1f 65 gcc_checking_assert (code >= NUM_TREE_CODES);
11bb4b27
ZL
66 switch (code)
67 {
f419fd1f
NS
68 case PTRMEM_CST: return sizeof (ptrmem_cst);
69 case BASELINK: return sizeof (tree_baselink);
0cbd7506 70 case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index);
7b49e3da 71 case DEFERRED_PARSE: return sizeof (tree_deferred_parse);
f419fd1f
NS
72 case DEFERRED_NOEXCEPT: return sizeof (tree_deferred_noexcept);
73 case OVERLOAD: return sizeof (tree_overload);
74 case STATIC_ASSERT: return sizeof (tree_static_assert);
5d80a306 75 case TYPE_ARGUMENT_PACK:
f419fd1f 76 case TYPE_PACK_EXPANSION: return sizeof (tree_type_non_common);
5d80a306 77 case NONTYPE_ARGUMENT_PACK:
f419fd1f
NS
78 case EXPR_PACK_EXPANSION: return sizeof (tree_exp);
79 case ARGUMENT_PACK_SELECT: return sizeof (tree_argument_pack_select);
80 case TRAIT_EXPR: return sizeof (tree_trait_expr);
81 case LAMBDA_EXPR: return sizeof (tree_lambda_expr);
82 case TEMPLATE_INFO: return sizeof (tree_template_info);
83 case CONSTRAINT_INFO: return sizeof (tree_constraint_info);
84 case USERDEF_LITERAL: return sizeof (tree_userdef_literal);
85 case TEMPLATE_DECL: return sizeof (tree_template_decl);
11bb4b27 86 default:
f419fd1f
NS
87 switch (TREE_CODE_CLASS (code))
88 {
89 case tcc_declaration: return sizeof (tree_decl_non_common);
90 case tcc_type: return sizeof (tree_type_non_common);
91 default: gcc_unreachable ();
92 }
11bb4b27
ZL
93 }
94 /* NOTREACHED */
95}
96
97/* Returns true if T is a variably modified type, in the sense of C99.
98 FN is as passed to variably_modified_p.
99 This routine needs only check cases that cannot be handled by the
100 language-independent logic in tree.c. */
101
102bool
103cp_var_mod_type_p (tree type, tree fn)
104{
105 /* If TYPE is a pointer-to-member, it is variably modified if either
106 the class or the member are variably modified. */
66b1156a 107 if (TYPE_PTRMEM_P (type))
11bb4b27
ZL
108 return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type), fn)
109 || variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type),
110 fn));
111
112 /* All other types are not variably modified. */
113 return false;
114}
115
65958285
ZL
116/* This compares two types for equivalence ("compatible" in C-based languages).
117 This routine should only return 1 if it is sure. It should not be used
118 in contexts where erroneously returning 0 causes problems. */
119
120int
121cxx_types_compatible_p (tree x, tree y)
122{
cf7bc668 123 return same_type_ignoring_top_level_qualifiers_p (x, y);
65958285
ZL
124}
125
df418f1d 126static GTY((cache)) type_tree_cache_map *debug_type_map;
a49bf6f0 127
6905c577
JJ
128/* Return a type to use in the debug info instead of TYPE, or NULL_TREE to
129 keep TYPE. */
130
131tree
132cp_get_debug_type (const_tree type)
133{
21faa101
JM
134 tree dtype = NULL_TREE;
135
6905c577 136 if (TYPE_PTRMEMFUNC_P (type) && !typedef_variant_p (type))
21faa101
JM
137 dtype = build_offset_type (TYPE_PTRMEMFUNC_OBJECT_TYPE (type),
138 TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)));
139
140 /* We cannot simply return the debug type here because the function uses
141 the type canonicalization hashtable, which is GC-ed, so its behavior
142 depends on the actual collection points. Since we are building these
143 types on the fly for the debug info only, they would not be attached
144 to any GC root and always be swept, so we would make the contents of
145 the debug info depend on the collection points. */
146 if (dtype)
a49bf6f0 147 {
21faa101 148 tree ktype = CONST_CAST_TREE (type);
c89844e5 149 if (tree *slot = hash_map_safe_get (debug_type_map, ktype))
21faa101 150 return *slot;
c89844e5 151 hash_map_safe_put<hm_ggc> (debug_type_map, ktype, dtype);
a49bf6f0 152 }
6905c577 153
21faa101 154 return dtype;
6905c577
JJ
155}
156
81b42cc6
JJ
157/* Return -1 if dwarf ATTR shouldn't be added for DECL, or the attribute
158 value otherwise. */
159int
160cp_decl_dwarf_attribute (const_tree decl, int attr)
68599f33 161{
81b42cc6
JJ
162 if (decl == NULL_TREE)
163 return -1;
68599f33 164
81b42cc6
JJ
165 switch (attr)
166 {
167 case DW_AT_explicit:
168 if (TREE_CODE (decl) == FUNCTION_DECL
169 && DECL_LANG_SPECIFIC (STRIP_TEMPLATE (decl))
170 && DECL_NONCONVERTING_P (decl))
171 return 1;
172 break;
f5059223 173
81b42cc6
JJ
174 case DW_AT_deleted:
175 if (TREE_CODE (decl) == FUNCTION_DECL
f5059223 176 && DECL_LANG_SPECIFIC (STRIP_TEMPLATE (decl))
81b42cc6
JJ
177 && DECL_DELETED_FN (decl))
178 return 1;
179 break;
f5059223 180
81b42cc6
JJ
181 case DW_AT_defaulted:
182 if (TREE_CODE (decl) == FUNCTION_DECL
183 && DECL_LANG_SPECIFIC (STRIP_TEMPLATE (decl))
184 && DECL_DEFAULTED_FN (decl))
185 {
186 if (DECL_DEFAULTED_IN_CLASS_P (decl))
187 return DW_DEFAULTED_in_class;
e366d7d8 188
81b42cc6
JJ
189 if (DECL_DEFAULTED_OUTSIDE_CLASS_P (decl))
190 return DW_DEFAULTED_out_of_class;
191 }
192 break;
e366d7d8 193
8e6982f7
JJ
194 case DW_AT_const_expr:
195 if (VAR_OR_FUNCTION_DECL_P (decl) && DECL_DECLARED_CONSTEXPR_P (decl))
196 return 1;
197 break;
198
0f2a9e37
JJ
199 case DW_AT_reference:
200 if (TREE_CODE (decl) == FUNCTION_DECL
201 && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
202 && FUNCTION_REF_QUALIFIED (TREE_TYPE (decl))
203 && !FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (decl)))
204 return 1;
0f2a9e37
JJ
205 break;
206
207 case DW_AT_rvalue_reference:
208 if (TREE_CODE (decl) == FUNCTION_DECL
209 && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
210 && FUNCTION_REF_QUALIFIED (TREE_TYPE (decl))
211 && FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (decl)))
212 return 1;
0f2a9e37
JJ
213 break;
214
70d28813
JJ
215 case DW_AT_inline:
216 if (VAR_P (decl) && DECL_INLINE_VAR_P (decl))
217 {
218 if (DECL_VAR_DECLARED_INLINE_P (decl))
219 return DW_INL_declared_inlined;
220 else
221 return DW_INL_inlined;
222 }
223 break;
224
e071b767
JJ
225 case DW_AT_export_symbols:
226 if (TREE_CODE (decl) == NAMESPACE_DECL
227 && (DECL_NAMESPACE_INLINE_P (decl)
228 || (DECL_NAME (decl) == NULL_TREE && dwarf_version >= 5)))
229 return 1;
230 break;
231
81b42cc6
JJ
232 default:
233 break;
e366d7d8
AO
234 }
235
81b42cc6 236 return -1;
e366d7d8
AO
237}
238
6905c577
JJ
239/* Return -1 if dwarf ATTR shouldn't be added for TYPE, or the attribute
240 value otherwise. */
241int
242cp_type_dwarf_attribute (const_tree type, int attr)
243{
244 if (type == NULL_TREE)
245 return -1;
246
247 switch (attr)
248 {
249 case DW_AT_reference:
7bdc7e06 250 if (FUNC_OR_METHOD_TYPE_P (type)
6905c577
JJ
251 && FUNCTION_REF_QUALIFIED (type)
252 && !FUNCTION_RVALUE_QUALIFIED (type))
253 return 1;
254 break;
255
256 case DW_AT_rvalue_reference:
7bdc7e06 257 if (FUNC_OR_METHOD_TYPE_P (type)
6905c577
JJ
258 && FUNCTION_REF_QUALIFIED (type)
259 && FUNCTION_RVALUE_QUALIFIED (type))
260 return 1;
261 break;
262
263 default:
264 break;
265 }
266
267 return -1;
268}
269
b7fc43d7
RB
270/* Return the unit size of TYPE without reusable tail padding. */
271
272tree
273cp_unit_size_without_reusable_padding (tree type)
274{
275 if (CLASS_TYPE_P (type))
276 return CLASSTYPE_SIZE_UNIT (type);
277 return TYPE_SIZE_UNIT (type);
278}
279
11bb4b27
ZL
280/* Stubs to keep c-opts.c happy. */
281void
282push_file_scope (void)
283{
284}
285
286void
287pop_file_scope (void)
288{
289}
290
291/* c-pragma.c needs to query whether a decl has extern "C" linkage. */
292bool
58f9752a 293has_c_linkage (const_tree decl)
11bb4b27
ZL
294{
295 return DECL_EXTERN_C_P (decl);
296}
3ed8593d 297
c65cb8d1 298/* Return true if stmt can fall through. Used by block_may_fallthru
88cd0e88
JJ
299 default case. */
300
301bool
302cxx_block_may_fallthru (const_tree stmt)
303{
304 switch (TREE_CODE (stmt))
305 {
306 case EXPR_STMT:
307 return block_may_fallthru (EXPR_STMT_EXPR (stmt));
308
309 case THROW_EXPR:
310 return false;
311
d3eb902f
SP
312 case IF_STMT:
313 if (block_may_fallthru (THEN_CLAUSE (stmt)))
314 return true;
315 return block_may_fallthru (ELSE_CLAUSE (stmt));
316
88cd0e88 317 default:
cba079f3 318 return c_block_may_fallthru (stmt);
88cd0e88
JJ
319 }
320}
321
505dd180
NS
322/* Return the list of decls in the global namespace. */
323
324tree
325cp_get_global_decls ()
326{
327 return NAMESPACE_LEVEL (global_namespace)->names;
328}
329
f3665bd1 330/* Push DECL into the current (namespace) scope. */
505dd180
NS
331
332tree
333cp_pushdecl (tree decl)
334{
f3665bd1 335 DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
505dd180
NS
336 return pushdecl (decl);
337}
338
87e3d7cf
NS
339/* Get the global value binding of NAME. Called directly from
340 c-common.c, not via a hook. */
341
342tree
343identifier_global_value (tree name)
344{
345 return get_global_binding (name);
346}
347
bdaf8be1
JJ
348/* Similarly, but return struct/class/union NAME instead. */
349
350tree
351identifier_global_tag (tree name)
352{
4c58a32f 353 tree ret = lookup_qualified_name (global_namespace, name, LOOK_want::TYPE,
4a08009e
JJ
354 /*complain*/false);
355 if (ret == error_mark_node)
356 return NULL_TREE;
357 return ret;
bdaf8be1
JJ
358}
359
ad1539d5
MS
360/* Returns true if NAME refers to a built-in function or function-like
361 operator. */
362
363bool
364names_builtin_p (const char *name)
365{
366 tree id = get_identifier (name);
367 if (tree binding = get_global_binding (id))
368 {
ba649812
NS
369 if (TREE_CODE (binding) == FUNCTION_DECL
370 && DECL_IS_UNDECLARED_BUILTIN (binding))
ad1539d5
MS
371 return true;
372
373 /* Handle the case when an overload for a built-in name exists. */
374 if (TREE_CODE (binding) != OVERLOAD)
375 return false;
376
377 for (ovl_iterator it (binding); it; ++it)
378 {
379 tree decl = *it;
ba649812 380 if (DECL_IS_UNDECLARED_BUILTIN (decl))
ad1539d5
MS
381 return true;
382 }
383 }
384
385 /* Also detect common reserved C++ words that aren't strictly built-in
386 functions. */
387 switch (C_RID_CODE (id))
388 {
389 case RID_ADDRESSOF:
390 case RID_BUILTIN_CONVERTVECTOR:
391 case RID_BUILTIN_HAS_ATTRIBUTE:
392 case RID_BUILTIN_SHUFFLE:
393 case RID_BUILTIN_LAUNDER:
896048cf 394 case RID_BUILTIN_BIT_CAST:
ad1539d5
MS
395 case RID_OFFSETOF:
396 case RID_HAS_NOTHROW_ASSIGN:
397 case RID_HAS_NOTHROW_CONSTRUCTOR:
398 case RID_HAS_NOTHROW_COPY:
399 case RID_HAS_TRIVIAL_ASSIGN:
400 case RID_HAS_TRIVIAL_CONSTRUCTOR:
401 case RID_HAS_TRIVIAL_COPY:
402 case RID_HAS_TRIVIAL_DESTRUCTOR:
403 case RID_HAS_UNIQUE_OBJ_REPRESENTATIONS:
404 case RID_HAS_VIRTUAL_DESTRUCTOR:
405 case RID_IS_ABSTRACT:
406 case RID_IS_AGGREGATE:
407 case RID_IS_BASE_OF:
408 case RID_IS_CLASS:
409 case RID_IS_EMPTY:
410 case RID_IS_ENUM:
411 case RID_IS_FINAL:
412 case RID_IS_LITERAL_TYPE:
413 case RID_IS_POD:
414 case RID_IS_POLYMORPHIC:
415 case RID_IS_SAME_AS:
416 case RID_IS_STD_LAYOUT:
417 case RID_IS_TRIVIAL:
418 case RID_IS_TRIVIALLY_ASSIGNABLE:
419 case RID_IS_TRIVIALLY_CONSTRUCTIBLE:
420 case RID_IS_TRIVIALLY_COPYABLE:
421 case RID_IS_UNION:
422 case RID_IS_ASSIGNABLE:
423 case RID_IS_CONSTRUCTIBLE:
424 case RID_UNDERLYING_TYPE:
425 return true;
426 default:
427 break;
428 }
429
430 return false;
431}
432
2a8a8d7b
NS
433/* Register c++-specific dumps. */
434
435void
436cp_register_dumps (gcc::dump_manager *dumps)
437{
438 class_dump_id = dumps->dump_register
439 (".class", "lang-class", "lang-class", DK_lang, OPTGROUP_NONE, false);
58aca9d9 440
97b56dec
NS
441 module_dump_id = dumps->dump_register
442 (".module", "lang-module", "lang-module", DK_lang, OPTGROUP_NONE, false);
443
58aca9d9
NS
444 raw_dump_id = dumps->dump_register
445 (".raw", "lang-raw", "lang-raw", DK_lang, OPTGROUP_NONE, false);
2a8a8d7b
NS
446}
447
81f653d6
NF
448void
449cp_common_init_ts (void)
450{
7994803c
NS
451 /* With type. */
452 MARK_TS_TYPED (PTRMEM_CST);
453 MARK_TS_TYPED (LAMBDA_EXPR);
454 MARK_TS_TYPED (TYPE_ARGUMENT_PACK);
81f653d6 455
7994803c
NS
456 /* Random new trees. */
457 MARK_TS_COMMON (BASELINK);
458 MARK_TS_COMMON (DECLTYPE_TYPE);
81f653d6 459 MARK_TS_COMMON (OVERLOAD);
7994803c 460 MARK_TS_COMMON (TEMPLATE_PARM_INDEX);
81f653d6
NF
461 MARK_TS_COMMON (TYPENAME_TYPE);
462 MARK_TS_COMMON (TYPEOF_TYPE);
81f653d6 463 MARK_TS_COMMON (UNBOUND_CLASS_TEMPLATE);
7994803c 464 MARK_TS_COMMON (UNDERLYING_TYPE);
81f653d6 465
7994803c
NS
466 /* New decls. */
467 MARK_TS_DECL_COMMON (TEMPLATE_DECL);
468 MARK_TS_DECL_COMMON (WILDCARD_DECL);
cb57504a 469 MARK_TS_DECL_COMMON (CONCEPT_DECL);
7994803c
NS
470
471 MARK_TS_DECL_NON_COMMON (USING_DECL);
598f50d7 472
7994803c
NS
473 /* New Types. */
474 MARK_TS_TYPE_NON_COMMON (BOUND_TEMPLATE_TEMPLATE_PARM);
475 MARK_TS_TYPE_NON_COMMON (TEMPLATE_TEMPLATE_PARM);
476 MARK_TS_TYPE_NON_COMMON (TEMPLATE_TYPE_PARM);
477 MARK_TS_TYPE_NON_COMMON (TYPE_ARGUMENT_PACK);
478 MARK_TS_TYPE_NON_COMMON (TYPE_PACK_EXPANSION);
479
480 /* Statements. */
7994803c 481 MARK_TS_EXP (CLEANUP_STMT);
7994803c 482 MARK_TS_EXP (EH_SPEC_BLOCK);
7994803c
NS
483 MARK_TS_EXP (HANDLER);
484 MARK_TS_EXP (IF_STMT);
485 MARK_TS_EXP (OMP_DEPOBJ);
486 MARK_TS_EXP (RANGE_FOR_STMT);
7994803c
NS
487 MARK_TS_EXP (TRY_BLOCK);
488 MARK_TS_EXP (USING_STMT);
7994803c
NS
489
490 /* Random expressions. */
491 MARK_TS_EXP (ADDRESSOF_EXPR);
598f50d7 492 MARK_TS_EXP (AGGR_INIT_EXPR);
7994803c
NS
493 MARK_TS_EXP (ALIGNOF_EXPR);
494 MARK_TS_EXP (ARROW_EXPR);
495 MARK_TS_EXP (AT_ENCODE_EXPR);
896048cf 496 MARK_TS_EXP (BIT_CAST_EXPR);
7994803c
NS
497 MARK_TS_EXP (CAST_EXPR);
498 MARK_TS_EXP (CONST_CAST_EXPR);
598f50d7 499 MARK_TS_EXP (CTOR_INITIALIZER);
7994803c
NS
500 MARK_TS_EXP (DELETE_EXPR);
501 MARK_TS_EXP (DOTSTAR_EXPR);
502 MARK_TS_EXP (DYNAMIC_CAST_EXPR);
598f50d7 503 MARK_TS_EXP (EMPTY_CLASS_EXPR);
7994803c
NS
504 MARK_TS_EXP (EXPR_STMT);
505 MARK_TS_EXP (IMPLICIT_CONV_EXPR);
506 MARK_TS_EXP (MEMBER_REF);
598f50d7 507 MARK_TS_EXP (MODOP_EXPR);
7994803c
NS
508 MARK_TS_EXP (MUST_NOT_THROW_EXPR);
509 MARK_TS_EXP (NEW_EXPR);
510 MARK_TS_EXP (NOEXCEPT_EXPR);
511 MARK_TS_EXP (NON_DEPENDENT_EXPR);
512 MARK_TS_EXP (OFFSETOF_EXPR);
513 MARK_TS_EXP (OFFSET_REF);
514 MARK_TS_EXP (PSEUDO_DTOR_EXPR);
598f50d7 515 MARK_TS_EXP (REINTERPRET_CAST_EXPR);
7994803c 516 MARK_TS_EXP (SCOPE_REF);
598f50d7 517 MARK_TS_EXP (STATIC_CAST_EXPR);
7994803c
NS
518 MARK_TS_EXP (STMT_EXPR);
519 MARK_TS_EXP (TAG_DEFN);
598f50d7 520 MARK_TS_EXP (TEMPLATE_ID_EXPR);
7994803c 521 MARK_TS_EXP (THROW_EXPR);
598f50d7 522 MARK_TS_EXP (TRAIT_EXPR);
598f50d7 523 MARK_TS_EXP (TYPEID_EXPR);
7994803c
NS
524 MARK_TS_EXP (TYPE_EXPR);
525 MARK_TS_EXP (UNARY_PLUS_EXPR);
526 MARK_TS_EXP (VEC_DELETE_EXPR);
598f50d7 527 MARK_TS_EXP (VEC_INIT_EXPR);
7994803c 528 MARK_TS_EXP (VEC_NEW_EXPR);
b7689b96 529 MARK_TS_EXP (SPACESHIP_EXPR);
598f50d7 530
7994803c
NS
531 /* Fold expressions. */
532 MARK_TS_EXP (BINARY_LEFT_FOLD_EXPR);
533 MARK_TS_EXP (BINARY_RIGHT_FOLD_EXPR);
598f50d7 534 MARK_TS_EXP (EXPR_PACK_EXPANSION);
7994803c 535 MARK_TS_EXP (NONTYPE_ARGUMENT_PACK);
598f50d7
NS
536 MARK_TS_EXP (UNARY_LEFT_FOLD_EXPR);
537 MARK_TS_EXP (UNARY_RIGHT_FOLD_EXPR);
598f50d7 538
7994803c 539 /* Constraints. */
598f50d7 540 MARK_TS_EXP (CHECK_CONSTR);
7994803c
NS
541 MARK_TS_EXP (COMPOUND_REQ);
542 MARK_TS_EXP (CONJ_CONSTR);
7994803c 543 MARK_TS_EXP (DISJ_CONSTR);
cb57504a 544 MARK_TS_EXP (ATOMIC_CONSTR);
7994803c 545 MARK_TS_EXP (NESTED_REQ);
7994803c
NS
546 MARK_TS_EXP (REQUIRES_EXPR);
547 MARK_TS_EXP (SIMPLE_REQ);
7994803c 548 MARK_TS_EXP (TYPE_REQ);
598f50d7 549
49789fd0
IS
550 MARK_TS_EXP (CO_AWAIT_EXPR);
551 MARK_TS_EXP (CO_YIELD_EXPR);
552 MARK_TS_EXP (CO_RETURN_EXPR);
553
598f50d7 554 c_common_init_ts ();
81f653d6 555}
3ed8593d 556
97b56dec
NS
557/* Handle C++-specficic options here. Punt to c_common otherwise. */
558
559bool
560cp_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
561 int kind, location_t loc,
562 const struct cl_option_handlers *handlers)
563{
564 if (handle_module_option (unsigned (scode), arg, value))
565 return true;
566 return c_common_handle_option (scode, arg, value, kind, loc, handlers);
567}
568
3ed8593d 569#include "gt-cp-cp-objcp-common.h"