This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 26099 (first part)


Hi Doug,

This required two minor fixes. The first was a the aforementioned
change to cp_walk_subtrees:

Index: tree.c
===================================================================
--- tree.c      (revision 123359)
+++ tree.c      (working copy)
@@ -2293,6 +2293,12 @@ cp_walk_subtrees (tree *tp, int *walk_su
      *walk_subtrees_p = 0;
      break;

+    case TRAIT_EXPR:
+      WALK_SUBTREE (TRAIT_EXPR_TYPE1 (*tp));
+      WALK_SUBTREE (TRAIT_EXPR_TYPE2 (*tp));
+      *walk_subtrees_p = 0;
+      break;
+
    default:
      return NULL_TREE;
    }

The second was due to __is_base_of. When it checks that the second
type is complete, it should attempt to complete that type before
failing, like this:

+ /* The only required diagnostic. */
+ if (kind == CPTK_IS_BASE_OF
+ && NON_UNION_CLASS_TYPE_P (type1) && NON_UNION_CLASS_TYPE_P (type2)
+ && !same_type_ignoring_top_level_qualifiers_p (type1, type2)
+ && !COMPLETE_TYPE_P (complete_type (type2)))
+ {
+ error ("incomplete type %qT not allowed", type2);
+ return error_mark_node;
+ }

Thanks a lot, I'm adding those two bits to my local tree.


Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]