diff mbox

[C++] BOUND_TEMPLATE_TEMPLATE_PARM_TYPE

Message ID 6a31c41f-4e53-93dd-ca47-ba0ba9f12a9c@acm.org
State New
Headers show

Commit Message

Nathan Sidwell Aug. 17, 2017, 3:58 p.m. UTC
Now that template info is on TYPE_LANG_SLOT_1, B_T_T_P_Types don't need 
type_lang_specific.

Excised thusly.

nathan
diff mbox

Patch

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.

Index: lex.c
===================================================================
--- lex.c	(revision 251152)
+++ lex.c	(working copy)
@@ -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;
Index: mangle.c
===================================================================
--- mangle.c	(revision 251152)
+++ mangle.c	(working copy)
@@ -81,10 +81,10 @@  along with GCC; see the file COPYING3.
    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.  */