friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 2 Apr 2013 14:04:53 +0000 (14:04 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 2 Apr 2013 14:04:53 +0000 (14:04 +0000)
2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>

* friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
* pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
(for_each_template_parm_r): Use TYPE_TI_ARGS.

From-SVN: r197356

gcc/cp/ChangeLog
gcc/cp/friend.c
gcc/cp/pt.c

index 7c9ba7422f43897a55bbb539d5ec0fe08140290a..7b73e0329318ad5225b24fcaf4e801f04baf1dc5 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
+       * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
+       (for_each_template_parm_r): Use TYPE_TI_ARGS.
+
 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * cp-tree.h (TAGGED_TYPE_P): Remove.
index 083372849b93d3896e3da67e1cb541bcce8c0c68..3c63ea6dbb9c8b0ab12c54dbc82fd07cc77d02c0 100644 (file)
@@ -485,8 +485,7 @@ do_friend (tree ctype, tree declarator, tree decl,
         to be a friend, so we do lookup here even if CTYPE is in
         the process of being defined.  */
       if (class_template_depth
-         || COMPLETE_TYPE_P (ctype)
-         || (CLASS_TYPE_P (ctype) && TYPE_BEING_DEFINED (ctype)))
+         || COMPLETE_OR_OPEN_TYPE_P (ctype))
        {
          if (DECL_TEMPLATE_INFO (decl))
            /* DECL is a template specialization.  No need to
index 8671bd95d4a964c0b981a9af1f874b31909b1506..1d429fe0f1b6d99cbd29ea50b7af0f227f10a37c 100644 (file)
@@ -3058,10 +3058,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
   bool parameter_pack_p = false;
 
   /* Handle type aliases/typedefs.  */
-  if (TYPE_P (t)
-      && TYPE_NAME (t)
-      && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL
-      && TYPE_DECL_ALIAS_P (TYPE_NAME (t)))
+  if (TYPE_ALIAS_P (t))
     {
       if (TYPE_TEMPLATE_INFO (t))
        cp_walk_tree (&TYPE_TI_ARGS (t),
@@ -3146,7 +3143,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
     case UNION_TYPE:
     case ENUMERAL_TYPE:
       if (TYPE_TEMPLATE_INFO (t))
-       cp_walk_tree (&TI_ARGS (TYPE_TEMPLATE_INFO (t)),
+       cp_walk_tree (&TYPE_TI_ARGS (t),
                      &find_parameter_packs_r, ppd, ppd->visited);
 
       *walk_subtrees = 0;
@@ -7619,7 +7616,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d)
     case ENUMERAL_TYPE:
       if (!TYPE_TEMPLATE_INFO (t))
        *walk_subtrees = 0;
-      else if (for_each_template_parm (TI_ARGS (TYPE_TEMPLATE_INFO (t)),
+      else if (for_each_template_parm (TYPE_TI_ARGS (t),
                                       fn, data, pfd->visited, 
                                       pfd->include_nondeduced_p))
        return error_mark_node;