Branch data Line data Source code
1 : : /* Definitions for C parsing and type checking.
2 : : Copyright (C) 1987-2025 Free Software Foundation, Inc.
3 : :
4 : : This file is part of GCC.
5 : :
6 : : GCC is free software; you can redistribute it and/or modify it under
7 : : the terms of the GNU General Public License as published by the Free
8 : : Software Foundation; either version 3, or (at your option) any later
9 : : version.
10 : :
11 : : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 : : WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : : FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 : : for more details.
15 : :
16 : : You should have received a copy of the GNU General Public License
17 : : along with GCC; see the file COPYING3. If not see
18 : : <http://www.gnu.org/licenses/>. */
19 : :
20 : : #ifndef GCC_C_TREE_H
21 : : #define GCC_C_TREE_H
22 : :
23 : : #include "c-family/c-common.h"
24 : : #include "diagnostic.h"
25 : :
26 : : /* struct lang_identifier is private to c-decl.cc, but langhooks.cc needs to
27 : : know how big it is. This is sanity-checked in c-decl.cc. */
28 : : #define C_SIZEOF_STRUCT_LANG_IDENTIFIER \
29 : : (sizeof (struct c_common_identifier) + 3 * sizeof (void *))
30 : :
31 : : /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
32 : : #define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE)
33 : :
34 : : /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile. */
35 : : #define C_TYPE_FIELDS_VOLATILE(TYPE) TREE_LANG_FLAG_2 (TYPE)
36 : :
37 : : /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is
38 : : volatile, restrict-qualified or atomic; that is, has a type not
39 : : permitted for a constexpr object. */
40 : : #define C_TYPE_FIELDS_NON_CONSTEXPR(TYPE) TREE_LANG_FLAG_4 (TYPE)
41 : :
42 : : /* In a RECORD_TYPE or UNION_TYPE or ENUMERAL_TYPE
43 : : nonzero if the definition of the type has already started. */
44 : : #define C_TYPE_BEING_DEFINED(TYPE) TYPE_LANG_FLAG_0 (TYPE)
45 : :
46 : : /* In an incomplete RECORD_TYPE, UNION_TYPE or ENUMERAL_TYPE, a list of
47 : : variable declarations whose type would be completed by completing
48 : : that type. */
49 : : #define C_TYPE_INCOMPLETE_VARS(TYPE) \
50 : : TYPE_LANG_SLOT_1 (TREE_CHECK4 (TYPE, RECORD_TYPE, UNION_TYPE, \
51 : : QUAL_UNION_TYPE, ENUMERAL_TYPE))
52 : :
53 : : /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
54 : : keyword. C_RID_CODE (node) is then the RID_* value of the keyword. */
55 : : #define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_0 (ID)
56 : :
57 : : /* Record whether a type or decl was written with nonconstant size.
58 : : Note that TYPE_SIZE may have simplified to a constant. */
59 : : #define C_TYPE_VARIABLE_SIZE(TYPE) TYPE_LANG_FLAG_1 (TYPE)
60 : : #define C_DECL_VARIABLE_SIZE(TYPE) DECL_LANG_FLAG_0 (TYPE)
61 : :
62 : : /* Record whether a type is variably modified. */
63 : : #define C_TYPE_VARIABLY_MODIFIED(TYPE) TYPE_LANG_FLAG_6 (TYPE)
64 : :
65 : :
66 : : /* Record whether a type is defined inside a struct or union type.
67 : : This is used for -Wc++-compat. */
68 : : #define C_TYPE_DEFINED_IN_STRUCT(TYPE) TYPE_LANG_FLAG_2 (TYPE)
69 : :
70 : : /* Record whether a typedef for type `int' was actually `signed int'. */
71 : : #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
72 : :
73 : : /* For a FUNCTION_DECL, nonzero if it was defined without an explicit
74 : : return type. */
75 : : #define C_FUNCTION_IMPLICIT_INT(EXP) DECL_LANG_FLAG_1 (EXP)
76 : :
77 : : /* For a FUNCTION_DECL, nonzero if it was an implicit declaration. */
78 : : #define C_DECL_IMPLICIT(EXP) DECL_LANG_FLAG_2 (EXP)
79 : :
80 : : /* For a PARM_DECL, nonzero if it was declared as an array. */
81 : : #define C_ARRAY_PARAMETER(NODE) DECL_LANG_FLAG_0 (NODE)
82 : :
83 : : /* For FUNCTION_DECLs, evaluates true if the decl is a nested
84 : : function that requires a non-local context. */
85 : : #define C_FUNC_NONLOCAL_CONTEXT(EXP) \
86 : : DECL_LANG_FLAG_4 (FUNCTION_DECL_CHECK (EXP))
87 : :
88 : : /* For FUNCTION_DECLs, evaluates true if the decl is built-in but has
89 : : been declared. */
90 : : #define C_DECL_DECLARED_BUILTIN(EXP) \
91 : : DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (EXP))
92 : :
93 : : /* For FUNCTION_DECLs, evaluates true if the decl is built-in, has a
94 : : built-in prototype and does not have a non-built-in prototype. */
95 : : #define C_DECL_BUILTIN_PROTOTYPE(EXP) \
96 : : DECL_LANG_FLAG_6 (FUNCTION_DECL_CHECK (EXP))
97 : :
98 : : /* For LABEL_DECLs marks canonical name of a loop. */
99 : : #define C_DECL_LOOP_NAME(EXP) DECL_LANG_FLAG_3 (LABEL_DECL_CHECK (EXP))
100 : :
101 : : /* For LABEL_DECLs marks canonical name of a switch. During parsing of
102 : : ObjC foreach named loop both C_DECL_LOOP_NAME and C_DECL_SWITCH_NAME
103 : : are temporarily set. */
104 : : #define C_DECL_SWITCH_NAME(EXP) DECL_LANG_FLAG_5 (LABEL_DECL_CHECK (EXP))
105 : :
106 : : /* For LABEL_DECLs marks canonical name of a loop or switch being
107 : : valid for use in break identifier or continue identifier statements. */
108 : : #define C_DECL_LOOP_SWITCH_NAME_VALID(EXP) \
109 : : DECL_LANG_FLAG_6 (LABEL_DECL_CHECK (EXP))
110 : :
111 : : /* For LABEL_DECLs marks canonical loop or switch names which were actually
112 : : used in one or more break identifier or continue identifier statements. */
113 : : #define C_DECL_LOOP_SWITCH_NAME_USED(EXP) \
114 : : DECL_LANG_FLAG_8 (LABEL_DECL_CHECK (EXP))
115 : :
116 : : /* Record whether a decl was declared register. This is strictly a
117 : : front-end flag, whereas DECL_REGISTER is used for code generation;
118 : : they may differ for structures with volatile fields. */
119 : : #define C_DECL_REGISTER(EXP) \
120 : : DECL_LANG_FLAG_4 (TREE_NOT_CHECK (EXP, FUNCTION_DECL))
121 : :
122 : : /* Record whether a decl was used in an expression anywhere except an
123 : : unevaluated operand of sizeof / typeof / alignof. This is only
124 : : used for functions declared static but not defined, though outside
125 : : sizeof and typeof it is set for other function decls as well. */
126 : : #define C_DECL_USED(EXP) DECL_LANG_FLAG_5 (FUNCTION_DECL_CHECK (EXP))
127 : :
128 : : /* Record whether a variable has been declared threadprivate by
129 : : #pragma omp threadprivate. */
130 : : #define C_DECL_THREADPRIVATE_P(DECL) DECL_LANG_FLAG_3 (VAR_DECL_CHECK (DECL))
131 : :
132 : : /* Set on VAR_DECLs for compound literals. */
133 : : #define C_DECL_COMPOUND_LITERAL_P(DECL) \
134 : : DECL_LANG_FLAG_5 (VAR_DECL_CHECK (DECL))
135 : :
136 : : /* Set on decls used as placeholders for a C23 underspecified object
137 : : definition. */
138 : : #define C_DECL_UNDERSPECIFIED(DECL) DECL_LANG_FLAG_7 (DECL)
139 : :
140 : : /* Set on VAR_DECLs declared as 'constexpr'. */
141 : : #define C_DECL_DECLARED_CONSTEXPR(DECL) \
142 : : DECL_LANG_FLAG_8 (VAR_DECL_CHECK (DECL))
143 : :
144 : : /* Nonzero for a decl which either doesn't exist or isn't a prototype.
145 : : N.B. Could be simplified if all built-in decls had complete prototypes
146 : : (but this is presently difficult because some of them need FILE*). */
147 : : #define C_DECL_ISNT_PROTOTYPE(EXP) \
148 : : (EXP == 0 \
149 : : || (!prototype_p (TREE_TYPE (EXP)) \
150 : : && !fndecl_built_in_p (EXP)))
151 : :
152 : : /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
153 : : TYPE_ARG_TYPES for functions with prototypes, but created for functions
154 : : without prototypes. */
155 : : #define TYPE_ACTUAL_ARG_TYPES(NODE) \
156 : : TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE))
157 : :
158 : : /* For a CONSTRUCTOR, whether some initializer contains a
159 : : subexpression meaning it is not a constant expression. */
160 : : #define CONSTRUCTOR_NON_CONST(EXPR) TREE_LANG_FLAG_1 (CONSTRUCTOR_CHECK (EXPR))
161 : :
162 : : /* For a SAVE_EXPR, nonzero if the operand of the SAVE_EXPR has already
163 : : been folded. */
164 : : #define SAVE_EXPR_FOLDED_P(EXP) TREE_LANG_FLAG_1 (SAVE_EXPR_CHECK (EXP))
165 : :
166 : : /* Whether a type has boolean semantics: either a boolean type or an
167 : : enumeration type with a boolean type as its underlying type. */
168 : : #define C_BOOLEAN_TYPE_P(TYPE) \
169 : : (TREE_CODE (TYPE) == BOOLEAN_TYPE \
170 : : || (TREE_CODE (TYPE) == ENUMERAL_TYPE \
171 : : && ENUM_UNDERLYING_TYPE (TYPE) != NULL_TREE \
172 : : && (TREE_CODE (ENUM_UNDERLYING_TYPE (TYPE)) == BOOLEAN_TYPE \
173 : : || c_hardbool_type_attr (TYPE))))
174 : :
175 : : /* Record parser information about an expression that is irrelevant
176 : : for code generation alongside a tree representing its value. */
177 : : struct c_expr
178 : : {
179 : : /* The value of the expression. */
180 : : tree value;
181 : : /* Record the original unary/binary operator of an expression, which may
182 : : have been changed by fold, STRING_CST for unparenthesized string
183 : : constants, C_MAYBE_CONST_EXPR for __builtin_constant_p calls
184 : : (even if parenthesized), for subexpressions, and for non-constant
185 : : initializers, or ERROR_MARK for other expressions (including
186 : : parenthesized expressions). */
187 : : enum tree_code original_code;
188 : : /* If not NULL, the original type of an expression. This will
189 : : differ from the type of the value field for an enum constant.
190 : : The type of an enum constant is a plain integer type, but this
191 : : field will be the enum type. */
192 : : tree original_type;
193 : :
194 : : /* The source range of this expression. This is redundant
195 : : for node values that have locations, but not all node kinds
196 : : have locations (e.g. constants, and references to params, locals,
197 : : etc), so we stash a copy here. */
198 : : source_range src_range;
199 : :
200 : : /* True if this was directly from a decimal constant token. */
201 : : bool m_decimal : 1;
202 : :
203 : : /* Access to the first and last locations within the source spelling
204 : : of this expression. */
205 : 55631885 : location_t get_start () const { return src_range.m_start; }
206 : 138599654 : location_t get_finish () const { return src_range.m_finish; }
207 : :
208 : 246706154 : location_t get_location () const
209 : : {
210 : 246706154 : if (EXPR_HAS_LOCATION (value))
211 : 157665952 : return EXPR_LOCATION (value);
212 : : else
213 : 89040202 : return make_location (get_start (), get_start (), get_finish ());
214 : : }
215 : :
216 : : /* Set the value to error_mark_node whilst ensuring that src_range
217 : : and m_decimal are initialized. */
218 : 13936 : void set_error ()
219 : : {
220 : 13936 : value = error_mark_node;
221 : 13936 : src_range.m_start = UNKNOWN_LOCATION;
222 : 13936 : src_range.m_finish = UNKNOWN_LOCATION;
223 : 13920 : m_decimal = 0;
224 : 1155 : }
225 : : };
226 : :
227 : : /* Type alias for struct c_expr. This allows to use the structure
228 : : inside the VEC types. */
229 : : typedef struct c_expr c_expr_t;
230 : :
231 : : /* A kind of type specifier. Note that this information is currently
232 : : only used to distinguish tag definitions, tag references and typeof
233 : : uses. */
234 : : enum c_typespec_kind {
235 : : /* No typespec. This appears only in struct c_declspec. */
236 : : ctsk_none,
237 : : /* A reserved keyword type specifier. */
238 : : ctsk_resword,
239 : : /* A reference to a tag, previously declared, such as "struct foo".
240 : : This includes where the previous declaration was as a different
241 : : kind of tag, in which case this is only valid if shadowing that
242 : : tag in an inner scope. */
243 : : ctsk_tagref,
244 : : /* Likewise, with standard attributes present in the reference. */
245 : : ctsk_tagref_attrs,
246 : : /* A reference to a tag, not previously declared in a visible
247 : : scope. */
248 : : ctsk_tagfirstref,
249 : : /* Likewise, with standard attributes present in the reference. */
250 : : ctsk_tagfirstref_attrs,
251 : : /* A definition of a tag such as "struct foo { int a; }". */
252 : : ctsk_tagdef,
253 : : /* A typedef name. */
254 : : ctsk_typedef,
255 : : /* An ObjC-specific kind of type specifier. */
256 : : ctsk_objc,
257 : : /* A typeof specifier, or _Atomic ( type-name ). */
258 : : ctsk_typeof
259 : : };
260 : :
261 : : /* A type specifier: this structure is created in the parser and
262 : : passed to declspecs_add_type only. */
263 : : struct c_typespec {
264 : : /* What kind of type specifier this is. */
265 : : enum c_typespec_kind kind;
266 : : /* Whether the expression has operands suitable for use in constant
267 : : expressions. */
268 : : bool expr_const_operands;
269 : : /* Whether the type specifier includes an enum type specifier (that
270 : : is, ": specifier-qualifier-list" in a declaration using
271 : : "enum"). */
272 : : bool has_enum_type_specifier;
273 : : /* The specifier itself. */
274 : : tree spec;
275 : : /* An expression to be evaluated before the type specifier, in the
276 : : case of typeof specifiers, or NULL otherwise or if no such
277 : : expression is required for a particular typeof specifier. In
278 : : particular, when typeof is applied to an expression of variably
279 : : modified type, that expression must be evaluated in order to
280 : : determine array sizes that form part of the type, but the
281 : : expression itself (as opposed to the array sizes) forms no part
282 : : of the type and so needs to be recorded separately. */
283 : : tree expr;
284 : : };
285 : :
286 : : /* A storage class specifier. */
287 : : enum c_storage_class {
288 : : csc_none,
289 : : csc_auto,
290 : : csc_extern,
291 : : csc_register,
292 : : csc_static,
293 : : csc_typedef
294 : : };
295 : :
296 : : /* A type specifier keyword "void", "_Bool", "char", "int", "float",
297 : : "double", "_Decimal32", "_Decimal64", "_Decimal128", "_Decimal64x",
298 : : "_Fract", "_Accum", "_BitInt", or none of these. */
299 : : enum c_typespec_keyword {
300 : : cts_none,
301 : : cts_void,
302 : : cts_bool,
303 : : cts_char,
304 : : cts_int,
305 : : cts_float,
306 : : cts_int_n,
307 : : cts_double,
308 : : cts_dfloat32,
309 : : cts_dfloat64,
310 : : cts_dfloat128,
311 : : cts_dfloat64x,
312 : : cts_floatn_nx,
313 : : cts_fract,
314 : : cts_accum,
315 : : cts_bitint,
316 : : cts_auto_type
317 : : };
318 : :
319 : : /* This enum lists all the possible declarator specifiers, storage
320 : : class or attribute that a user can write. There is at least one
321 : : enumerator per possible declarator specifier in the struct
322 : : c_declspecs below.
323 : :
324 : : It is used to index the array of declspec locations in struct
325 : : c_declspecs. */
326 : : enum c_declspec_word {
327 : : cdw_typespec /* A catch-all for a typespec. */,
328 : : cdw_storage_class /* A catch-all for a storage class */,
329 : : cdw_attributes,
330 : : cdw_typedef,
331 : : cdw_explicit_signed,
332 : : cdw_deprecated,
333 : : cdw_default_int,
334 : : cdw_long,
335 : : cdw_long_long,
336 : : cdw_short,
337 : : cdw_signed,
338 : : cdw_unsigned,
339 : : cdw_complex,
340 : : cdw_inline,
341 : : cdw_noreturn,
342 : : cdw_thread,
343 : : cdw_const,
344 : : cdw_volatile,
345 : : cdw_restrict,
346 : : cdw_atomic,
347 : : cdw_saturating,
348 : : cdw_alignas,
349 : : cdw_address_space,
350 : : cdw_gimple,
351 : : cdw_rtl,
352 : : cdw_number_of_elements /* This one must always be the last
353 : : enumerator. */
354 : : };
355 : :
356 : : enum c_declspec_il {
357 : : cdil_none,
358 : : cdil_gimple, /* __GIMPLE */
359 : : cdil_gimple_cfg, /* __GIMPLE(cfg) */
360 : : cdil_gimple_ssa, /* __GIMPLE(ssa) */
361 : : cdil_rtl /* __RTL */
362 : : };
363 : :
364 : : /* A sequence of declaration specifiers in C. When a new declaration
365 : : specifier is added, please update the enum c_declspec_word above
366 : : accordingly. */
367 : : struct c_declspecs {
368 : : location_t locations[cdw_number_of_elements];
369 : : /* The type specified, if a single type specifier such as a struct,
370 : : union or enum specifier, typedef name or typeof specifies the
371 : : whole type, or NULL_TREE if none or a keyword such as "void" or
372 : : "char" is used. Does not include qualifiers. */
373 : : tree type;
374 : : /* Any expression to be evaluated before the type, from a typeof
375 : : specifier. */
376 : : tree expr;
377 : : /* The attributes from a typedef decl. */
378 : : tree decl_attr;
379 : : /* When parsing, the GNU attributes and prefix standard attributes.
380 : : Outside the parser, this will be NULL; attributes (possibly from
381 : : multiple lists) will be passed separately. */
382 : : tree attrs;
383 : : /* When parsing, postfix standard attributes (which appertain to the
384 : : type specified by the preceding declaration specifiers, unlike
385 : : prefix standard attributes which appertain to the declaration or
386 : : declarations as a whole). */
387 : : tree postfix_attrs;
388 : : /* The pass to start compiling a __GIMPLE or __RTL function with. */
389 : : char *gimple_or_rtl_pass;
390 : : /* ENTRY BB count. */
391 : : profile_count entry_bb_count;
392 : : /* The base-2 log of the greatest alignment required by an _Alignas
393 : : specifier, in bytes, or -1 if no such specifiers with nonzero
394 : : alignment. */
395 : : int align_log;
396 : : union {
397 : : /* For the __intN declspec, this stores the index into the int_n_*
398 : : arrays. */
399 : : int int_n_idx;
400 : : /* For the _FloatN and _FloatNx declspec, this stores the index into
401 : : the floatn_nx_types array. */
402 : : int floatn_nx_idx;
403 : : /* For _BitInt(N) this stores the N. */
404 : : int bitint_prec;
405 : : } u;
406 : : /* The storage class specifier, or csc_none if none. */
407 : : enum c_storage_class storage_class;
408 : : /* Any type specifier keyword used such as "int", not reflecting
409 : : modifiers such as "short", or cts_none if none. */
410 : : ENUM_BITFIELD (c_typespec_keyword) typespec_word : 8;
411 : : /* The kind of type specifier if one has been seen, ctsk_none
412 : : otherwise. */
413 : : ENUM_BITFIELD (c_typespec_kind) typespec_kind : 4;
414 : : ENUM_BITFIELD (c_declspec_il) declspec_il : 3;
415 : : /* Whether any expressions in typeof specifiers may appear in
416 : : constant expressions. */
417 : : BOOL_BITFIELD expr_const_operands : 1;
418 : : /* Whether any declaration specifiers have been seen at all. */
419 : : BOOL_BITFIELD declspecs_seen_p : 1;
420 : : /* Whether any declaration specifiers other than standard attributes
421 : : have been seen at all. If only standard attributes have been
422 : : seen, this is an attribute-declaration. */
423 : : BOOL_BITFIELD non_std_attrs_seen_p : 1;
424 : : /* Whether something other than a storage class specifier or
425 : : attribute has been seen. This is used to warn for the
426 : : obsolescent usage of storage class specifiers other than at the
427 : : start of the list. (Doing this properly would require function
428 : : specifiers to be handled separately from storage class
429 : : specifiers.) */
430 : : BOOL_BITFIELD non_sc_seen_p : 1;
431 : : /* Whether the type is specified by a typedef or typeof name. */
432 : : BOOL_BITFIELD typedef_p : 1;
433 : : /* Whether the type is explicitly "signed" or specified by a typedef
434 : : whose type is explicitly "signed". */
435 : : BOOL_BITFIELD explicit_signed_p : 1;
436 : : /* Whether the specifiers include a deprecated typedef. */
437 : : BOOL_BITFIELD deprecated_p : 1;
438 : : /* Whether the specifiers include an unavailable typedef. */
439 : : BOOL_BITFIELD unavailable_p : 1;
440 : : /* Whether the type defaulted to "int" because there were no type
441 : : specifiers. */
442 : : BOOL_BITFIELD default_int_p : 1;
443 : : /* Whether "long" was specified. */
444 : : BOOL_BITFIELD long_p : 1;
445 : : /* Whether "long" was specified more than once. */
446 : : BOOL_BITFIELD long_long_p : 1;
447 : : /* Whether "short" was specified. */
448 : : BOOL_BITFIELD short_p : 1;
449 : : /* Whether "signed" was specified. */
450 : : BOOL_BITFIELD signed_p : 1;
451 : : /* Whether "unsigned" was specified. */
452 : : BOOL_BITFIELD unsigned_p : 1;
453 : : /* Whether "complex" was specified. */
454 : : BOOL_BITFIELD complex_p : 1;
455 : : /* Whether "inline" was specified. */
456 : : BOOL_BITFIELD inline_p : 1;
457 : : /* Whether "_Noreturn" was speciied. */
458 : : BOOL_BITFIELD noreturn_p : 1;
459 : : /* Whether "__thread" or "_Thread_local" was specified. */
460 : : BOOL_BITFIELD thread_p : 1;
461 : : /* Whether "__thread" rather than "_Thread_local" was specified. */
462 : : BOOL_BITFIELD thread_gnu_p : 1;
463 : : /* Whether "const" was specified. */
464 : : BOOL_BITFIELD const_p : 1;
465 : : /* Whether "volatile" was specified. */
466 : : BOOL_BITFIELD volatile_p : 1;
467 : : /* Whether "restrict" was specified. */
468 : : BOOL_BITFIELD restrict_p : 1;
469 : : /* Whether "_Atomic" was specified. */
470 : : BOOL_BITFIELD atomic_p : 1;
471 : : /* Whether "_Sat" was specified. */
472 : : BOOL_BITFIELD saturating_p : 1;
473 : : /* Whether any alignment specifier (even with zero alignment) was
474 : : specified. */
475 : : BOOL_BITFIELD alignas_p : 1;
476 : : /* Whether an enum type specifier (": specifier-qualifier-list") was
477 : : specified other than in a definition of that enum (if so, this is
478 : : invalid unless it is an empty declaration "enum identifier
479 : : enum-type-specifier;", but such an empty declaration is valid in
480 : : C23 when "enum identifier;" would not be). */
481 : : BOOL_BITFIELD enum_type_specifier_ref_p : 1;
482 : : /* Whether "auto" was specified in C23 (or later) mode and means the
483 : : type is to be deduced from an initializer, or would mean that if
484 : : no type specifier appears later in these declaration
485 : : specifiers. */
486 : : BOOL_BITFIELD c23_auto_p : 1;
487 : : /* Whether "constexpr" was specified. */
488 : : BOOL_BITFIELD constexpr_p : 1;
489 : : /* The address space that the declaration belongs to. */
490 : : addr_space_t address_space;
491 : : };
492 : :
493 : : /* The various kinds of declarators in C. */
494 : : enum c_declarator_kind {
495 : : /* An identifier. */
496 : : cdk_id,
497 : : /* A function. */
498 : : cdk_function,
499 : : /* An array. */
500 : : cdk_array,
501 : : /* A pointer. */
502 : : cdk_pointer,
503 : : /* Parenthesized declarator with nested attributes. */
504 : : cdk_attrs
505 : : };
506 : :
507 : : struct c_arg_tag {
508 : : /* The argument name. */
509 : : tree id;
510 : : /* The type of the argument. */
511 : : tree type;
512 : : };
513 : :
514 : :
515 : : /* Information about the parameters in a function declarator. */
516 : : struct c_arg_info {
517 : : /* A list of parameter decls. */
518 : : tree parms;
519 : : /* A list of structure, union and enum tags defined. */
520 : : vec<c_arg_tag, va_gc> *tags;
521 : : /* A list of argument types to go in the FUNCTION_TYPE. */
522 : : tree types;
523 : : /* A list of non-parameter decls (notably enumeration constants)
524 : : defined with the parameters. */
525 : : tree others;
526 : : /* A compound expression of VLA sizes from the parameters, or NULL.
527 : : In a function definition, these are used to ensure that
528 : : side-effects in sizes of arrays converted to pointers (such as a
529 : : parameter int i[n++]) take place; otherwise, they are
530 : : ignored. */
531 : : tree pending_sizes;
532 : : /* True when these arguments had [*]. */
533 : : BOOL_BITFIELD had_vla_unspec : 1;
534 : : /* True when the arguments are a (...) prototype. */
535 : : BOOL_BITFIELD no_named_args_stdarg_p : 1;
536 : : /* True when empty parentheses have been interpreted as (void) in C23 or
537 : : later. This is only for use by -Wtraditional and is no longer needed if
538 : : -Wtraditional is removed. */
539 : : BOOL_BITFIELD c23_empty_parens : 1;
540 : : };
541 : :
542 : : /* A declarator. */
543 : : struct c_declarator {
544 : : /* The kind of declarator. */
545 : : enum c_declarator_kind kind;
546 : : location_t id_loc; /* Currently only set for cdk_id, cdk_array. */
547 : : /* Except for cdk_id, the contained declarator. For cdk_id, NULL. */
548 : : struct c_declarator *declarator;
549 : : union {
550 : : /* For identifiers. */
551 : : struct {
552 : : /* An IDENTIFIER_NODE, or NULL_TREE if an abstract
553 : : declarator. */
554 : : tree id;
555 : : /* Any attributes (which apply to the declaration rather than to
556 : : the type described by the outer declarators). */
557 : : tree attrs;
558 : : } id;
559 : : /* For functions. */
560 : : struct c_arg_info *arg_info;
561 : : /* For arrays. */
562 : : struct {
563 : : /* The array dimension, or NULL for [] and [*]. */
564 : : tree dimen;
565 : : /* The qualifiers inside []. */
566 : : int quals;
567 : : /* The attributes (currently ignored) inside []. */
568 : : tree attrs;
569 : : /* Whether [static] was used. */
570 : : BOOL_BITFIELD static_p : 1;
571 : : /* Whether [*] was used. */
572 : : BOOL_BITFIELD vla_unspec_p : 1;
573 : : } array;
574 : : /* For pointers, the qualifiers on the pointer type. */
575 : : int pointer_quals;
576 : : /* For attributes. */
577 : : tree attrs;
578 : : } u;
579 : : };
580 : :
581 : : /* A type name. */
582 : : struct c_type_name {
583 : : /* The declaration specifiers. */
584 : : struct c_declspecs *specs;
585 : : /* The declarator. */
586 : : struct c_declarator *declarator;
587 : : };
588 : :
589 : : /* A parameter. */
590 : : struct c_parm {
591 : : /* The declaration specifiers, minus any prefix attributes. */
592 : : struct c_declspecs *specs;
593 : : /* The attributes. */
594 : : tree attrs;
595 : : /* The declarator. */
596 : : struct c_declarator *declarator;
597 : : /* The location of the parameter. */
598 : : location_t loc;
599 : : };
600 : :
601 : : /* Used when parsing an enum. Initialized by start_enum. */
602 : : struct c_enum_contents
603 : : {
604 : : /* While defining an enum type, this is 1 plus the last enumerator
605 : : constant value. */
606 : : tree enum_next_value;
607 : :
608 : : /* The enumeration type itself. */
609 : : tree enum_type;
610 : :
611 : : /* Nonzero means that there was overflow computing enum_next_value. */
612 : : int enum_overflow;
613 : : };
614 : :
615 : : /* A type of reference to a static identifier in an inline
616 : : function. */
617 : : enum c_inline_static_type {
618 : : /* Identifier with internal linkage used in function that may be an
619 : : inline definition (i.e., file-scope static). */
620 : : csi_internal,
621 : : /* Modifiable object with static storage duration defined in
622 : : function that may be an inline definition (i.e., local
623 : : static). */
624 : : csi_modifiable
625 : : };
626 : :
627 : :
628 : : /* in c-parser.cc */
629 : : struct c_tree_token_vec;
630 : : extern void c_parse_init (void);
631 : : extern bool c_keyword_starts_typename (enum rid keyword);
632 : :
633 : : /* in c-aux-info.cc */
634 : : extern void gen_aux_info_record (tree, int, int, int);
635 : :
636 : : /* in c-decl.cc */
637 : : struct c_spot_bindings;
638 : : class c_struct_parse_info;
639 : : extern struct obstack parser_obstack;
640 : : /* Set to IN_ITERATION_STMT if parsing an iteration-statement,
641 : : to IN_OMP_BLOCK if parsing OpenMP structured block and
642 : : IN_OMP_FOR if parsing OpenMP loop. If parsing a switch statement,
643 : : this is bitwise ORed with IN_SWITCH_STMT, unless parsing an
644 : : iteration-statement, OpenMP block or loop within that switch.
645 : : If the innermost iteration/switch statement is named, IN_NAMED_STMT
646 : : is additionally bitwise ORed into it. */
647 : : #define IN_SWITCH_STMT 1
648 : : #define IN_ITERATION_STMT 2
649 : : #define IN_OMP_BLOCK 4
650 : : #define IN_OMP_FOR 8
651 : : #define IN_OBJC_FOREACH 16
652 : : #define IN_NAMED_STMT 32
653 : : extern unsigned char in_statement;
654 : :
655 : : extern bool switch_statement_break_seen_p;
656 : :
657 : : extern bool global_bindings_p (void);
658 : : extern tree pushdecl (tree);
659 : : extern unsigned int start_underspecified_init (location_t, tree);
660 : : extern void finish_underspecified_init (tree, unsigned int);
661 : : extern void push_scope (void);
662 : : extern tree pop_scope (void);
663 : : extern void c_mark_decl_jump_unsafe_in_current_scope ();
664 : : extern void c_bindings_start_stmt_expr (struct c_spot_bindings *);
665 : : extern void c_bindings_end_stmt_expr (struct c_spot_bindings *);
666 : :
667 : : extern void record_inline_static (location_t, tree, tree,
668 : : enum c_inline_static_type);
669 : : extern void c_init_decl_processing (void);
670 : : extern void c_print_identifier (FILE *, tree, int);
671 : : extern int quals_from_declspecs (const struct c_declspecs *);
672 : : extern struct c_declarator *build_array_declarator (location_t, tree,
673 : : struct c_declspecs *,
674 : : bool, bool);
675 : : extern tree build_enumerator (location_t, location_t, struct c_enum_contents *,
676 : : tree, tree);
677 : : extern tree check_for_loop_decls (location_t, bool);
678 : : extern void mark_forward_parm_decls (void);
679 : : extern void declare_parm_level (void);
680 : : extern void undeclared_variable (location_t, tree);
681 : : extern tree lookup_label_for_goto (location_t, tree);
682 : : extern tree declare_label (tree);
683 : : extern tree define_label (location_t, tree);
684 : : extern struct c_spot_bindings *c_get_switch_bindings (void);
685 : : extern void c_release_switch_bindings (struct c_spot_bindings *);
686 : : extern bool c_check_switch_jump_warnings (struct c_spot_bindings *,
687 : : location_t, location_t);
688 : : extern void finish_decl (tree, location_t, tree, tree, tree);
689 : : extern tree finish_enum (tree, tree, tree);
690 : : extern void finish_function (location_t = input_location);
691 : : extern tree finish_struct (location_t, tree, tree, tree,
692 : : class c_struct_parse_info *,
693 : : tree *expr = NULL);
694 : : extern tree c_simulate_enum_decl (location_t, const char *,
695 : : vec<string_int_pair> *);
696 : : extern tree c_simulate_record_decl (location_t, const char *,
697 : : array_slice<const tree>);
698 : : extern struct c_arg_info *build_arg_info (void);
699 : : extern struct c_arg_info *get_parm_info (bool, tree);
700 : : extern tree grokfield (location_t, struct c_declarator *,
701 : : struct c_declspecs *, tree, tree *, tree *);
702 : : extern tree groktypename (struct c_type_name *, tree *, bool *);
703 : : extern tree grokparm (const struct c_parm *, tree *);
704 : : extern tree implicitly_declare (location_t, tree);
705 : : extern void keep_next_level (void);
706 : : extern void pending_xref_error (void);
707 : : extern void c_push_function_context (void);
708 : : extern void c_pop_function_context (void);
709 : : extern void push_parm_decl (const struct c_parm *, tree *);
710 : : extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
711 : : struct c_declarator *);
712 : : extern tree c_builtin_function (tree);
713 : : extern tree c_builtin_function_ext_scope (tree);
714 : : extern tree c_simulate_builtin_function_decl (tree);
715 : : extern void c_warn_unused_attributes (tree);
716 : : extern tree c_warn_type_attributes (tree, tree);
717 : : extern void shadow_tag (const struct c_declspecs *);
718 : : extern void shadow_tag_warned (const struct c_declspecs *, int);
719 : : extern tree start_enum (location_t, struct c_enum_contents *, tree, tree,
720 : : bool potential_nesting_p);
721 : : extern bool start_function (struct c_declspecs *, struct c_declarator *, tree);
722 : : extern tree start_decl (struct c_declarator *, struct c_declspecs *, bool,
723 : : tree, bool = true, location_t * = NULL);
724 : : extern tree start_struct (location_t, enum tree_code, tree,
725 : : class c_struct_parse_info **);
726 : : extern void store_parm_decls (void);
727 : : extern void store_parm_decls_from (struct c_arg_info *);
728 : : extern void temp_store_parm_decls (tree, tree);
729 : : extern void temp_pop_parm_decls (void);
730 : : extern tree xref_tag (enum tree_code, tree);
731 : : extern struct c_typespec parser_xref_tag (location_t, enum tree_code, tree,
732 : : bool, tree, bool);
733 : : extern struct c_parm *build_c_parm (struct c_declspecs *, tree,
734 : : struct c_declarator *, location_t);
735 : : extern struct c_declarator *build_attrs_declarator (tree,
736 : : struct c_declarator *);
737 : : extern struct c_declarator *build_function_declarator (struct c_arg_info *,
738 : : struct c_declarator *);
739 : : extern struct c_declarator *build_id_declarator (tree);
740 : : extern struct c_declarator *make_pointer_declarator (struct c_declspecs *,
741 : : struct c_declarator *);
742 : : extern struct c_declspecs *build_null_declspecs (void);
743 : : extern struct c_declspecs *declspecs_add_qual (location_t,
744 : : struct c_declspecs *, tree);
745 : : extern struct c_declspecs *declspecs_add_type (location_t,
746 : : struct c_declspecs *,
747 : : struct c_typespec);
748 : : extern struct c_declspecs *declspecs_add_scspec (location_t,
749 : : struct c_declspecs *, tree);
750 : : extern struct c_declspecs *declspecs_add_attrs (location_t,
751 : : struct c_declspecs *, tree);
752 : : extern struct c_declspecs *declspecs_add_addrspace (location_t,
753 : : struct c_declspecs *,
754 : : addr_space_t);
755 : : extern struct c_declspecs *declspecs_add_alignas (location_t,
756 : : struct c_declspecs *, tree);
757 : : extern struct c_declspecs *finish_declspecs (struct c_declspecs *);
758 : : extern size_t c_tree_size (enum tree_code);
759 : : extern int c_get_loop_names (tree, bool, tree *);
760 : : extern void c_release_loop_names (int);
761 : : extern tree c_finish_bc_name (location_t, tree, bool);
762 : :
763 : : /* in c-objc-common.cc */
764 : : extern bool c_objc_common_init (void);
765 : : extern bool c_missing_noreturn_ok_p (tree);
766 : : extern bool c_warn_unused_global_decl (const_tree);
767 : : extern void c_initialize_diagnostics (diagnostics::context *);
768 : : extern bool c_var_mod_p (tree x, tree fn);
769 : : extern alias_set_type c_get_alias_set (tree);
770 : : extern int c_type_dwarf_attribute (const_tree, int);
771 : :
772 : : /* in c-typeck.cc */
773 : : extern int in_alignof;
774 : : extern int in_sizeof;
775 : : extern int in_countof;
776 : : extern int in_typeof;
777 : : extern bool c_in_omp_for;
778 : : extern bool c_omp_array_section_p;
779 : :
780 : : extern tree c_last_sizeof_arg;
781 : : extern location_t c_last_sizeof_loc;
782 : :
783 : : extern struct c_switch *c_switch_stack;
784 : :
785 : : extern bool null_pointer_constant_p (const_tree);
786 : :
787 : :
788 : : inline bool
789 : 133171123 : c_type_variably_modified_p (tree t)
790 : : {
791 : 133171123 : return error_mark_node != t && C_TYPE_VARIABLY_MODIFIED (t);
792 : : }
793 : :
794 : : inline bool
795 : 8314 : c_type_unspecified_p (tree t)
796 : : {
797 : 8314 : return error_mark_node != t
798 : 8314 : && C_TYPE_VARIABLE_SIZE (t) && TREE_CODE (t) == ARRAY_TYPE
799 : 8228 : && TYPE_DOMAIN (t) && TYPE_MAX_VALUE (TYPE_DOMAIN (t))
800 : 8228 : && TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == COMPOUND_EXPR
801 : 33 : && integer_zerop (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0))
802 : 8347 : && integer_zerop (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 1));
803 : : }
804 : :
805 : : extern bool char_type_p (tree);
806 : : extern tree c_type_tag (const_tree t);
807 : : extern tree c_objc_common_truthvalue_conversion (location_t, tree,
808 : : tree = integer_type_node);
809 : : extern tree require_complete_type (location_t, tree);
810 : : extern bool same_translation_unit_p (const_tree, const_tree);
811 : : extern int comptypes (tree, tree);
812 : : extern bool comptypes_same_p (tree, tree);
813 : : extern bool comptypes_equiv_p (tree, tree);
814 : : extern int comptypes_check_different_types (tree, tree, bool *);
815 : : extern int comptypes_check_enum_int (tree, tree, bool *);
816 : : extern bool c_mark_addressable (tree, bool = false, bool = false);
817 : : extern void c_incomplete_type_error (location_t, const_tree, const_tree);
818 : : extern tree c_type_promotes_to (tree);
819 : : extern struct c_expr default_function_array_conversion (location_t,
820 : : struct c_expr);
821 : : extern struct c_expr default_function_array_read_conversion (location_t,
822 : : struct c_expr);
823 : : extern struct c_expr convert_lvalue_to_rvalue (location_t, struct c_expr,
824 : : bool, bool, bool = false);
825 : : extern tree decl_constant_value_1 (tree, bool);
826 : : extern void mark_exp_read (tree);
827 : : extern tree composite_type (tree, tree);
828 : : extern tree lookup_field (const_tree, tree);
829 : : extern tree build_component_ref (location_t, tree, tree, location_t,
830 : : location_t);
831 : : extern tree handle_counted_by_for_component_ref (location_t, tree);
832 : : extern tree build_array_ref (location_t, tree, tree);
833 : : extern tree build_omp_array_section (location_t, tree, tree, tree);
834 : : extern tree build_external_ref (location_t, tree, bool, tree *);
835 : : extern void pop_maybe_used (bool);
836 : : extern void mark_decl_used (tree, bool);
837 : : extern struct c_expr c_expr_sizeof_expr (location_t, struct c_expr);
838 : : extern struct c_expr c_expr_sizeof_type (location_t, struct c_type_name *);
839 : : extern struct c_expr c_expr_countof_expr (location_t, struct c_expr);
840 : : extern struct c_expr c_expr_countof_type (location_t loc,
841 : : struct c_type_name *);
842 : : extern struct c_expr parser_build_unary_op (location_t, enum tree_code,
843 : : struct c_expr);
844 : : extern struct c_expr parser_build_binary_op (location_t,
845 : : enum tree_code, struct c_expr,
846 : : struct c_expr);
847 : : extern tree build_conditional_expr (location_t, tree, bool, tree, tree,
848 : : location_t, tree, tree, location_t);
849 : : extern tree build_compound_expr (location_t, tree, tree);
850 : : extern tree c_cast_expr (location_t, struct c_type_name *, tree);
851 : : extern tree build_c_cast (location_t, tree, tree);
852 : : extern void store_init_value (location_t, tree, tree, tree);
853 : : extern void maybe_warn_string_init (location_t, tree, struct c_expr);
854 : : extern void start_init (tree, tree, bool, bool, rich_location *);
855 : : extern void finish_init (void);
856 : : extern void really_start_incremental_init (tree);
857 : : extern void finish_implicit_inits (location_t, struct obstack *);
858 : : extern void push_init_level (location_t, int, struct obstack *);
859 : : extern struct c_expr pop_init_level (location_t, int, struct obstack *,
860 : : location_t);
861 : : extern void set_init_index (location_t, tree, tree, struct obstack *);
862 : : extern void set_init_label (location_t, tree, location_t, struct obstack *);
863 : : unsigned c_maybe_optimize_large_byte_initializer (void);
864 : : extern void process_init_element (location_t, struct c_expr, bool,
865 : : struct obstack *);
866 : : extern tree build_compound_literal (location_t, tree, tree, bool,
867 : : unsigned int, struct c_declspecs *);
868 : : extern void check_compound_literal_type (location_t, struct c_type_name *);
869 : : extern tree c_start_switch (location_t, location_t, tree, bool, tree);
870 : : extern void c_finish_switch (tree, tree);
871 : : extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool,
872 : : bool);
873 : : extern tree build_asm_stmt (bool, tree);
874 : : extern int c_types_compatible_p (tree, tree);
875 : : extern tree c_begin_compound_stmt (bool);
876 : : extern tree c_end_compound_stmt (location_t, tree, bool);
877 : : extern void c_finish_if_stmt (location_t, tree, tree, tree);
878 : : extern void c_finish_loop (location_t, location_t, tree, location_t, tree,
879 : : tree, tree, tree, bool);
880 : : extern tree c_begin_stmt_expr (void);
881 : : extern tree c_finish_stmt_expr (location_t, tree);
882 : : extern tree c_process_expr_stmt (location_t, tree);
883 : : extern tree c_finish_expr_stmt (location_t, tree);
884 : : extern tree c_finish_return (location_t, tree, tree, bool = false);
885 : : extern tree c_finish_bc_stmt (location_t, tree, bool, tree);
886 : : extern tree c_finish_goto_label (location_t, tree);
887 : : extern tree c_finish_goto_ptr (location_t, c_expr val);
888 : : extern tree c_expr_to_decl (tree, bool *, bool *);
889 : : extern tree c_finish_omp_construct (location_t, enum tree_code, tree, tree);
890 : : extern tree c_finish_oacc_data (location_t, tree, tree);
891 : : extern tree c_finish_oacc_host_data (location_t, tree, tree);
892 : : extern tree c_begin_omp_parallel (void);
893 : : extern tree c_finish_omp_parallel (location_t, tree, tree);
894 : : extern tree c_begin_omp_task (void);
895 : : extern tree c_finish_omp_task (location_t, tree, tree);
896 : : extern void c_finish_omp_cancel (location_t, tree);
897 : : extern void c_finish_omp_cancellation_point (location_t, tree);
898 : : extern tree c_finish_omp_clauses (tree, enum c_omp_region_type);
899 : : extern tree c_omp_finish_mapper_clauses (tree);
900 : : extern tree c_omp_mapper_lookup (tree, tree);
901 : : extern tree c_omp_extract_mapper_directive (tree);
902 : : extern tree c_omp_map_array_section (location_t, tree);
903 : : extern tree c_build_va_arg (location_t, tree, location_t, tree);
904 : : extern tree c_finish_transaction (location_t, tree, int);
905 : : extern bool c_tree_equal (tree, tree);
906 : : extern tree c_build_function_call_vec (location_t, const vec<location_t>&,
907 : : tree, vec<tree, va_gc> *,
908 : : vec<tree, va_gc> *);
909 : : extern tree c_omp_clause_copy_ctor (tree, tree, tree);
910 : : extern tree c_reconstruct_complex_type (tree, tree);
911 : : extern tree c_build_type_attribute_variant (tree ntype, tree attrs);
912 : : extern tree c_build_pointer_type (tree type);
913 : : extern tree c_build_array_type (tree type, tree domain);
914 : : extern tree c_build_array_type_unspecified (tree type);
915 : : extern tree c_build_function_type (tree type, tree args, bool no = false);
916 : : extern tree c_build_pointer_type_for_mode (tree type, machine_mode mode, bool m);
917 : :
918 : : /* Set to 0 at beginning of a function definition, set to 1 if
919 : : a return statement that specifies a return value is seen. */
920 : :
921 : : extern int current_function_returns_value;
922 : :
923 : : /* Set to 0 at beginning of a function definition, set to 1 if
924 : : a return statement with no argument is seen. */
925 : :
926 : : extern int current_function_returns_null;
927 : :
928 : : /* Set to 0 at beginning of a function definition, set to 1 if
929 : : a call to a noreturn function is seen. */
930 : :
931 : : extern int current_function_returns_abnormally;
932 : :
933 : : /* In c-decl.cc */
934 : :
935 : : /* Tell the binding oracle what kind of binding we are looking for. */
936 : :
937 : : enum c_oracle_request
938 : : {
939 : : C_ORACLE_SYMBOL,
940 : : C_ORACLE_TAG,
941 : : C_ORACLE_LABEL
942 : : };
943 : :
944 : : /* If this is non-NULL, then it is a "binding oracle" which can lazily
945 : : create bindings when needed by the C compiler. The oracle is told
946 : : the name and type of the binding to create. It can call pushdecl
947 : : or the like to ensure the binding is visible; or do nothing,
948 : : leaving the binding untouched. c-decl.cc takes note of when the
949 : : oracle has been called and will not call it again if it fails to
950 : : create a given binding. */
951 : :
952 : : typedef void c_binding_oracle_function (enum c_oracle_request, tree identifier);
953 : :
954 : : extern c_binding_oracle_function *c_binding_oracle;
955 : :
956 : : extern void c_finish_incomplete_decl (tree);
957 : : extern tree c_omp_reduction_id (enum tree_code, tree);
958 : : extern tree c_omp_reduction_decl (tree);
959 : : extern tree c_omp_reduction_lookup (tree, tree);
960 : : extern tree c_check_omp_declare_reduction_r (tree *, int *, void *);
961 : : extern tree c_omp_mapper_id (tree);
962 : : extern tree c_omp_mapper_decl (tree);
963 : : extern void c_omp_scan_mapper_bindings (location_t, tree *, tree);
964 : : extern tree c_omp_instantiate_mappers (tree);
965 : : extern bool c_check_in_current_scope (tree);
966 : : extern void c_pushtag (location_t, tree, tree);
967 : : extern void c_bind (location_t, tree, bool);
968 : : extern bool tag_exists_p (enum tree_code, tree);
969 : :
970 : : /* In c-errors.cc */
971 : : extern bool pedwarn_c90 (location_t, diagnostics::option_id, const char *, ...)
972 : : ATTRIBUTE_GCC_DIAG(3,4);
973 : : extern bool pedwarn_c99 (location_t, diagnostics::option_id, const char *, ...)
974 : : ATTRIBUTE_GCC_DIAG(3,4);
975 : : extern bool pedwarn_c11 (location_t, diagnostics::option_id, const char *, ...)
976 : : ATTRIBUTE_GCC_DIAG(3,4);
977 : : extern bool pedwarn_c23 (location_t, diagnostics::option_id, const char *, ...)
978 : : ATTRIBUTE_GCC_DIAG(3,4);
979 : : extern void add_note_about_new_keyword (location_t loc,
980 : : tree keyword_id);
981 : :
982 : : extern void
983 : : set_c_expr_source_range (c_expr *expr,
984 : : location_t start, location_t finish);
985 : :
986 : : extern void
987 : : set_c_expr_source_range (c_expr *expr,
988 : : source_range src_range);
989 : :
990 : : /* In c-fold.cc */
991 : : extern vec<tree> incomplete_record_decls;
992 : :
993 : : extern const char *c_get_sarif_source_language (const char *filename);
994 : :
995 : : extern const struct scoped_attribute_specs std_attribute_table;
996 : :
997 : : #if CHECKING_P
998 : : namespace selftest {
999 : : extern void run_c_tests (void);
1000 : : } // namespace selftest
1001 : : #endif /* #if CHECKING_P */
1002 : :
1003 : :
1004 : : #endif /* ! GCC_C_TREE_H */
|