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;
+ }