1 --- gcc-4.2.0-20070501/gcc/c-common.h.orig 2006-08-17 03:02:55.000000000 -0400
2 +++ gcc-4.2.0-20070501/gcc/c-common.h 2007-05-03 10:20:24.674526804 -0400
4 extern int self_promoting_args_p (tree);
5 extern tree strip_array_types (tree);
6 extern tree strip_pointer_operator (tree);
7 +extern tree strip_pointer_or_array_types (tree);
8 extern HOST_WIDE_INT c_common_to_target_charset (HOST_WIDE_INT);
10 /* This is the basic parsing function. */
11 --- gcc-4.2.0-20070501/gcc/c-common.c.orig 2007-03-12 14:50:38.000000000 -0400
12 +++ gcc-4.2.0-20070501/gcc/c-common.c 2007-05-03 10:20:00.282869853 -0400
13 @@ -3604,6 +3604,15 @@
17 +/* Recursively remove pointer or array type from TYPE. */
19 +strip_pointer_or_array_types (tree t)
21 + while (TREE_CODE (t) == ARRAY_TYPE || POINTER_TYPE_P (t))
26 /* Used to compare case labels. K1 and K2 are actually tree nodes
27 representing case labels, or NULL_TREE for a `default' label.
28 Returns -1 if K1 is ordered before K2, -1 if K1 is ordered after
29 --- gcc-4.2.0-20070501/gcc/cp/decl2.c.orig 2006-12-06 12:41:29.000000000 -0500
30 +++ gcc-4.2.0-20070501/gcc/cp/decl2.c 2007-05-03 10:18:55.360665142 -0400
31 @@ -1855,13 +1855,17 @@
32 for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t))
33 if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node)
35 - tree ftype = strip_array_types (TREE_TYPE (t));
36 + tree ftype = strip_pointer_or_array_types (TREE_TYPE (t));
37 int subvis = type_visibility (ftype);
39 if (subvis == VISIBILITY_ANON)
42 + if (strcmp (main_input_filename,
43 + DECL_SOURCE_FILE (TYPE_MAIN_DECL (ftype))))
45 %qT has a field %qD whose type uses the anonymous namespace",
49 else if (IS_AGGR_TYPE (ftype)
50 && vis < VISIBILITY_HIDDEN
51 && subvis >= VISIBILITY_HIDDEN)
52 @@ -1876,9 +1880,13 @@
53 int subvis = type_visibility (TREE_TYPE (t));
55 if (subvis == VISIBILITY_ANON)
58 + if (strcmp (main_input_filename,
59 + DECL_SOURCE_FILE (TYPE_MAIN_DECL (TREE_TYPE (t)))))
61 %qT has a base %qT whose type uses the anonymous namespace",
62 - type, TREE_TYPE (t));
63 + type, TREE_TYPE (t));
65 else if (vis < VISIBILITY_HIDDEN
66 && subvis >= VISIBILITY_HIDDEN)
67 warning (OPT_Wattributes, "\