xref: /dflybsd-src/contrib/gcc-8.0/gcc/cp/parser.h (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj /* Data structures and function exported by the C++ Parser.
2*38fd1498Szrj    Copyright (C) 2010-2018 Free Software Foundation, Inc.
3*38fd1498Szrj 
4*38fd1498Szrj    This file is part of GCC.
5*38fd1498Szrj 
6*38fd1498Szrj    GCC is free software; you can redistribute it and/or modify it
7*38fd1498Szrj    under the terms of the GNU General Public License as published by
8*38fd1498Szrj    the Free Software Foundation; either version 3, or (at your option)
9*38fd1498Szrj    any later version.
10*38fd1498Szrj 
11*38fd1498Szrj    GCC is distributed in the hope that it will be useful, but
12*38fd1498Szrj    WITHOUT ANY WARRANTY; without even the implied warranty of
13*38fd1498Szrj    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14*38fd1498Szrj    General Public License for more details.
15*38fd1498Szrj 
16*38fd1498Szrj You should have received a copy of the GNU General Public License
17*38fd1498Szrj along with GCC; see the file COPYING3.  If not see
18*38fd1498Szrj <http://www.gnu.org/licenses/>.  */
19*38fd1498Szrj 
20*38fd1498Szrj #ifndef GCC_CP_PARSER_H
21*38fd1498Szrj #define GCC_CP_PARSER_H
22*38fd1498Szrj 
23*38fd1498Szrj #include "tree.h"
24*38fd1498Szrj #include "cp/cp-tree.h"
25*38fd1498Szrj #include "c-family/c-pragma.h"
26*38fd1498Szrj 
27*38fd1498Szrj /* A token's value and its associated deferred access checks and
28*38fd1498Szrj    qualifying scope.  */
29*38fd1498Szrj 
30*38fd1498Szrj struct GTY(()) tree_check {
31*38fd1498Szrj   /* The value associated with the token.  */
32*38fd1498Szrj   tree value;
33*38fd1498Szrj   /* The checks that have been associated with value.  */
34*38fd1498Szrj   vec<deferred_access_check, va_gc> *checks;
35*38fd1498Szrj   /* The token's qualifying scope (used when it is a
36*38fd1498Szrj      CPP_NESTED_NAME_SPECIFIER).  */
37*38fd1498Szrj   tree qualifying_scope;
38*38fd1498Szrj };
39*38fd1498Szrj 
40*38fd1498Szrj /* A C++ token.  */
41*38fd1498Szrj 
42*38fd1498Szrj struct GTY (()) cp_token {
43*38fd1498Szrj   /* The kind of token.  */
44*38fd1498Szrj   ENUM_BITFIELD (cpp_ttype) type : 8;
45*38fd1498Szrj   /* If this token is a keyword, this value indicates which keyword.
46*38fd1498Szrj      Otherwise, this value is RID_MAX.  */
47*38fd1498Szrj   ENUM_BITFIELD (rid) keyword : 8;
48*38fd1498Szrj   /* Token flags.  */
49*38fd1498Szrj   unsigned char flags;
50*38fd1498Szrj   /* True if this token is from a context where it is implicitly extern "C" */
51*38fd1498Szrj   BOOL_BITFIELD implicit_extern_c : 1;
52*38fd1498Szrj   /* True if an error has already been reported for this token, such as a
53*38fd1498Szrj      CPP_NAME token that is not a keyword (i.e., for which KEYWORD is
54*38fd1498Szrj      RID_MAX) iff this name was looked up and found to be ambiguous.  */
55*38fd1498Szrj   BOOL_BITFIELD error_reported : 1;
56*38fd1498Szrj   /* True for a token that has been purged.  If a token is purged,
57*38fd1498Szrj      it is no longer a valid token and it should be considered
58*38fd1498Szrj      deleted.  */
59*38fd1498Szrj   BOOL_BITFIELD purged_p : 1;
60*38fd1498Szrj   /* 5 unused bits.  */
61*38fd1498Szrj   /* The location at which this token was found.  */
62*38fd1498Szrj   location_t location;
63*38fd1498Szrj   /* The value associated with this token, if any.  */
64*38fd1498Szrj   union cp_token_value {
65*38fd1498Szrj     /* Used for compound tokens such as CPP_NESTED_NAME_SPECIFIER.  */
66*38fd1498Szrj     struct tree_check* GTY((tag ("1"))) tree_check_value;
67*38fd1498Szrj     /* Use for all other tokens.  */
68*38fd1498Szrj     tree GTY((tag ("0"))) value;
69*38fd1498Szrj   } GTY((desc ("(%1.type == CPP_TEMPLATE_ID)"
70*38fd1498Szrj 	       "|| (%1.type == CPP_NESTED_NAME_SPECIFIER)"
71*38fd1498Szrj 	       "|| (%1.type == CPP_DECLTYPE)"))) u;
72*38fd1498Szrj };
73*38fd1498Szrj 
74*38fd1498Szrj 
75*38fd1498Szrj /* We use a stack of token pointer for saving token sets.  */
76*38fd1498Szrj typedef struct cp_token *cp_token_position;
77*38fd1498Szrj 
78*38fd1498Szrj /* The cp_lexer structure represents the C++ lexer.  It is responsible
79*38fd1498Szrj    for managing the token stream from the preprocessor and supplying
80*38fd1498Szrj    it to the parser.  Tokens are never added to the cp_lexer after
81*38fd1498Szrj    it is created.  */
82*38fd1498Szrj 
83*38fd1498Szrj struct GTY (()) cp_lexer {
84*38fd1498Szrj   /* The memory allocated for the buffer.  NULL if this lexer does not
85*38fd1498Szrj      own the token buffer.  */
86*38fd1498Szrj   vec<cp_token, va_gc> *buffer;
87*38fd1498Szrj 
88*38fd1498Szrj   /* A pointer just past the last available token.  The tokens
89*38fd1498Szrj      in this lexer are [buffer, last_token).  */
90*38fd1498Szrj   cp_token_position GTY ((skip)) last_token;
91*38fd1498Szrj 
92*38fd1498Szrj   /* The next available token.  If NEXT_TOKEN is &eof_token, then there are
93*38fd1498Szrj      no more available tokens.  */
94*38fd1498Szrj   cp_token_position GTY ((skip)) next_token;
95*38fd1498Szrj 
96*38fd1498Szrj   /* A stack indicating positions at which cp_lexer_save_tokens was
97*38fd1498Szrj      called.  The top entry is the most recent position at which we
98*38fd1498Szrj      began saving tokens.  If the stack is non-empty, we are saving
99*38fd1498Szrj      tokens.  */
100*38fd1498Szrj   vec<cp_token_position> GTY ((skip)) saved_tokens;
101*38fd1498Szrj 
102*38fd1498Szrj   /* The next lexer in a linked list of lexers.  */
103*38fd1498Szrj   struct cp_lexer *next;
104*38fd1498Szrj 
105*38fd1498Szrj   /* True if we should output debugging information.  */
106*38fd1498Szrj   bool debugging_p;
107*38fd1498Szrj 
108*38fd1498Szrj   /* True if we're in the context of parsing a pragma, and should not
109*38fd1498Szrj      increment past the end-of-line marker.  */
110*38fd1498Szrj   bool in_pragma;
111*38fd1498Szrj };
112*38fd1498Szrj 
113*38fd1498Szrj 
114*38fd1498Szrj /* cp_token_cache is a range of tokens.  There is no need to represent
115*38fd1498Szrj    allocate heap memory for it, since tokens are never removed from the
116*38fd1498Szrj    lexer's array.  There is also no need for the GC to walk through
117*38fd1498Szrj    a cp_token_cache, since everything in here is referenced through
118*38fd1498Szrj    a lexer.  */
119*38fd1498Szrj 
120*38fd1498Szrj struct GTY(()) cp_token_cache {
121*38fd1498Szrj   /* The beginning of the token range.  */
122*38fd1498Szrj   cp_token * GTY((skip)) first;
123*38fd1498Szrj 
124*38fd1498Szrj   /* Points immediately after the last token in the range.  */
125*38fd1498Szrj   cp_token * GTY ((skip)) last;
126*38fd1498Szrj };
127*38fd1498Szrj 
128*38fd1498Szrj typedef cp_token_cache *cp_token_cache_ptr;
129*38fd1498Szrj 
130*38fd1498Szrj struct cp_token_ident
131*38fd1498Szrj {
132*38fd1498Szrj   unsigned int ident_len;
133*38fd1498Szrj   const char *ident_str;
134*38fd1498Szrj   unsigned int before_len;
135*38fd1498Szrj   const char *before_str;
136*38fd1498Szrj   unsigned int after_len;
137*38fd1498Szrj   const char *after_str;
138*38fd1498Szrj };
139*38fd1498Szrj 
140*38fd1498Szrj /* An entry in a queue of function arguments that require post-processing.  */
141*38fd1498Szrj 
142*38fd1498Szrj struct GTY(()) cp_default_arg_entry {
143*38fd1498Szrj   /* The current_class_type when we parsed this arg.  */
144*38fd1498Szrj   tree class_type;
145*38fd1498Szrj 
146*38fd1498Szrj   /* The function decl itself.  */
147*38fd1498Szrj   tree decl;
148*38fd1498Szrj };
149*38fd1498Szrj 
150*38fd1498Szrj 
151*38fd1498Szrj /* An entry in a stack for member functions defined within their classes.  */
152*38fd1498Szrj 
153*38fd1498Szrj struct GTY(()) cp_unparsed_functions_entry {
154*38fd1498Szrj   /* Functions with default arguments that require post-processing.
155*38fd1498Szrj      Functions appear in this list in declaration order.  */
156*38fd1498Szrj   vec<cp_default_arg_entry, va_gc> *funs_with_default_args;
157*38fd1498Szrj 
158*38fd1498Szrj   /* Functions with defintions that require post-processing.  Functions
159*38fd1498Szrj      appear in this list in declaration order.  */
160*38fd1498Szrj   vec<tree, va_gc> *funs_with_definitions;
161*38fd1498Szrj 
162*38fd1498Szrj   /* Non-static data members with initializers that require post-processing.
163*38fd1498Szrj      FIELD_DECLs appear in this list in declaration order.  */
164*38fd1498Szrj   vec<tree, va_gc> *nsdmis;
165*38fd1498Szrj 
166*38fd1498Szrj   /* Nested classes go in this vector, so that we can do some final
167*38fd1498Szrj      processing after parsing any NSDMIs.  */
168*38fd1498Szrj   vec<tree, va_gc> *classes;
169*38fd1498Szrj };
170*38fd1498Szrj 
171*38fd1498Szrj 
172*38fd1498Szrj /* The status of a tentative parse.  */
173*38fd1498Szrj 
174*38fd1498Szrj enum cp_parser_status_kind
175*38fd1498Szrj {
176*38fd1498Szrj   /* No errors have occurred.  */
177*38fd1498Szrj   CP_PARSER_STATUS_KIND_NO_ERROR,
178*38fd1498Szrj   /* An error has occurred.  */
179*38fd1498Szrj   CP_PARSER_STATUS_KIND_ERROR,
180*38fd1498Szrj   /* We are committed to this tentative parse, whether or not an error
181*38fd1498Szrj      has occurred.  */
182*38fd1498Szrj   CP_PARSER_STATUS_KIND_COMMITTED
183*38fd1498Szrj };
184*38fd1498Szrj 
185*38fd1498Szrj 
186*38fd1498Szrj /* Context that is saved and restored when parsing tentatively.  */
187*38fd1498Szrj struct GTY (()) cp_parser_context {
188*38fd1498Szrj   /* If this is a tentative parsing context, the status of the
189*38fd1498Szrj      tentative parse.  */
190*38fd1498Szrj   enum cp_parser_status_kind status;
191*38fd1498Szrj   /* If non-NULL, we have just seen a `x->' or `x.' expression.  Names
192*38fd1498Szrj      that are looked up in this context must be looked up both in the
193*38fd1498Szrj      scope given by OBJECT_TYPE (the type of `x' or `*x') and also in
194*38fd1498Szrj      the context of the containing expression.  */
195*38fd1498Szrj   tree object_type;
196*38fd1498Szrj 
197*38fd1498Szrj   /* The next parsing context in the stack.  */
198*38fd1498Szrj   struct cp_parser_context *next;
199*38fd1498Szrj };
200*38fd1498Szrj 
201*38fd1498Szrj 
202*38fd1498Szrj /* Helper data structure for parsing #pragma omp declare simd.  */
203*38fd1498Szrj struct cp_omp_declare_simd_data {
204*38fd1498Szrj   bool error_seen; /* Set if error has been reported.  */
205*38fd1498Szrj   bool fndecl_seen; /* Set if one fn decl/definition has been seen already.  */
206*38fd1498Szrj   vec<cp_token_cache_ptr> tokens;
207*38fd1498Szrj   tree clauses;
208*38fd1498Szrj };
209*38fd1498Szrj 
210*38fd1498Szrj /* Helper data structure for parsing #pragma acc routine.  */
211*38fd1498Szrj struct cp_oacc_routine_data : cp_omp_declare_simd_data {
212*38fd1498Szrj   location_t loc;
213*38fd1498Szrj };
214*38fd1498Szrj 
215*38fd1498Szrj /* The cp_parser structure represents the C++ parser.  */
216*38fd1498Szrj 
217*38fd1498Szrj struct GTY(()) cp_parser {
218*38fd1498Szrj   /* The lexer from which we are obtaining tokens.  */
219*38fd1498Szrj   cp_lexer *lexer;
220*38fd1498Szrj 
221*38fd1498Szrj   /* The scope in which names should be looked up.  If NULL_TREE, then
222*38fd1498Szrj      we look up names in the scope that is currently open in the
223*38fd1498Szrj      source program.  If non-NULL, this is either a TYPE or
224*38fd1498Szrj      NAMESPACE_DECL for the scope in which we should look.  It can
225*38fd1498Szrj      also be ERROR_MARK, when we've parsed a bogus scope.
226*38fd1498Szrj 
227*38fd1498Szrj      This value is not cleared automatically after a name is looked
228*38fd1498Szrj      up, so we must be careful to clear it before starting a new look
229*38fd1498Szrj      up sequence.  (If it is not cleared, then `X::Y' followed by `Z'
230*38fd1498Szrj      will look up `Z' in the scope of `X', rather than the current
231*38fd1498Szrj      scope.)  Unfortunately, it is difficult to tell when name lookup
232*38fd1498Szrj      is complete, because we sometimes peek at a token, look it up,
233*38fd1498Szrj      and then decide not to consume it.   */
234*38fd1498Szrj   tree scope;
235*38fd1498Szrj 
236*38fd1498Szrj   /* OBJECT_SCOPE and QUALIFYING_SCOPE give the scopes in which the
237*38fd1498Szrj      last lookup took place.  OBJECT_SCOPE is used if an expression
238*38fd1498Szrj      like "x->y" or "x.y" was used; it gives the type of "*x" or "x",
239*38fd1498Szrj      respectively.  QUALIFYING_SCOPE is used for an expression of the
240*38fd1498Szrj      form "X::Y"; it refers to X.  */
241*38fd1498Szrj   tree object_scope;
242*38fd1498Szrj   tree qualifying_scope;
243*38fd1498Szrj 
244*38fd1498Szrj   /* A stack of parsing contexts.  All but the bottom entry on the
245*38fd1498Szrj      stack will be tentative contexts.
246*38fd1498Szrj 
247*38fd1498Szrj      We parse tentatively in order to determine which construct is in
248*38fd1498Szrj      use in some situations.  For example, in order to determine
249*38fd1498Szrj      whether a statement is an expression-statement or a
250*38fd1498Szrj      declaration-statement we parse it tentatively as a
251*38fd1498Szrj      declaration-statement.  If that fails, we then reparse the same
252*38fd1498Szrj      token stream as an expression-statement.  */
253*38fd1498Szrj   cp_parser_context *context;
254*38fd1498Szrj 
255*38fd1498Szrj   /* True if we are parsing GNU C++.  If this flag is not set, then
256*38fd1498Szrj      GNU extensions are not recognized.  */
257*38fd1498Szrj   bool allow_gnu_extensions_p;
258*38fd1498Szrj 
259*38fd1498Szrj   /* TRUE if the `>' token should be interpreted as the greater-than
260*38fd1498Szrj      operator.  FALSE if it is the end of a template-id or
261*38fd1498Szrj      template-parameter-list. In C++0x mode, this flag also applies to
262*38fd1498Szrj      `>>' tokens, which are viewed as two consecutive `>' tokens when
263*38fd1498Szrj      this flag is FALSE.  */
264*38fd1498Szrj   bool greater_than_is_operator_p;
265*38fd1498Szrj 
266*38fd1498Szrj   /* TRUE if default arguments are allowed within a parameter list
267*38fd1498Szrj      that starts at this point. FALSE if only a gnu extension makes
268*38fd1498Szrj      them permissible.  */
269*38fd1498Szrj   bool default_arg_ok_p;
270*38fd1498Szrj 
271*38fd1498Szrj   /* TRUE if we are parsing an integral constant-expression.  See
272*38fd1498Szrj      [expr.const] for a precise definition.  */
273*38fd1498Szrj   bool integral_constant_expression_p;
274*38fd1498Szrj 
275*38fd1498Szrj   /* TRUE if we are parsing an integral constant-expression -- but a
276*38fd1498Szrj      non-constant expression should be permitted as well.  This flag
277*38fd1498Szrj      is used when parsing an array bound so that GNU variable-length
278*38fd1498Szrj      arrays are tolerated.  */
279*38fd1498Szrj   bool allow_non_integral_constant_expression_p;
280*38fd1498Szrj 
281*38fd1498Szrj   /* TRUE if ALLOW_NON_CONSTANT_EXPRESSION_P is TRUE and something has
282*38fd1498Szrj      been seen that makes the expression non-constant.  */
283*38fd1498Szrj   bool non_integral_constant_expression_p;
284*38fd1498Szrj 
285*38fd1498Szrj   /* TRUE if local variable names and `this' are forbidden in the
286*38fd1498Szrj      current context.  */
287*38fd1498Szrj   bool local_variables_forbidden_p;
288*38fd1498Szrj 
289*38fd1498Szrj   /* TRUE if the declaration we are parsing is part of a
290*38fd1498Szrj      linkage-specification of the form `extern string-literal
291*38fd1498Szrj      declaration'.  */
292*38fd1498Szrj   bool in_unbraced_linkage_specification_p;
293*38fd1498Szrj 
294*38fd1498Szrj   /* TRUE if we are presently parsing a declarator, after the
295*38fd1498Szrj      direct-declarator.  */
296*38fd1498Szrj   bool in_declarator_p;
297*38fd1498Szrj 
298*38fd1498Szrj   /* TRUE if we are presently parsing a template-argument-list.  */
299*38fd1498Szrj   bool in_template_argument_list_p;
300*38fd1498Szrj 
301*38fd1498Szrj   /* Set to IN_ITERATION_STMT if parsing an iteration-statement,
302*38fd1498Szrj      to IN_OMP_BLOCK if parsing OpenMP structured block and
303*38fd1498Szrj      IN_OMP_FOR if parsing OpenMP loop.  If parsing a switch statement,
304*38fd1498Szrj      this is bitwise ORed with IN_SWITCH_STMT, unless parsing an
305*38fd1498Szrj      iteration-statement, OpenMP block or loop within that switch.  */
306*38fd1498Szrj #define IN_SWITCH_STMT		1
307*38fd1498Szrj #define IN_ITERATION_STMT	2
308*38fd1498Szrj #define IN_OMP_BLOCK		4
309*38fd1498Szrj #define IN_OMP_FOR		8
310*38fd1498Szrj #define IN_IF_STMT             16
311*38fd1498Szrj   unsigned char in_statement;
312*38fd1498Szrj 
313*38fd1498Szrj   /* TRUE if we are presently parsing the body of a switch statement.
314*38fd1498Szrj      Note that this doesn't quite overlap with in_statement above.
315*38fd1498Szrj      The difference relates to giving the right sets of error messages:
316*38fd1498Szrj      "case not in switch" vs "break statement used with OpenMP...".  */
317*38fd1498Szrj   bool in_switch_statement_p;
318*38fd1498Szrj 
319*38fd1498Szrj   /* TRUE if we are parsing a type-id in an expression context.  In
320*38fd1498Szrj      such a situation, both "type (expr)" and "type (type)" are valid
321*38fd1498Szrj      alternatives.  */
322*38fd1498Szrj   bool in_type_id_in_expr_p;
323*38fd1498Szrj 
324*38fd1498Szrj   /* TRUE if we are currently in a header file where declarations are
325*38fd1498Szrj      implicitly extern "C".  */
326*38fd1498Szrj   bool implicit_extern_c;
327*38fd1498Szrj 
328*38fd1498Szrj   /* TRUE if strings in expressions should be translated to the execution
329*38fd1498Szrj      character set.  */
330*38fd1498Szrj   bool translate_strings_p;
331*38fd1498Szrj 
332*38fd1498Szrj   /* TRUE if we are presently parsing the body of a function, but not
333*38fd1498Szrj      a local class.  */
334*38fd1498Szrj   bool in_function_body;
335*38fd1498Szrj 
336*38fd1498Szrj   /* Nonzero if we're processing a __transaction_atomic or
337*38fd1498Szrj      __transaction_relaxed statement.  */
338*38fd1498Szrj   unsigned char in_transaction;
339*38fd1498Szrj 
340*38fd1498Szrj   /* TRUE if we can auto-correct a colon to a scope operator.  */
341*38fd1498Szrj   bool colon_corrects_to_scope_p;
342*38fd1498Szrj 
343*38fd1498Szrj   /* TRUE if : doesn't start a class definition.  Should be only used
344*38fd1498Szrj      together with type_definition_forbidden_message non-NULL, in
345*38fd1498Szrj      contexts where new types may not be defined, and the type list
346*38fd1498Szrj      is terminated by colon.  */
347*38fd1498Szrj   bool colon_doesnt_start_class_def_p;
348*38fd1498Szrj 
349*38fd1498Szrj   /* If non-NULL, then we are parsing a construct where new type
350*38fd1498Szrj      definitions are not permitted.  The string stored here will be
351*38fd1498Szrj      issued as an error message if a type is defined.  */
352*38fd1498Szrj   const char *type_definition_forbidden_message;
353*38fd1498Szrj 
354*38fd1498Szrj   /* A stack used for member functions of local classes.  The lists
355*38fd1498Szrj      contained in an individual entry can only be processed once the
356*38fd1498Szrj      outermost class being defined is complete.  */
357*38fd1498Szrj   vec<cp_unparsed_functions_entry, va_gc> *unparsed_queues;
358*38fd1498Szrj 
359*38fd1498Szrj   /* The number of classes whose definitions are currently in
360*38fd1498Szrj      progress.  */
361*38fd1498Szrj   unsigned num_classes_being_defined;
362*38fd1498Szrj 
363*38fd1498Szrj   /* The number of template parameter lists that apply directly to the
364*38fd1498Szrj      current declaration.  */
365*38fd1498Szrj   unsigned num_template_parameter_lists;
366*38fd1498Szrj 
367*38fd1498Szrj   /* When parsing #pragma omp declare simd, this is a pointer to a
368*38fd1498Szrj      helper data structure.  */
369*38fd1498Szrj   cp_omp_declare_simd_data * GTY((skip)) omp_declare_simd;
370*38fd1498Szrj 
371*38fd1498Szrj   /* When parsing #pragma acc routine, this is a pointer to a helper data
372*38fd1498Szrj      structure.  */
373*38fd1498Szrj   cp_oacc_routine_data * GTY((skip)) oacc_routine;
374*38fd1498Szrj 
375*38fd1498Szrj   /* Nonzero if parsing a parameter list where 'auto' should trigger an implicit
376*38fd1498Szrj      template parameter.  */
377*38fd1498Szrj   bool auto_is_implicit_function_template_parm_p;
378*38fd1498Szrj 
379*38fd1498Szrj   /* TRUE if the function being declared was made a template due to its
380*38fd1498Szrj      parameter list containing generic type specifiers (`auto' or concept
381*38fd1498Szrj      identifiers) rather than an explicit template parameter list.  */
382*38fd1498Szrj   bool fully_implicit_function_template_p;
383*38fd1498Szrj 
384*38fd1498Szrj   /* Tracks the function's template parameter list when declaring a function
385*38fd1498Szrj      using generic type parameters.  This is either a new chain in the case of a
386*38fd1498Szrj      fully implicit function template or an extension of the function's existing
387*38fd1498Szrj      template parameter list.  This is tracked to optimize calls subsequent
388*38fd1498Szrj      calls to synthesize_implicit_template_parm during
389*38fd1498Szrj      cp_parser_parameter_declaration.  */
390*38fd1498Szrj   tree implicit_template_parms;
391*38fd1498Szrj 
392*38fd1498Szrj   /* The scope into which an implicit template parameter list has been
393*38fd1498Szrj      introduced or an existing template parameter list is being extended with
394*38fd1498Szrj      implicit template parameters.  In most cases this is the sk_function_parms
395*38fd1498Szrj      scope containing the use of a generic type.  In the case of an out-of-line
396*38fd1498Szrj      member definition using a generic type, it is the sk_class scope.  */
397*38fd1498Szrj   cp_binding_level* implicit_template_scope;
398*38fd1498Szrj 
399*38fd1498Szrj   /* True if parsing a result type in a compound requirement. This permits
400*38fd1498Szrj      constrained-type-specifiers inside what would normally be a trailing
401*38fd1498Szrj      return type. */
402*38fd1498Szrj   bool in_result_type_constraint_p;
403*38fd1498Szrj 
404*38fd1498Szrj   /* True if a constrained-type-specifier is not allowed in this
405*38fd1498Szrj      context e.g., because they could never be deduced.  */
406*38fd1498Szrj   int prevent_constrained_type_specifiers;
407*38fd1498Szrj 
408*38fd1498Szrj   /* Location of the string-literal token within the current linkage
409*38fd1498Szrj      specification, if any, or UNKNOWN_LOCATION otherwise.  */
410*38fd1498Szrj   location_t innermost_linkage_specification_location;
411*38fd1498Szrj 
412*38fd1498Szrj };
413*38fd1498Szrj 
414*38fd1498Szrj /* In parser.c  */
415*38fd1498Szrj extern void debug (cp_token &ref);
416*38fd1498Szrj extern void debug (cp_token *ptr);
417*38fd1498Szrj extern void cp_lexer_debug_tokens (vec<cp_token, va_gc> *);
418*38fd1498Szrj extern void debug (vec<cp_token, va_gc> &ref);
419*38fd1498Szrj extern void debug (vec<cp_token, va_gc> *ptr);
420*38fd1498Szrj extern void cp_debug_parser (FILE *, cp_parser *);
421*38fd1498Szrj extern void debug (cp_parser &ref);
422*38fd1498Szrj extern void debug (cp_parser *ptr);
423*38fd1498Szrj extern bool cp_keyword_starts_decl_specifier_p (enum rid keyword);
424*38fd1498Szrj 
425*38fd1498Szrj #endif  /* GCC_CP_PARSER_H  */
426