Mercurial > hg > CbC > CbC_gcc
diff gcc/cp/parser.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/cp/parser.h Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/cp/parser.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,5 +1,5 @@ /* Data structures and function exported by the C++ Parser. - Copyright (C) 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2010-2020 Free Software Foundation, Inc. This file is part of GCC. @@ -41,34 +41,34 @@ struct GTY (()) cp_token { /* The kind of token. */ - ENUM_BITFIELD (cpp_ttype) type : 8; + enum cpp_ttype type : 8; /* If this token is a keyword, this value indicates which keyword. Otherwise, this value is RID_MAX. */ - ENUM_BITFIELD (rid) keyword : 8; + enum rid keyword : 8; /* Token flags. */ unsigned char flags; /* True if this token is from a context where it is implicitly extern "C" */ - BOOL_BITFIELD implicit_extern_c : 1; + bool implicit_extern_c : 1; /* True if an error has already been reported for this token, such as a CPP_NAME token that is not a keyword (i.e., for which KEYWORD is RID_MAX) iff this name was looked up and found to be ambiguous. */ - BOOL_BITFIELD error_reported : 1; + bool error_reported : 1; /* True for a token that has been purged. If a token is purged, it is no longer a valid token and it should be considered deleted. */ - BOOL_BITFIELD purged_p : 1; - /* 5 unused bits. */ + bool purged_p : 1; + bool tree_check_p : 1; + /* 4 unused bits. */ + /* The location at which this token was found. */ location_t location; /* The value associated with this token, if any. */ union cp_token_value { /* Used for compound tokens such as CPP_NESTED_NAME_SPECIFIER. */ - struct tree_check* GTY((tag ("1"))) tree_check_value; + struct tree_check* GTY((tag ("true"))) tree_check_value; /* Use for all other tokens. */ - tree GTY((tag ("0"))) value; - } GTY((desc ("(%1.type == CPP_TEMPLATE_ID)" - "|| (%1.type == CPP_NESTED_NAME_SPECIFIER)" - "|| (%1.type == CPP_DECLTYPE)"))) u; + tree GTY((tag ("false"))) value; + } GTY((desc ("%1.tree_check_p"))) u; }; @@ -99,6 +99,10 @@ tokens. */ vec<cp_token_position> GTY ((skip)) saved_tokens; + /* Saved pieces of end token we replaced with the eof token. */ + enum cpp_ttype saved_type : 8; + enum rid saved_keyword : 8; + /* The next lexer in a linked list of lexers. */ struct cp_lexer *next; @@ -163,9 +167,8 @@ FIELD_DECLs appear in this list in declaration order. */ vec<tree, va_gc> *nsdmis; - /* Nested classes go in this vector, so that we can do some final - processing after parsing any NSDMIs. */ - vec<tree, va_gc> *classes; + /* Functions with noexcept-specifiers that require post-processing. */ + vec<tree, va_gc> *noexcepts; }; @@ -199,10 +202,11 @@ }; -/* Helper data structure for parsing #pragma omp declare simd. */ +/* Helper data structure for parsing #pragma omp declare {simd,variant}. */ struct cp_omp_declare_simd_data { bool error_seen; /* Set if error has been reported. */ bool fndecl_seen; /* Set if one fn decl/definition has been seen already. */ + bool variant_p; /* Set for #pragma omp declare variant. */ vec<cp_token_cache_ptr> tokens; tree clauses; }; @@ -282,9 +286,12 @@ been seen that makes the expression non-constant. */ bool non_integral_constant_expression_p; - /* TRUE if local variable names and `this' are forbidden in the - current context. */ - bool local_variables_forbidden_p; + /* Used to track if local variable names and/or `this' are forbidden + in the current context. */ +#define LOCAL_VARS_FORBIDDEN (1 << 0) +#define THIS_FORBIDDEN (1 << 1) +#define LOCAL_VARS_AND_THIS_FORBIDDEN (LOCAL_VARS_FORBIDDEN | THIS_FORBIDDEN) + unsigned char local_variables_forbidden_p; /* TRUE if the declaration we are parsing is part of a linkage-specification of the form `extern string-literal @@ -347,6 +354,9 @@ issued as an error message if a type is defined. */ const char *type_definition_forbidden_message; + /* Argument for type_definition_forbidden_message if needed. */ + const char *type_definition_forbidden_message_arg; + /* A stack used for member functions of local classes. The lists contained in an individual entry can only be processed once the outermost class being defined is complete. */