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.
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)
{
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;
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. */