Commit 776ff3ef by Nathan Sidwell Committed by Nathan Sidwell

lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs don't need lang_type.

	* lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
	don't need lang_type.
	(cxx_make_type): Use maybe_add_lang_type_raw return value.
	* mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
	TYPE_LANG_SPECIFIC.

From-SVN: r251154
parent d00fdf85
2017-08-17 Nathan Sidwell <nathan@acm.org>
* lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
don't need lang_type.
(cxx_make_type): Use maybe_add_lang_type_raw return value.
* mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
TYPE_LANG_SPECIFIC.
* cp-tree.h (struct lang_type): Remove template_info field.
(CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
(TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
......
......@@ -809,8 +809,7 @@ copy_type (tree type MEM_STAT_DECL)
static bool
maybe_add_lang_type_raw (tree t)
{
if (!(RECORD_OR_UNION_CODE_P (TREE_CODE (t))
|| TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM))
if (!RECORD_OR_UNION_CODE_P (TREE_CODE (t)))
return false;
TYPE_LANG_SPECIFIC (t)
......@@ -831,12 +830,10 @@ cxx_make_type (enum tree_code code)
{
tree t = make_node (code);
maybe_add_lang_type_raw (t);
/* Set up some flags that give proper default behavior. */
if (RECORD_OR_UNION_CODE_P (code))
if (maybe_add_lang_type_raw (t))
{
struct c_fileinfo *finfo = \
/* Set up some flags that give proper default behavior. */
struct c_fileinfo *finfo =
get_fileinfo (LOCATION_FILE (input_location));
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only;
......
......@@ -81,10 +81,10 @@ along with GCC; see the file COPYING3. If not see
instantiated outside of the template, and A is the type used
without parameters inside the template. */
#define CLASSTYPE_TEMPLATE_ID_P(NODE) \
(TYPE_LANG_SPECIFIC (NODE) != NULL \
&& (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \
|| (CLASSTYPE_TEMPLATE_INFO (NODE) != NULL \
&& (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE))))))
(TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \
|| (CLASS_TYPE_P (NODE) \
&& CLASSTYPE_TEMPLATE_INFO (NODE) != NULL \
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE))))
/* For deciding whether to set G.need_abi_warning, we need to consider both
warn_abi_version and flag_abi_compat_version. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment