aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mmitchell@usa.net>1998-04-26 16:30:11 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-04-26 16:30:11 +0000
commit6757edfe655f9b21cdd1dbaddd80b8c5ddc63823 (patch)
tree81d5ea7e7ca626cf4ade65df9c83bc0fd7422bf2
parent7bf407413f0d6b36bd1a799fea2d5863465dafed (diff)
downloadgcc-6757edfe655f9b21cdd1dbaddd80b8c5ddc63823.zip
gcc-6757edfe655f9b21cdd1dbaddd80b8c5ddc63823.tar.gz
gcc-6757edfe655f9b21cdd1dbaddd80b8c5ddc63823.tar.bz2
cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
* cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro. (DECL_CLASS_TEMPLATE_P): Likewise. (DECL_PRIMARY_TEMPLATE): Likewise. (PRIMARY_TEMPLATE_P): Use it. (push_template_decl_real): New function. (redeclare_class_template): Take new template parameters as input. (is_specialization_of): New function. (comp_template_args): Declare. * decl.c (pushtag): Handle friend template classes. (xref_tag): Likewise. Use new calling convention for redeclare_class_template. * decl2.c (grok_x_components): Handle friend templates. * friend.c (is_friend): Use is_specialization_of where appropriate. Deal with friend class templates. (make_friend_class): Let a class template be friends with itself. * pt.c (comp_template_args): Remove declaration. (tsubst_friend_class): New function. (push_template_decl_real): New function. (push_template_decl): Use it. (redeclare_class_template): Adjust for new calling convention. (comp_template_args): Give it external linkage. (instantiate_class_type): Use tsubst_friend_class to deal with friend templates. * typeck.c (comptypes): Use comp_template_args, rather than expanding it inline. * parse.y (component_decl): Handle a nested template type like other component type declarations. From-SVN: r19418
-rw-r--r--gcc/cp/ChangeLog29
-rw-r--r--gcc/cp/cp-tree.h32
-rw-r--r--gcc/cp/decl.c64
-rw-r--r--gcc/cp/decl2.c12
-rw-r--r--gcc/cp/friend.c38
-rw-r--r--gcc/cp/parse.c642
-rw-r--r--gcc/cp/parse.y6
-rw-r--r--gcc/cp/pt.c182
-rw-r--r--gcc/cp/typeck.c22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend14.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend15.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend16.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend17.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend18.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend19.C26
15 files changed, 778 insertions, 409 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a6bd63f..d77726d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,34 @@
Sun Apr 26 12:10:18 1998 Mark Mitchell <mmitchell@usa.net>
+ * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
+ (DECL_CLASS_TEMPLATE_P): Likewise.
+ (DECL_PRIMARY_TEMPLATE): Likewise.
+ (PRIMARY_TEMPLATE_P): Use it.
+ (push_template_decl_real): New function.
+ (redeclare_class_template): Take new template parameters as
+ input.
+ (is_specialization_of): New function.
+ (comp_template_args): Declare.
+ * decl.c (pushtag): Handle friend template classes.
+ (xref_tag): Likewise. Use new calling convention for
+ redeclare_class_template.
+ * decl2.c (grok_x_components): Handle friend templates.
+ * friend.c (is_friend): Use is_specialization_of where
+ appropriate. Deal with friend class templates.
+ (make_friend_class): Let a class template be friends with itself.
+ * pt.c (comp_template_args): Remove declaration.
+ (tsubst_friend_class): New function.
+ (push_template_decl_real): New function.
+ (push_template_decl): Use it.
+ (redeclare_class_template): Adjust for new calling convention.
+ (comp_template_args): Give it external linkage.
+ (instantiate_class_type): Use tsubst_friend_class to deal
+ with friend templates.
+ * typeck.c (comptypes): Use comp_template_args, rather than
+ expanding it inline.
+ * parse.y (component_decl): Handle a nested template type
+ like other component type declarations.
+
* pt.c (check_explicit_specialization): Handle overloaded
constructors correctly.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3247196..b91f2e9 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1139,6 +1139,15 @@ struct lang_decl
#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
#define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
+/* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
+ TEMPLATE_DECL. This macro determines whether or not a given class
+ type is really a template type, as opposed to an instantiation or
+ specialization of one. */
+#define CLASSTYPE_IS_TEMPLATE(NODE) \
+ (CLASSTYPE_TEMPLATE_INFO (NODE) \
+ && !CLASSTYPE_USE_TEMPLATE (NODE) \
+ && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
+
#define TYPENAME_TYPE_FULLNAME(NODE) CLASSTYPE_SIZE (NODE)
/* Nonzero in INT_CST means that this int is negative by dint of
@@ -1412,11 +1421,22 @@ extern int flag_new_for_scope;
(TREE_CODE (NODE) == TEMPLATE_DECL \
&& TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
+/* Nonzero for a DECL that represents a template class. */
+#define DECL_CLASS_TEMPLATE_P(NODE) \
+ (TREE_CODE (NODE) == TEMPLATE_DECL \
+ && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
+ && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
+
/* A `primary' template is one that has its own template header. A
member function of a class template is a template, but not primary.
- A member template is primary. */
-#define PRIMARY_TEMPLATE_P(NODE) \
- (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)) == (NODE))
+ A member template is primary. Friend templates are primary, too. */
+
+/* Returns the primary template corresponding to these parameters. */
+#define DECL_PRIMARY_TEMPLATE(NODE) \
+ (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
+
+/* Returns non-zero if NODE is a primary template. */
+#define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE)
#define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
(TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
@@ -2435,7 +2455,8 @@ extern tree end_template_parm_list PROTO((tree));
extern void end_template_decl PROTO((void));
extern tree current_template_args PROTO((void));
extern tree push_template_decl PROTO((tree));
-extern void redeclare_class_template PROTO((tree));
+extern tree push_template_decl_real PROTO((tree, int));
+extern void redeclare_class_template PROTO((tree, tree));
extern tree lookup_template_class PROTO((tree, tree, tree, tree));
extern tree lookup_template_function PROTO((tree, tree));
extern int uses_template_parms PROTO((tree));
@@ -2467,6 +2488,9 @@ extern void do_pushlevel PROTO((void));
extern int is_member_template PROTO((tree));
extern int comp_template_parms PROTO((tree, tree));
extern int template_class_depth PROTO((tree));
+extern int is_specialization_of PROTO((tree, tree));
+extern int comp_template_args PROTO((tree, tree));
+
extern int processing_specialization;
extern int processing_explicit_instantiation;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 890c9f5..62d9db2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2157,7 +2157,7 @@ pop_everything ()
}
/* Push a tag name NAME for struct/class/union/enum type TYPE.
- Normally put into into the inner-most non-tag-transparent scope,
+ Normally put it into the inner-most non-tag-transparent scope,
but if GLOBALIZE is true, put it in the inner-most non-class scope.
The latter is needed for implicit declarations. */
@@ -2226,11 +2226,52 @@ pushtag (name, type, globalize)
TYPE_NAME (type) = d;
DECL_CONTEXT (d) = context;
- if (! globalize && processing_template_decl
- && IS_AGGR_TYPE (type))
- {
- d = push_template_decl (d);
- if (b->pseudo_global && b->level_chain->parm_flag == 2)
+ if (IS_AGGR_TYPE (type)
+ && (/* If !GLOBALIZE then we are looking at a
+ definition. */
+ (processing_template_decl && !globalize)
+ /* This next condition is tricky. If we are
+ declaring a friend template class, we will have
+ GLOBALIZE set, since something like:
+
+ template <class T>
+ struct S1 {
+ template <class U>
+ friend class S2;
+ };
+
+ declares S2 to be at global scope. The condition
+ says that we are looking at a primary template
+ that is being declared in class scope. We can't
+ just drop the `in class scope' and then not check
+ GLOBALIZE either since on this code:
+
+ template <class T>
+ struct S1 {};
+ template <class T>
+ struct S2 { S1<T> f(); }
+
+ we get called by lookup_template_class (with TYPE
+ set to S1<T> and GLOBALIZE set to 1). However,
+ lookup_template_class calls
+ maybe_push_to_top_level which doesn't clear
+ processing_template_decl, so we would then
+ incorrectly call push_template_decl. */
+ || (current_class_type != NULL_TREE
+ && (processing_template_decl >
+ template_class_depth (current_class_type)))))
+ {
+ d = push_template_decl_real (d, globalize);
+ /* If the current binding level is the binding level for
+ the template parameters (see the comment in
+ begin_template_parm_list) and the enclosing level is
+ a class scope, and we're not looking at a friend,
+ push the declaration of the member class into the
+ class scope. In the friend case, push_template_decl
+ will already have put the friend into global scope,
+ if appropriate. */
+ if (!globalize && b->pseudo_global &&
+ b->level_chain->parm_flag == 2)
pushdecl_with_scope (CLASSTYPE_TI_TEMPLATE (type),
b->level_chain);
}
@@ -10812,6 +10853,15 @@ xref_tag (code_type_node, name, binfo, globalize)
{
/* Try finding it as a type declaration. If that wins, use it. */
ref = lookup_name (name, 1);
+
+ if (ref != NULL_TREE
+ && processing_template_decl
+ && DECL_CLASS_TEMPLATE_P (ref)
+ && template_class_depth (current_class_type) == 0)
+ /* Since GLOBALIZE is true, we're declaring a global
+ template, so we want this type. */
+ ref = DECL_RESULT (ref);
+
if (ref && TREE_CODE (ref) == TYPE_DECL
&& TREE_CODE (TREE_TYPE (ref)) == code)
ref = TREE_TYPE (ref);
@@ -10898,7 +10948,7 @@ xref_tag (code_type_node, name, binfo, globalize)
}
if (!globalize && processing_template_decl && IS_AGGR_TYPE (ref))
- redeclare_class_template (ref);
+ redeclare_class_template (ref, current_template_parms);
}
if (binfo)
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 52900c4..32f90e8 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -870,8 +870,16 @@ grok_x_components (specs, components)
tcode = class_type_node;
else if (IS_SIGNATURE (t))
tcode = signature_type_node;
-
- t = xref_tag (tcode, TYPE_IDENTIFIER (t), NULL_TREE, 0);
+
+ if (CLASSTYPE_IS_TEMPLATE (t))
+ /* In this case, the TYPE_IDENTIFIER will be something
+ like S<T>, rather than S, so to get the correct name we
+ look at the template. */
+ x = DECL_NAME (CLASSTYPE_TI_TEMPLATE (t));
+ else
+ x = TYPE_IDENTIFIER (t);
+
+ t = xref_tag (tcode, x, NULL_TREE, 0);
return NULL_TREE;
break;
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 9a86ebc..e5d1ccf 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -71,25 +71,17 @@ is_friend (type, supplicant)
if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL)
{
- tree t;
-
- /* Perhaps this function is a specialization of
- a friend template. */
- for (t = supplicant;
- t != NULL_TREE;
- t = DECL_TEMPLATE_INFO (t) ?
- DECL_TI_TEMPLATE (t) : NULL_TREE)
- /* FIXME: The use of comptypes here, and below, is
- bogus, since two specializations of a
- template parameter with non-type parameters
- may have the same type, but be different. */
- if (comptypes (TREE_TYPE (t),
- TREE_TYPE (TREE_VALUE (friends)), 1))
- return 1;
+ if (is_specialization_of (supplicant,
+ TREE_VALUE (friends)))
+ return 1;
continue;
}
+ /* FIXME: The use of comptypes here is bogus, since
+ two specializations of a template with non-type
+ parameters may have the same type, but be
+ different. */
if (comptypes (TREE_TYPE (supplicant),
TREE_TYPE (TREE_VALUE (friends)), 1))
return 1;
@@ -106,8 +98,15 @@ is_friend (type, supplicant)
list = CLASSTYPE_FRIEND_CLASSES (TREE_TYPE (TYPE_MAIN_DECL (type)));
for (; list ; list = TREE_CHAIN (list))
- if (supplicant == TREE_VALUE (list))
- return 1;
+ {
+ tree t = TREE_VALUE (list);
+
+ if (supplicant == t
+ || (CLASSTYPE_IS_TEMPLATE (t)
+ && is_specialization_of (TYPE_MAIN_DECL (supplicant),
+ CLASSTYPE_TI_TEMPLATE (t))))
+ return 1;
+ }
}
if (declp && DECL_FUNCTION_MEMBER_P (supplicant))
@@ -249,7 +248,10 @@ make_friend_class (type, friend_type)
IDENTIFIER_POINTER (TYPE_IDENTIFIER (friend_type)));
return;
}
- if (type == friend_type)
+ /* If the TYPE is a template then it makes sense for it to be
+ friends with itself; this means that each instantiation is
+ friends with all other instantiations. */
+ if (type == friend_type && !CLASSTYPE_IS_TEMPLATE (type))
{
pedwarn ("class `%s' is implicitly friends with itself",
TYPE_NAME_STRING (type));
diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c
index d6e5959..dd68890 100644
--- a/gcc/cp/parse.c
+++ b/gcc/cp/parse.c
@@ -674,41 +674,41 @@ static const short yyrline[] = { 0,
2142, 2170, 2176, 2178, 2181, 2184, 2186, 2190, 2192, 2196,
2222, 2251, 2254, 2255, 2276, 2299, 2301, 2305, 2316, 2330,
2419, 2426, 2429, 2437, 2448, 2457, 2461, 2476, 2479, 2484,
- 2486, 2488, 2490, 2492, 2494, 2497, 2499, 2507, 2513, 2515,
- 2518, 2521, 2523, 2534, 2539, 2542, 2547, 2550, 2551, 2562,
- 2565, 2566, 2577, 2579, 2582, 2584, 2587, 2594, 2602, 2609,
- 2615, 2621, 2629, 2633, 2638, 2642, 2645, 2654, 2656, 2660,
- 2663, 2668, 2672, 2677, 2687, 2690, 2694, 2698, 2706, 2711,
- 2717, 2720, 2722, 2724, 2730, 2733, 2735, 2737, 2739, 2743,
- 2746, 2764, 2774, 2776, 2777, 2781, 2786, 2789, 2791, 2793,
- 2795, 2799, 2805, 2808, 2810, 2812, 2814, 2818, 2821, 2824,
- 2826, 2828, 2830, 2834, 2837, 2840, 2842, 2844, 2846, 2853,
- 2864, 2868, 2873, 2877, 2882, 2884, 2888, 2891, 2893, 2897,
- 2899, 2900, 2903, 2905, 2907, 2913, 2928, 2934, 2940, 2954,
- 2956, 2960, 2974, 2976, 2978, 2982, 2988, 3001, 3003, 3007,
- 3018, 3024, 3026, 3027, 3028, 3036, 3041, 3050, 3051, 3055,
- 3058, 3064, 3070, 3073, 3075, 3077, 3079, 3083, 3087, 3091,
- 3094, 3099, 3102, 3104, 3106, 3108, 3110, 3112, 3114, 3116,
- 3120, 3124, 3128, 3132, 3133, 3135, 3137, 3139, 3141, 3143,
- 3145, 3147, 3149, 3157, 3159, 3160, 3161, 3164, 3170, 3172,
- 3177, 3179, 3182, 3196, 3199, 3202, 3206, 3209, 3216, 3218,
- 3221, 3223, 3225, 3228, 3231, 3234, 3237, 3239, 3242, 3246,
- 3248, 3254, 3256, 3257, 3259, 3264, 3266, 3268, 3270, 3272,
- 3275, 3276, 3278, 3281, 3282, 3285, 3285, 3288, 3288, 3291,
- 3291, 3293, 3295, 3297, 3299, 3305, 3311, 3314, 3317, 3323,
- 3325, 3327, 3331, 3333, 3336, 3343, 3346, 3354, 3358, 3360,
- 3363, 3365, 3368, 3372, 3374, 3377, 3379, 3382, 3399, 3405,
- 3413, 3415, 3417, 3421, 3424, 3425, 3433, 3437, 3441, 3444,
- 3445, 3451, 3454, 3457, 3459, 3463, 3468, 3471, 3481, 3486,
- 3487, 3495, 3501, 3506, 3510, 3515, 3519, 3523, 3527, 3532,
- 3543, 3557, 3561, 3564, 3566, 3570, 3574, 3577, 3580, 3582,
- 3586, 3588, 3595, 3602, 3605, 3608, 3612, 3616, 3622, 3626,
- 3631, 3633, 3636, 3641, 3647, 3658, 3661, 3663, 3667, 3672,
- 3674, 3681, 3684, 3686, 3688, 3694, 3699, 3702, 3704, 3706,
- 3708, 3710, 3712, 3714, 3716, 3718, 3720, 3722, 3724, 3726,
- 3728, 3730, 3732, 3734, 3736, 3738, 3740, 3742, 3744, 3746,
- 3748, 3750, 3752, 3754, 3756, 3758, 3760, 3762, 3764, 3767,
- 3769
+ 2486, 2488, 2490, 2492, 2494, 2497, 2499, 2511, 2517, 2519,
+ 2522, 2525, 2527, 2538, 2543, 2546, 2551, 2554, 2555, 2566,
+ 2569, 2570, 2581, 2583, 2586, 2588, 2591, 2598, 2606, 2613,
+ 2619, 2625, 2633, 2637, 2642, 2646, 2649, 2658, 2660, 2664,
+ 2667, 2672, 2676, 2681, 2691, 2694, 2698, 2702, 2710, 2715,
+ 2721, 2724, 2726, 2728, 2734, 2737, 2739, 2741, 2743, 2747,
+ 2750, 2768, 2778, 2780, 2781, 2785, 2790, 2793, 2795, 2797,
+ 2799, 2803, 2809, 2812, 2814, 2816, 2818, 2822, 2825, 2828,
+ 2830, 2832, 2834, 2838, 2841, 2844, 2846, 2848, 2850, 2857,
+ 2868, 2872, 2877, 2881, 2886, 2888, 2892, 2895, 2897, 2901,
+ 2903, 2904, 2907, 2909, 2911, 2917, 2932, 2938, 2944, 2958,
+ 2960, 2964, 2978, 2980, 2982, 2986, 2992, 3005, 3007, 3011,
+ 3022, 3028, 3030, 3031, 3032, 3040, 3045, 3054, 3055, 3059,
+ 3062, 3068, 3074, 3077, 3079, 3081, 3083, 3087, 3091, 3095,
+ 3098, 3103, 3106, 3108, 3110, 3112, 3114, 3116, 3118, 3120,
+ 3124, 3128, 3132, 3136, 3137, 3139, 3141, 3143, 3145, 3147,
+ 3149, 3151, 3153, 3161, 3163, 3164, 3165, 3168, 3174, 3176,
+ 3181, 3183, 3186, 3200, 3203, 3206, 3210, 3213, 3220, 3222,
+ 3225, 3227, 3229, 3232, 3235, 3238, 3241, 3243, 3246, 3250,
+ 3252, 3258, 3260, 3261, 3263, 3268, 3270, 3272, 3274, 3276,
+ 3279, 3280, 3282, 3285, 3286, 3289, 3289, 3292, 3292, 3295,
+ 3295, 3297, 3299, 3301, 3303, 3309, 3315, 3318, 3321, 3327,
+ 3329, 3331, 3335, 3337, 3340, 3347, 3350, 3358, 3362, 3364,
+ 3367, 3369, 3372, 3376, 3378, 3381, 3383, 3386, 3403, 3409,
+ 3417, 3419, 3421, 3425, 3428, 3429, 3437, 3441, 3445, 3448,
+ 3449, 3455, 3458, 3461, 3463, 3467, 3472, 3475, 3485, 3490,
+ 3491, 3499, 3505, 3510, 3514, 3519, 3523, 3527, 3531, 3536,
+ 3547, 3561, 3565, 3568, 3570, 3574, 3578, 3581, 3584, 3586,
+ 3590, 3592, 3599, 3606, 3609, 3612, 3616, 3620, 3626, 3630,
+ 3635, 3637, 3640, 3645, 3651, 3662, 3665, 3667, 3671, 3676,
+ 3678, 3685, 3688, 3690, 3692, 3698, 3703, 3706, 3708, 3710,
+ 3712, 3714, 3716, 3718, 3720, 3722, 3724, 3726, 3728, 3730,
+ 3732, 3734, 3736, 3738, 3740, 3742, 3744, 3746, 3748, 3750,
+ 3752, 3754, 3756, 3758, 3760, 3762, 3764, 3766, 3768, 3771,
+ 3773
};
#endif
@@ -3491,7 +3491,7 @@ static const short yycheck[] = { 4,
80, 81, 82, 83, 84, 85
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/cygnus/latest-940103/share/bison.simple"
+#line 3 "/usr/lib/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -3684,7 +3684,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/cygnus/latest-940103/share/bison.simple"
+#line 196 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -6355,59 +6355,63 @@ case 506:
case 507:
#line 2500 "parse.y"
{
- shadow_tag (yyvsp[-1].ftype.t);
note_list_got_semicolon (yyvsp[-1].ftype.t);
+ grok_x_components (yyvsp[-1].ftype.t, NULL_TREE);
+ if (TYPE_CONTEXT (TREE_VALUE (yyvsp[-1].ftype.t)) != current_class_type)
+ /* The component was in fact a friend
+ declaration. */
+ yyvsp[-1].ftype.t = NULL_TREE;
yyval.ttype = finish_member_template_decl (yyvsp[-2].ttype, yyvsp[-1].ftype.t);
;
break;}
case 508:
-#line 2512 "parse.y"
+#line 2516 "parse.y"
{ yyval.ttype = grok_x_components (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 509:
-#line 2514 "parse.y"
+#line 2518 "parse.y"
{ yyval.ttype = grok_x_components (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 510:
-#line 2516 "parse.y"
+#line 2520 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
case 511:
-#line 2519 "parse.y"
+#line 2523 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
case 512:
-#line 2522 "parse.y"
+#line 2526 "parse.y"
{ yyval.ttype = grokbitfield (NULL_TREE, NULL_TREE, yyvsp[0].ttype); ;
break;}
case 513:
-#line 2524 "parse.y"
+#line 2528 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 514:
-#line 2535 "parse.y"
+#line 2539 "parse.y"
{ tree specs, attrs;
split_specs_attrs (yyvsp[-4].ttype, &specs, &attrs);
yyval.ttype = grokfield (yyvsp[-3].ttype, specs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, attrs)); ;
break;}
case 515:
-#line 2540 "parse.y"
+#line 2544 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, NULL_TREE, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, NULL_TREE)); ;
break;}
case 516:
-#line 2543 "parse.y"
+#line 2547 "parse.y"
{ yyval.ttype = do_class_using_decl (yyvsp[0].ttype); ;
break;}
case 517:
-#line 2549 "parse.y"
+#line 2553 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 519:
-#line 2552 "parse.y"
+#line 2556 "parse.y"
{
/* In this context, void_type_node encodes
friends. They have been recorded elsewhere. */
@@ -6418,11 +6422,11 @@ case 519:
;
break;}
case 520:
-#line 2564 "parse.y"
+#line 2568 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 522:
-#line 2567 "parse.y"
+#line 2571 "parse.y"
{
/* In this context, void_type_node encodes
friends. They have been recorded elsewhere. */
@@ -6433,7 +6437,7 @@ case 522:
;
break;}
case 527:
-#line 2589 "parse.y"
+#line 2593 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6441,7 +6445,7 @@ case 527:
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 528:
-#line 2595 "parse.y"
+#line 2599 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6449,7 +6453,7 @@ case 528:
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 529:
-#line 2604 "parse.y"
+#line 2608 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6457,7 +6461,7 @@ case 529:
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 530:
-#line 2610 "parse.y"
+#line 2614 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6465,7 +6469,7 @@ case 530:
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 531:
-#line 2616 "parse.y"
+#line 2620 "parse.y"
{ split_specs_attrs (yyvsp[-4].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-4].ttype = current_declspecs;
@@ -6473,7 +6477,7 @@ case 531:
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 532:
-#line 2622 "parse.y"
+#line 2626 "parse.y"
{ split_specs_attrs (yyvsp[-3].ttype, &current_declspecs,
&prefix_attributes);
yyvsp[-3].ttype = current_declspecs;
@@ -6481,54 +6485,54 @@ case 532:
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 533:
-#line 2631 "parse.y"
+#line 2635 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 534:
-#line 2634 "parse.y"
+#line 2638 "parse.y"
{ yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 535:
-#line 2640 "parse.y"
+#line 2644 "parse.y"
{ yyval.ttype = grokfield (yyval.ttype, current_declspecs, yyvsp[0].ttype, yyvsp[-2].ttype,
build_tree_list (yyvsp[-1].ttype, prefix_attributes)); ;
break;}
case 536:
-#line 2643 "parse.y"
+#line 2647 "parse.y"
{ yyval.ttype = grokbitfield (yyval.ttype, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 537:
-#line 2646 "parse.y"
+#line 2650 "parse.y"
{ yyval.ttype = grokbitfield (NULL_TREE, current_declspecs, yyvsp[-1].ttype);
cplus_decl_attributes (yyval.ttype, yyvsp[0].ttype, prefix_attributes); ;
break;}
case 539:
-#line 2657 "parse.y"
+#line 2661 "parse.y"
{ TREE_CHAIN (yyvsp[0].ttype) = yyval.ttype; yyval.ttype = yyvsp[0].ttype; ;
break;}
case 540:
-#line 2662 "parse.y"
+#line 2666 "parse.y"
{ yyval.ttype = build_enumerator (yyval.ttype, NULL_TREE); ;
break;}
case 541:
-#line 2664 "parse.y"
+#line 2668 "parse.y"
{ yyval.ttype = build_enumerator (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 542:
-#line 2670 "parse.y"
+#line 2674 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 543:
-#line 2673 "parse.y"
+#line 2677 "parse.y"
{ yyval.ftype.t = build_decl_list (yyvsp[0].ftype.t, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 544:
-#line 2678 "parse.y"
+#line 2682 "parse.y"
{
if (pedantic)
pedwarn ("ANSI C++ forbids array dimensions with parenthesized type in new");
@@ -6538,71 +6542,71 @@ case 544:
;
break;}
case 545:
-#line 2689 "parse.y"
+#line 2693 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 546:
-#line 2691 "parse.y"
+#line 2695 "parse.y"
{ yyval.ttype = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 547:
-#line 2696 "parse.y"
+#line 2700 "parse.y"
{ yyval.ftype.t = IDENTIFIER_AS_LIST (yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
case 548:
-#line 2699 "parse.y"
+#line 2703 "parse.y"
{ yyval.ftype.t = decl_tree_cons (NULL_TREE, yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 549:
-#line 2708 "parse.y"
+#line 2712 "parse.y"
{ yyval.itype = suspend_momentary (); ;
break;}
case 550:
-#line 2713 "parse.y"
+#line 2717 "parse.y"
{ resume_momentary ((int) yyvsp[-1].itype); yyval.ttype = yyvsp[0].ttype; ;
break;}
case 551:
-#line 2719 "parse.y"
+#line 2723 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 552:
-#line 2721 "parse.y"
+#line 2725 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 553:
-#line 2723 "parse.y"
+#line 2727 "parse.y"
{ resume_momentary ((int) yyvsp[-1].itype); yyval.ttype = empty_parms (); ;
break;}
case 554:
-#line 2725 "parse.y"
+#line 2729 "parse.y"
{ resume_momentary ((int) yyvsp[-3].itype); yyval.ttype = NULL_TREE; ;
break;}
case 555:
-#line 2732 "parse.y"
+#line 2736 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 556:
-#line 2734 "parse.y"
+#line 2738 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 557:
-#line 2736 "parse.y"
+#line 2740 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 558:
-#line 2738 "parse.y"
+#line 2742 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 559:
-#line 2740 "parse.y"
+#line 2744 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 561:
-#line 2748 "parse.y"
+#line 2752 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
{
@@ -6621,7 +6625,7 @@ case 561:
;
break;}
case 562:
-#line 2765 "parse.y"
+#line 2769 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
yyval.ttype = IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype);
@@ -6631,97 +6635,97 @@ case 562:
;
break;}
case 565:
-#line 2778 "parse.y"
+#line 2782 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 566:
-#line 2783 "parse.y"
+#line 2787 "parse.y"
{ yyval.ttype = get_type_decl (yyvsp[0].ttype); ;
break;}
case 567:
-#line 2788 "parse.y"
+#line 2792 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 568:
-#line 2790 "parse.y"
+#line 2794 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 569:
-#line 2792 "parse.y"
+#line 2796 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
case 570:
-#line 2794 "parse.y"
+#line 2798 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 571:
-#line 2796 "parse.y"
+#line 2800 "parse.y"
{ push_nested_class (yyvsp[-1].ttype, 3);
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype);
TREE_COMPLEXITY (yyval.ttype) = current_class_depth; ;
break;}
case 573:
-#line 2807 "parse.y"
+#line 2811 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 574:
-#line 2809 "parse.y"
+#line 2813 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 575:
-#line 2811 "parse.y"
+#line 2815 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 576:
-#line 2813 "parse.y"
+#line 2817 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 577:
-#line 2815 "parse.y"
+#line 2819 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 579:
-#line 2823 "parse.y"
+#line 2827 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 580:
-#line 2825 "parse.y"
+#line 2829 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 581:
-#line 2827 "parse.y"
+#line 2831 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 582:
-#line 2829 "parse.y"
+#line 2833 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 583:
-#line 2831 "parse.y"
+#line 2835 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 585:
-#line 2839 "parse.y"
+#line 2843 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-2].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 586:
-#line 2841 "parse.y"
+#line 2845 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 587:
-#line 2843 "parse.y"
+#line 2847 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 588:
-#line 2845 "parse.y"
+#line 2849 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
case 589:
-#line 2847 "parse.y"
+#line 2851 "parse.y"
{ if (OP0 (yyval.ttype) != current_class_type)
{
push_nested_class (OP0 (yyval.ttype), 3);
@@ -6730,7 +6734,7 @@ case 589:
;
break;}
case 590:
-#line 2854 "parse.y"
+#line 2858 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype);
if (yyvsp[-1].ttype != current_class_type)
@@ -6741,51 +6745,51 @@ case 590:
;
break;}
case 591:
-#line 2866 "parse.y"
+#line 2870 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 592:
-#line 2869 "parse.y"
+#line 2873 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 593:
-#line 2875 "parse.y"
+#line 2879 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyval.ttype, yyvsp[0].ttype); ;
break;}
case 594:
-#line 2878 "parse.y"
+#line 2882 "parse.y"
{ got_scope = NULL_TREE;
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 596:
-#line 2885 "parse.y"
+#line 2889 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 597:
-#line 2890 "parse.y"
+#line 2894 "parse.y"
{ yyval.ttype = build_functional_cast (yyvsp[-3].ftype.t, yyvsp[-1].ttype); ;
break;}
case 598:
-#line 2892 "parse.y"
+#line 2896 "parse.y"
{ yyval.ttype = reparse_decl_as_expr (yyvsp[-3].ftype.t, yyvsp[-1].ttype); ;
break;}
case 599:
-#line 2894 "parse.y"
+#line 2898 "parse.y"
{ yyval.ttype = reparse_absdcl_as_expr (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 604:
-#line 2906 "parse.y"
+#line 2910 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 605:
-#line 2908 "parse.y"
+#line 2912 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 606:
-#line 2915 "parse.y"
+#line 2919 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
{
@@ -6801,7 +6805,7 @@ case 606:
;
break;}
case 607:
-#line 2929 "parse.y"
+#line 2933 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6809,7 +6813,7 @@ case 607:
;
break;}
case 608:
-#line 2935 "parse.y"
+#line 2939 "parse.y"
{
if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6817,15 +6821,15 @@ case 608:
;
break;}
case 609:
-#line 2941 "parse.y"
+#line 2945 "parse.y"
{ got_scope = yyval.ttype = complete_type (TREE_TYPE (yyvsp[-1].ttype)); ;
break;}
case 611:
-#line 2957 "parse.y"
+#line 2961 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 612:
-#line 2962 "parse.y"
+#line 2966 "parse.y"
{
if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype);
@@ -6840,26 +6844,26 @@ case 612:
;
break;}
case 613:
-#line 2975 "parse.y"
+#line 2979 "parse.y"
{ yyval.ttype = TREE_TYPE (yyvsp[0].ttype); ;
break;}
case 614:
-#line 2977 "parse.y"
+#line 2981 "parse.y"
{ yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 615:
-#line 2979 "parse.y"
+#line 2983 "parse.y"
{ yyval.ttype = make_typename_type (yyvsp[-2].ttype, yyvsp[0].ttype); ;
break;}
case 616:
-#line 2984 "parse.y"
+#line 2988 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", yyvsp[0].ttype);
;
break;}
case 617:
-#line 2989 "parse.y"
+#line 2993 "parse.y"
{
if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-1].ttype)) == 't')
yyval.ttype = make_typename_type (yyvsp[-1].ttype, yyvsp[0].ttype);
@@ -6874,15 +6878,15 @@ case 617:
;
break;}
case 618:
-#line 3002 "parse.y"
+#line 3006 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-2].ttype, yyvsp[-1].ttype); ;
break;}
case 619:
-#line 3004 "parse.y"
+#line 3008 "parse.y"
{ got_scope = yyval.ttype = make_typename_type (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 620:
-#line 3009 "parse.y"
+#line 3013 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) != IDENTIFIER_NODE)
yyvsp[-1].ttype = lastiddecl;
@@ -6894,7 +6898,7 @@ case 620:
;
break;}
case 621:
-#line 3019 "parse.y"
+#line 3023 "parse.y"
{
if (TREE_CODE (yyvsp[-1].ttype) != IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6902,11 +6906,11 @@ case 621:
;
break;}
case 622:
-#line 3025 "parse.y"
+#line 3029 "parse.y"
{ got_scope = yyval.ttype = complete_type (TREE_TYPE (yyval.ttype)); ;
break;}
case 625:
-#line 3029 "parse.y"
+#line 3033 "parse.y"
{
if (TREE_CODE (yyval.ttype) == IDENTIFIER_NODE)
yyval.ttype = lastiddecl;
@@ -6914,11 +6918,11 @@ case 625:
;
break;}
case 626:
-#line 3038 "parse.y"
+#line 3042 "parse.y"
{ yyval.ttype = build_min_nt (TEMPLATE_ID_EXPR, yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 627:
-#line 3043 "parse.y"
+#line 3047 "parse.y"
{
if (TREE_CODE (yyvsp[0].ttype) == IDENTIFIER_NODE)
yyval.ttype = IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype);
@@ -6928,148 +6932,148 @@ case 627:
;
break;}
case 629:
-#line 3052 "parse.y"
+#line 3056 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 630:
-#line 3057 "parse.y"
+#line 3061 "parse.y"
{ got_scope = NULL_TREE; ;
break;}
case 631:
-#line 3059 "parse.y"
+#line 3063 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; got_scope = NULL_TREE; ;
break;}
case 632:
-#line 3066 "parse.y"
+#line 3070 "parse.y"
{ got_scope = void_type_node; ;
break;}
case 633:
-#line 3072 "parse.y"
+#line 3076 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 634:
-#line 3074 "parse.y"
+#line 3078 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 635:
-#line 3076 "parse.y"
+#line 3080 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 636:
-#line 3078 "parse.y"
+#line 3082 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[0].ttype, NULL_TREE); ;
break;}
case 637:
-#line 3080 "parse.y"
+#line 3084 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, arg);
;
break;}
case 638:
-#line 3084 "parse.y"
+#line 3088 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 640:
-#line 3093 "parse.y"
+#line 3097 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 641:
-#line 3095 "parse.y"
+#line 3099 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 642:
-#line 3101 "parse.y"
+#line 3105 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 643:
-#line 3103 "parse.y"
+#line 3107 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 644:
-#line 3105 "parse.y"
+#line 3109 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[0].ftype.t, NULL_TREE); ;
break;}
case 645:
-#line 3107 "parse.y"
+#line 3111 "parse.y"
{ yyval.ttype = make_pointer_declarator (NULL_TREE, NULL_TREE); ;
break;}
case 646:
-#line 3109 "parse.y"
+#line 3113 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 647:
-#line 3111 "parse.y"
+#line 3115 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, yyvsp[0].ttype); ;
break;}
case 648:
-#line 3113 "parse.y"
+#line 3117 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[0].ftype.t, NULL_TREE); ;
break;}
case 649:
-#line 3115 "parse.y"
+#line 3119 "parse.y"
{ yyval.ttype = make_reference_declarator (NULL_TREE, NULL_TREE); ;
break;}
case 650:
-#line 3117 "parse.y"
+#line 3121 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[0].ttype, NULL_TREE);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-1].ttype, arg);
;
break;}
case 651:
-#line 3121 "parse.y"
+#line 3125 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 653:
-#line 3130 "parse.y"
+#line 3134 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 655:
-#line 3134 "parse.y"
+#line 3138 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 656:
-#line 3136 "parse.y"
+#line 3140 "parse.y"
{ yyval.ttype = make_call_declarator (yyval.ttype, empty_parms (), yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 657:
-#line 3138 "parse.y"
+#line 3142 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 658:
-#line 3140 "parse.y"
+#line 3144 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, yyval.ttype, NULL_TREE); ;
break;}
case 659:
-#line 3142 "parse.y"
+#line 3146 "parse.y"
{ yyval.ttype = make_call_declarator (NULL_TREE, yyvsp[-3].ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 660:
-#line 3144 "parse.y"
+#line 3148 "parse.y"
{ set_quals_and_spec (yyval.ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 661:
-#line 3146 "parse.y"
+#line 3150 "parse.y"
{ set_quals_and_spec (yyval.ttype, yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 662:
-#line 3148 "parse.y"
+#line 3152 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, yyvsp[-1].ttype); ;
break;}
case 663:
-#line 3150 "parse.y"
+#line 3154 "parse.y"
{ yyval.ttype = build_parse_node (ARRAY_REF, NULL_TREE, NULL_TREE); ;
break;}
case 670:
-#line 3173 "parse.y"
+#line 3177 "parse.y"
{ if (pedantic)
pedwarn ("ANSI C++ forbids label declarations"); ;
break;}
case 673:
-#line 3184 "parse.y"
+#line 3188 "parse.y"
{ tree link;
for (link = yyvsp[-1].ttype; link; link = TREE_CHAIN (link))
{
@@ -7080,181 +7084,181 @@ case 673:
;
break;}
case 674:
-#line 3198 "parse.y"
+#line 3202 "parse.y"
{;
break;}
case 676:
-#line 3204 "parse.y"
+#line 3208 "parse.y"
{ yyval.ttype = begin_compound_stmt (0); ;
break;}
case 677:
-#line 3206 "parse.y"
+#line 3210 "parse.y"
{ yyval.ttype = finish_compound_stmt (0, yyvsp[-1].ttype); ;
break;}
case 678:
-#line 3211 "parse.y"
+#line 3215 "parse.y"
{
yyval.ttype = begin_if_stmt ();
cond_stmt_keyword = "if";
;
break;}
case 679:
-#line 3216 "parse.y"
+#line 3220 "parse.y"
{ finish_if_stmt_cond (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 680:
-#line 3218 "parse.y"
+#line 3222 "parse.y"
{ yyval.ttype = finish_then_clause (yyvsp[-3].ttype); ;
break;}
case 682:
-#line 3223 "parse.y"
+#line 3227 "parse.y"
{ yyval.ttype = begin_compound_stmt (0); ;
break;}
case 683:
-#line 3225 "parse.y"
+#line 3229 "parse.y"
{ yyval.ttype = finish_compound_stmt (0, yyvsp[-1].ttype); ;
break;}
case 684:
-#line 3230 "parse.y"
+#line 3234 "parse.y"
{;
break;}
case 686:
-#line 3236 "parse.y"
+#line 3240 "parse.y"
{ finish_stmt (); ;
break;}
case 687:
-#line 3238 "parse.y"
+#line 3242 "parse.y"
{ finish_expr_stmt (yyvsp[-1].ttype); ;
break;}
case 688:
-#line 3240 "parse.y"
+#line 3244 "parse.y"
{ begin_else_clause (); ;
break;}
case 689:
-#line 3242 "parse.y"
+#line 3246 "parse.y"
{
finish_else_clause (yyvsp[-3].ttype);
finish_if_stmt ();
;
break;}
case 690:
-#line 3247 "parse.y"
+#line 3251 "parse.y"
{ finish_if_stmt (); ;
break;}
case 691:
-#line 3249 "parse.y"
+#line 3253 "parse.y"
{
yyval.ttype = begin_while_stmt ();
cond_stmt_keyword = "while";
;
break;}
case 692:
-#line 3254 "parse.y"
+#line 3258 "parse.y"
{ finish_while_stmt_cond (yyvsp[0].ttype, yyvsp[-1].ttype); ;
break;}
case 693:
-#line 3256 "parse.y"
+#line 3260 "parse.y"
{ finish_while_stmt (yyvsp[-3].ttype); ;
break;}
case 694:
-#line 3258 "parse.y"
+#line 3262 "parse.y"
{ yyval.ttype = begin_do_stmt (); ;
break;}
case 695:
-#line 3260 "parse.y"
+#line 3264 "parse.y"
{
finish_do_body (yyvsp[-2].ttype);
cond_stmt_keyword = "do";
;
break;}
case 696:
-#line 3265 "parse.y"
+#line 3269 "parse.y"
{ finish_do_stmt (yyvsp[-1].ttype, yyvsp[-5].ttype); ;
break;}
case 697:
-#line 3267 "parse.y"
+#line 3271 "parse.y"
{ yyval.ttype = begin_for_stmt (); ;
break;}
case 698:
-#line 3269 "parse.y"
+#line 3273 "parse.y"
{ finish_for_init_stmt (yyvsp[-2].ttype); ;
break;}
case 699:
-#line 3271 "parse.y"
+#line 3275 "parse.y"
{ finish_for_cond (yyvsp[-1].ttype, yyvsp[-5].ttype); ;
break;}
case 700:
-#line 3273 "parse.y"
+#line 3277 "parse.y"
{ finish_for_expr (yyvsp[-1].ttype, yyvsp[-8].ttype); ;
break;}
case 701:
-#line 3275 "parse.y"
+#line 3279 "parse.y"
{ finish_for_stmt (yyvsp[-3].ttype, yyvsp[-10].ttype); ;
break;}
case 702:
-#line 3277 "parse.y"
+#line 3281 "parse.y"
{ begin_switch_stmt (); ;
break;}
case 703:
-#line 3279 "parse.y"
+#line 3283 "parse.y"
{ yyval.ttype = finish_switch_cond (yyvsp[-1].ttype); ;
break;}
case 704:
-#line 3281 "parse.y"
+#line 3285 "parse.y"
{ finish_switch_stmt (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 705:
-#line 3283 "parse.y"
+#line 3287 "parse.y"
{ finish_case_label (yyvsp[-1].ttype, NULL_TREE); ;
break;}
case 707:
-#line 3286 "parse.y"
+#line 3290 "parse.y"
{ finish_case_label (yyvsp[-3].ttype, yyvsp[-1].ttype); ;
break;}
case 709:
-#line 3289 "parse.y"
+#line 3293 "parse.y"
{ finish_case_label (NULL_TREE, NULL_TREE); ;
break;}
case 711:
-#line 3292 "parse.y"
+#line 3296 "parse.y"
{ finish_break_stmt (); ;
break;}
case 712:
-#line 3294 "parse.y"
+#line 3298 "parse.y"
{ finish_continue_stmt (); ;
break;}
case 713:
-#line 3296 "parse.y"
+#line 3300 "parse.y"
{ finish_return_stmt (NULL_TREE); ;
break;}
case 714:
-#line 3298 "parse.y"
+#line 3302 "parse.y"
{ finish_return_stmt (yyvsp[-1].ttype); ;
break;}
case 715:
-#line 3300 "parse.y"
+#line 3304 "parse.y"
{
finish_asm_stmt (yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE, NULL_TREE,
NULL_TREE);
;
break;}
case 716:
-#line 3306 "parse.y"
+#line 3310 "parse.y"
{
finish_asm_stmt (yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE,
NULL_TREE);
;
break;}
case 717:
-#line 3312 "parse.y"
+#line 3316 "parse.y"
{ finish_asm_stmt (yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype, NULL_TREE); ;
break;}
case 718:
-#line 3316 "parse.y"
+#line 3320 "parse.y"
{ finish_asm_stmt (yyvsp[-10].ttype, yyvsp[-8].ttype, yyvsp[-6].ttype, yyvsp[-4].ttype, yyvsp[-2].ttype); ;
break;}
case 719:
-#line 3318 "parse.y"
+#line 3322 "parse.y"
{
if (pedantic)
pedwarn ("ANSI C++ forbids computed gotos");
@@ -7262,25 +7266,25 @@ case 719:
;
break;}
case 720:
-#line 3324 "parse.y"
+#line 3328 "parse.y"
{ finish_goto_stmt (yyvsp[-1].ttype); ;
break;}
case 721:
-#line 3326 "parse.y"
+#line 3330 "parse.y"
{ finish_stmt (); ;
break;}
case 722:
-#line 3328 "parse.y"
+#line 3332 "parse.y"
{ error ("label must be followed by statement");
yyungetc ('}', 0);
finish_stmt (); ;
break;}
case 723:
-#line 3332 "parse.y"
+#line 3336 "parse.y"
{ finish_stmt (); ;
break;}
case 725:
-#line 3338 "parse.y"
+#line 3342 "parse.y"
{
if (! current_function_parms_stored)
store_parm_decls ();
@@ -7288,11 +7292,11 @@ case 725:
;
break;}
case 726:
-#line 3344 "parse.y"
+#line 3348 "parse.y"
{ expand_start_all_catch (); ;
break;}
case 727:
-#line 3346 "parse.y"
+#line 3350 "parse.y"
{
int nested = (hack_decl_function_context
(current_function_decl) != NULL_TREE);
@@ -7301,41 +7305,41 @@ case 727:
;
break;}
case 728:
-#line 3356 "parse.y"
+#line 3360 "parse.y"
{ yyval.ttype = begin_try_block (); ;
break;}
case 729:
-#line 3358 "parse.y"
+#line 3362 "parse.y"
{ finish_try_block (yyvsp[-1].ttype); ;
break;}
case 730:
-#line 3360 "parse.y"
+#line 3364 "parse.y"
{ finish_handler_sequence (yyvsp[-3].ttype); ;
break;}
case 733:
-#line 3370 "parse.y"
+#line 3374 "parse.y"
{ yyval.ttype = begin_handler(); ;
break;}
case 734:
-#line 3372 "parse.y"
+#line 3376 "parse.y"
{ finish_handler_parms (yyvsp[-1].ttype); ;
break;}
case 735:
-#line 3374 "parse.y"
+#line 3378 "parse.y"
{ finish_handler (yyvsp[-3].ttype); ;
break;}
case 738:
-#line 3384 "parse.y"
+#line 3388 "parse.y"
{ expand_start_catch_block (NULL_TREE, NULL_TREE); ;
break;}
case 739:
-#line 3400 "parse.y"
+#line 3404 "parse.y"
{ check_for_new_type ("inside exception declarations", yyvsp[-1].ftype);
expand_start_catch_block (TREE_PURPOSE (yyvsp[-1].ftype.t),
TREE_VALUE (yyvsp[-1].ftype.t)); ;
break;}
case 740:
-#line 3407 "parse.y"
+#line 3411 "parse.y"
{ tree label;
do_label:
label = define_label (input_filename, lineno, yyvsp[-1].ttype);
@@ -7344,129 +7348,129 @@ case 740:
;
break;}
case 741:
-#line 3414 "parse.y"
+#line 3418 "parse.y"
{ goto do_label; ;
break;}
case 742:
-#line 3416 "parse.y"
+#line 3420 "parse.y"
{ goto do_label; ;
break;}
case 743:
-#line 3418 "parse.y"
+#line 3422 "parse.y"
{ goto do_label; ;
break;}
case 744:
-#line 3423 "parse.y"
+#line 3427 "parse.y"
{ if (yyvsp[-1].ttype) cplus_expand_expr_stmt (yyvsp[-1].ttype); ;
break;}
case 746:
-#line 3426 "parse.y"
+#line 3430 "parse.y"
{ if (pedantic)
pedwarn ("ANSI C++ forbids compound statements inside for initializations");
;
break;}
case 747:
-#line 3435 "parse.y"
+#line 3439 "parse.y"
{ emit_line_note (input_filename, lineno);
yyval.ttype = NULL_TREE; ;
break;}
case 748:
-#line 3438 "parse.y"
+#line 3442 "parse.y"
{ emit_line_note (input_filename, lineno); ;
break;}
case 749:
-#line 3443 "parse.y"
+#line 3447 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 751:
-#line 3446 "parse.y"
+#line 3450 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 752:
-#line 3453 "parse.y"
+#line 3457 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 755:
-#line 3460 "parse.y"
+#line 3464 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, yyvsp[0].ttype); ;
break;}
case 756:
-#line 3465 "parse.y"
+#line 3469 "parse.y"
{ yyval.ttype = build_tree_list (yyval.ttype, yyvsp[-1].ttype); ;
break;}
case 757:
-#line 3470 "parse.y"
+#line 3474 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyval.ttype, NULL_TREE); ;
break;}
case 758:
-#line 3472 "parse.y"
+#line 3476 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ttype, yyval.ttype); ;
break;}
case 759:
-#line 3483 "parse.y"
+#line 3487 "parse.y"
{
yyval.ttype = empty_parms();
;
break;}
case 761:
-#line 3488 "parse.y"
+#line 3492 "parse.y"
{ yyval.ttype = tree_cons (NULL_TREE, yyvsp[0].ftype.t, void_list_node);
TREE_PARMLIST (yyval.ttype) = 1;
check_for_new_type ("inside parameter list", yyvsp[0].ftype); ;
break;}
case 762:
-#line 3497 "parse.y"
+#line 3501 "parse.y"
{
yyval.ttype = chainon (yyval.ttype, void_list_node);
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 763:
-#line 3502 "parse.y"
+#line 3506 "parse.y"
{
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 764:
-#line 3507 "parse.y"
+#line 3511 "parse.y"
{
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 765:
-#line 3511 "parse.y"
+#line 3515 "parse.y"
{
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t);
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 766:
-#line 3516 "parse.y"
+#line 3520 "parse.y"
{
yyval.ttype = NULL_TREE;
;
break;}
case 767:
-#line 3520 "parse.y"
+#line 3524 "parse.y"
{
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 768:
-#line 3524 "parse.y"
+#line 3528 "parse.y"
{
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 769:
-#line 3528 "parse.y"
+#line 3532 "parse.y"
{
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t);
TREE_PARMLIST (yyval.ttype) = 1;
;
break;}
case 770:
-#line 3533 "parse.y"
+#line 3537 "parse.y"
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
@@ -7479,7 +7483,7 @@ case 770:
;
break;}
case 771:
-#line 3544 "parse.y"
+#line 3548 "parse.y"
{
/* This helps us recover from really nasty
parse errors, for example, a missing right
@@ -7492,98 +7496,98 @@ case 771:
;
break;}
case 772:
-#line 3559 "parse.y"
+#line 3563 "parse.y"
{ maybe_snarf_defarg (); ;
break;}
case 773:
-#line 3561 "parse.y"
+#line 3565 "parse.y"
{ yyval.ttype = yyvsp[0].ttype; ;
break;}
case 776:
-#line 3572 "parse.y"
+#line 3576 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ftype.t); ;
break;}
case 777:
-#line 3575 "parse.y"
+#line 3579 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t); ;
break;}
case 778:
-#line 3578 "parse.y"
+#line 3582 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[0].ftype);
yyval.ttype = chainon (yyval.ttype, yyvsp[0].ftype.t); ;
break;}
case 779:
-#line 3581 "parse.y"
+#line 3585 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
break;}
case 780:
-#line 3583 "parse.y"
+#line 3587 "parse.y"
{ yyval.ttype = chainon (yyval.ttype, build_tree_list (yyvsp[0].ttype, yyvsp[-2].ttype)); ;
break;}
case 782:
-#line 3589 "parse.y"
+#line 3593 "parse.y"
{ check_for_new_type ("in a parameter list", yyvsp[-1].ftype);
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[-1].ftype.t); ;
break;}
case 783:
-#line 3599 "parse.y"
+#line 3603 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag;
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype); ;
break;}
case 784:
-#line 3603 "parse.y"
+#line 3607 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[-1].ftype.t, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 785:
-#line 3606 "parse.y"
+#line 3610 "parse.y"
{ yyval.ftype.t = build_tree_list (get_decl_list (yyvsp[-1].ftype.t), yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 786:
-#line 3609 "parse.y"
+#line 3613 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ftype.t);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 787:
-#line 3613 "parse.y"
+#line 3617 "parse.y"
{ tree specs = strip_attrs (yyvsp[0].ftype.t);
yyval.ftype.t = build_tree_list (specs, NULL_TREE);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 788:
-#line 3617 "parse.y"
+#line 3621 "parse.y"
{ tree specs = strip_attrs (yyvsp[-1].ttype);
yyval.ftype.t = build_tree_list (specs, yyvsp[0].ttype);
yyval.ftype.new_type_flag = 0; ;
break;}
case 789:
-#line 3624 "parse.y"
+#line 3628 "parse.y"
{ yyval.ftype.t = build_tree_list (NULL_TREE, yyvsp[0].ftype.t);
yyval.ftype.new_type_flag = yyvsp[0].ftype.new_type_flag; ;
break;}
case 790:
-#line 3627 "parse.y"
+#line 3631 "parse.y"
{ yyval.ftype.t = build_tree_list (yyvsp[0].ttype, yyvsp[-1].ftype.t);
yyval.ftype.new_type_flag = yyvsp[-1].ftype.new_type_flag; ;
break;}
case 793:
-#line 3638 "parse.y"
+#line 3642 "parse.y"
{ see_typename (); ;
break;}
case 794:
-#line 3643 "parse.y"
+#line 3647 "parse.y"
{
error ("type specifier omitted for parameter");
yyval.ttype = build_tree_list (integer_type_node, NULL_TREE);
;
break;}
case 795:
-#line 3648 "parse.y"
+#line 3652 "parse.y"
{
error ("type specifier omitted for parameter");
if (TREE_CODE (yyval.ttype) == SCOPE_REF
@@ -7594,193 +7598,193 @@ case 795:
;
break;}
case 796:
-#line 3660 "parse.y"
+#line 3664 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 797:
-#line 3662 "parse.y"
+#line 3666 "parse.y"
{ yyval.ttype = yyvsp[-1].ttype; ;
break;}
case 798:
-#line 3664 "parse.y"
+#line 3668 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, NULL_TREE); ;
break;}
case 799:
-#line 3669 "parse.y"
+#line 3673 "parse.y"
{ yyval.ttype = build_decl_list (NULL_TREE, groktypename(yyvsp[0].ftype.t)); ;
break;}
case 801:
-#line 3675 "parse.y"
+#line 3679 "parse.y"
{
TREE_CHAIN (yyvsp[0].ttype) = yyval.ttype;
yyval.ttype = yyvsp[0].ttype;
;
break;}
case 802:
-#line 3683 "parse.y"
+#line 3687 "parse.y"
{ yyval.ttype = NULL_TREE; ;
break;}
case 803:
-#line 3685 "parse.y"
+#line 3689 "parse.y"
{ yyval.ttype = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 804:
-#line 3687 "parse.y"
+#line 3691 "parse.y"
{ yyval.ttype = make_reference_declarator (yyvsp[-1].ttype, yyvsp[0].ttype); ;
break;}
case 805:
-#line 3689 "parse.y"
+#line 3693 "parse.y"
{ tree arg = make_pointer_declarator (yyvsp[-1].ttype, yyvsp[0].ttype);
yyval.ttype = build_parse_node (SCOPE_REF, yyvsp[-2].ttype, arg);
;
break;}
case 806:
-#line 3696 "parse.y"
+#line 3700 "parse.y"
{ got_scope = NULL_TREE; ;
break;}
case 807:
-#line 3701 "parse.y"
+#line 3705 "parse.y"
{ yyval.ttype = ansi_opname[MULT_EXPR]; ;
break;}
case 808:
-#line 3703 "parse.y"
+#line 3707 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_DIV_EXPR]; ;
break;}
case 809:
-#line 3705 "parse.y"
+#line 3709 "parse.y"
{ yyval.ttype = ansi_opname[TRUNC_MOD_EXPR]; ;
break;}
case 810:
-#line 3707 "parse.y"
+#line 3711 "parse.y"
{ yyval.ttype = ansi_opname[PLUS_EXPR]; ;
break;}
case 811:
-#line 3709 "parse.y"
+#line 3713 "parse.y"
{ yyval.ttype = ansi_opname[MINUS_EXPR]; ;
break;}
case 812:
-#line 3711 "parse.y"
+#line 3715 "parse.y"
{ yyval.ttype = ansi_opname[BIT_AND_EXPR]; ;
break;}
case 813:
-#line 3713 "parse.y"
+#line 3717 "parse.y"
{ yyval.ttype = ansi_opname[BIT_IOR_EXPR]; ;
break;}
case 814:
-#line 3715 "parse.y"
+#line 3719 "parse.y"
{ yyval.ttype = ansi_opname[BIT_XOR_EXPR]; ;
break;}
case 815:
-#line 3717 "parse.y"
+#line 3721 "parse.y"
{ yyval.ttype = ansi_opname[BIT_NOT_EXPR]; ;
break;}
case 816:
-#line 3719 "parse.y"
+#line 3723 "parse.y"
{ yyval.ttype = ansi_opname[COMPOUND_EXPR]; ;
break;}
case 817:
-#line 3721 "parse.y"
+#line 3725 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 818:
-#line 3723 "parse.y"
+#line 3727 "parse.y"
{ yyval.ttype = ansi_opname[LT_EXPR]; ;
break;}
case 819:
-#line 3725 "parse.y"
+#line 3729 "parse.y"
{ yyval.ttype = ansi_opname[GT_EXPR]; ;
break;}
case 820:
-#line 3727 "parse.y"
+#line 3731 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 821:
-#line 3729 "parse.y"
+#line 3733 "parse.y"
{ yyval.ttype = ansi_assopname[yyvsp[0].code]; ;
break;}
case 822:
-#line 3731 "parse.y"
+#line 3735 "parse.y"
{ yyval.ttype = ansi_opname [MODIFY_EXPR]; ;
break;}
case 823:
-#line 3733 "parse.y"
+#line 3737 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 824:
-#line 3735 "parse.y"
+#line 3739 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 825:
-#line 3737 "parse.y"
+#line 3741 "parse.y"
{ yyval.ttype = ansi_opname[POSTINCREMENT_EXPR]; ;
break;}
case 826:
-#line 3739 "parse.y"
+#line 3743 "parse.y"
{ yyval.ttype = ansi_opname[PREDECREMENT_EXPR]; ;
break;}
case 827:
-#line 3741 "parse.y"
+#line 3745 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ANDIF_EXPR]; ;
break;}
case 828:
-#line 3743 "parse.y"
+#line 3747 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_ORIF_EXPR]; ;
break;}
case 829:
-#line 3745 "parse.y"
+#line 3749 "parse.y"
{ yyval.ttype = ansi_opname[TRUTH_NOT_EXPR]; ;
break;}
case 830:
-#line 3747 "parse.y"
+#line 3751 "parse.y"
{ yyval.ttype = ansi_opname[COND_EXPR]; ;
break;}
case 831:
-#line 3749 "parse.y"
+#line 3753 "parse.y"
{ yyval.ttype = ansi_opname[yyvsp[0].code]; ;
break;}
case 832:
-#line 3751 "parse.y"
+#line 3755 "parse.y"
{ yyval.ttype = ansi_opname[COMPONENT_REF]; ;
break;}
case 833:
-#line 3753 "parse.y"
+#line 3757 "parse.y"
{ yyval.ttype = ansi_opname[MEMBER_REF]; ;
break;}
case 834:
-#line 3755 "parse.y"
+#line 3759 "parse.y"
{ yyval.ttype = ansi_opname[CALL_EXPR]; ;
break;}
case 835:
-#line 3757 "parse.y"
+#line 3761 "parse.y"
{ yyval.ttype = ansi_opname[ARRAY_REF]; ;
break;}
case 836:
-#line 3759 "parse.y"
+#line 3763 "parse.y"
{ yyval.ttype = ansi_opname[NEW_EXPR]; ;
break;}
case 837:
-#line 3761 "parse.y"
+#line 3765 "parse.y"
{ yyval.ttype = ansi_opname[DELETE_EXPR]; ;
break;}
case 838:
-#line 3763 "parse.y"
+#line 3767 "parse.y"
{ yyval.ttype = ansi_opname[VEC_NEW_EXPR]; ;
break;}
case 839:
-#line 3765 "parse.y"
+#line 3769 "parse.y"
{ yyval.ttype = ansi_opname[VEC_DELETE_EXPR]; ;
break;}
case 840:
-#line 3768 "parse.y"
+#line 3772 "parse.y"
{ yyval.ttype = grokoptypename (yyvsp[-1].ftype.t, yyvsp[0].ttype); ;
break;}
case 841:
-#line 3770 "parse.y"
+#line 3774 "parse.y"
{ yyval.ttype = ansi_opname[ERROR_MARK]; ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/cygnus/latest-940103/share/bison.simple"
+#line 498 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -7976,7 +7980,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 3773 "parse.y"
+#line 3777 "parse.y"
#ifdef SPEW_DEBUG
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 7e79685..12b59b1 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -2498,8 +2498,12 @@ component_decl:
{ $$ = finish_member_template_decl ($1, $2); }
| template_header typed_declspecs ';'
{
- shadow_tag ($2.t);
note_list_got_semicolon ($2.t);
+ grok_x_components ($2.t, NULL_TREE);
+ if (TYPE_CONTEXT (TREE_VALUE ($2.t)) != current_class_type)
+ /* The component was in fact a friend
+ declaration. */
+ $2.t = NULL_TREE;
$$ = finish_member_template_decl ($1, $2.t);
}
;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a0c4e6b..d1a2446 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -75,7 +75,6 @@ static int push_tinst_level PROTO((tree));
static tree classtype_mangled_name PROTO((tree));
static char *mangle_class_name_for_template PROTO((char *, tree, tree, tree));
static tree tsubst_expr_values PROTO((tree, tree));
-static int comp_template_args PROTO((tree, tree));
static int list_eq PROTO((tree, tree));
static tree get_class_bindings PROTO((tree, tree, tree, tree));
static tree coerce_template_parms PROTO((tree, tree, tree, int, int, int));
@@ -100,6 +99,7 @@ static tree reduce_template_parm_level PROTO((tree, tree, int));
static tree build_template_decl PROTO((tree, tree));
static int mark_template_parm PROTO((tree, void *));
static tree tsubst_friend_function PROTO((tree, tree));
+static tree tsubst_friend_class PROTO((tree, tree));
static tree get_bindings_real PROTO((tree, tree, tree, int));
static int template_decl_level PROTO((tree));
static tree maybe_get_template_decl_from_type_decl PROTO((tree));
@@ -489,13 +489,26 @@ add_to_template_args (args, extra_args)
void
begin_template_parm_list ()
{
+ /* We use a non-tag-transparent scope here, which causes pushtag to
+ put tags in this scope, rather than in the enclosing class or
+ namespace scope. This is the right thing, since we want
+ TEMPLATE_DECLS, and not TYPE_DECLS for template classes. For a
+ global template class, push_template_decl handles putting the
+ TEMPLATE_DECL into top-level scope. For a nested template class,
+ e.g.:
+
+ template <class T> struct S1 {
+ template <class T> struct S2 {};
+ };
+
+ pushtag contains special code to call pushdecl_with_scope on the
+ TEMPLATE_DECL for S2. */
pushlevel (0);
declare_pseudo_global_level ();
++processing_template_decl;
note_template_header (0);
}
-
/* We've just seen template <>. */
void
@@ -504,7 +517,6 @@ begin_specialization ()
note_template_header (1);
}
-
/* Called at then end of processing a declaration preceeded by
template<>. */
@@ -514,7 +526,6 @@ end_specialization ()
reset_specialization ();
}
-
/* Any template <>'s that we have seen thus far are not referring to a
function specialization. */
@@ -525,7 +536,6 @@ reset_specialization ()
template_header_count = 0;
}
-
/* We've just seen a template header. If SPECIALIZATION is non-zero,
it was of the form template <>. */
@@ -537,7 +547,6 @@ note_template_header (specialization)
template_header_count++;
}
-
/* We're beginning an explicit instantiation. */
void
@@ -554,7 +563,6 @@ end_explicit_instantiation ()
--processing_explicit_instantiation;
}
-
/* Retrieve the specialization (in the sense of [temp.spec] - a
specialization is either an instantiation or an explicit
specialization) of TMPL for the given template ARGS. If there is
@@ -580,7 +588,38 @@ retrieve_specialization (tmpl, args)
return NULL_TREE;
}
+/* Returns non-zero iff DECL is a specialization of TMPL. */
+
+int
+is_specialization_of (decl, tmpl)
+ tree decl;
+ tree tmpl;
+{
+ tree t;
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ for (t = decl;
+ t != NULL_TREE;
+ t = DECL_TEMPLATE_INFO (t) ? DECL_TI_TEMPLATE (t) : NULL_TREE)
+ if (t == tmpl)
+ return 1;
+ }
+ else
+ {
+ my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 0);
+
+ for (t = TREE_TYPE (decl);
+ t != NULL_TREE;
+ t = CLASSTYPE_USE_TEMPLATE (t)
+ ? TREE_TYPE (CLASSTYPE_TI_TEMPLATE (t)) : NULL_TREE)
+ if (comptypes (TYPE_MAIN_VARIANT (t),
+ TYPE_MAIN_VARIANT (TREE_TYPE (tmpl)), 1))
+ return 1;
+ }
+ return 0;
+}
/* Register the specialization SPEC as a specialization of TMPL with
the indicated ARGS. */
@@ -649,7 +688,6 @@ register_specialization (spec, tmpl, args)
= perm_tree_cons (args, spec, DECL_TEMPLATE_SPECIALIZATIONS (tmpl));
}
-
/* Print the list of candidate FNS in an error message. */
static void
@@ -786,8 +824,7 @@ determine_specialization (template_id, decl, targs_out,
*targs_out = TREE_PURPOSE (templates);
return TREE_VALUE (templates);
}
-
-
+
/* Check to see if the function just declared, as indicated in
DECLARATOR, and in DECL, is a specialization of a function
template. We may also discover that the declaration is an explicit
@@ -1160,7 +1197,6 @@ check_explicit_specialization (declarator, decl, template_count, flags)
return decl;
}
-
/* Returns 1 iff PARMS1 and PARMS2 are identical sets of template
parameters. These are represented in the same format used for
DECL_TEMPLATE_PARMS. */
@@ -1213,7 +1249,6 @@ int comp_template_parms (parms1, parms2)
return 1;
}
-
/* Return a new TEMPLATE_PARM_INDEX with the indicated INDEX, LEVEL,
ORIG_LEVEL, DECL, and TYPE. */
@@ -1235,7 +1270,6 @@ build_template_parm_index (index, level, orig_level, decl, type)
return t;
}
-
/* Return a TEMPLATE_PARM_INDEX, similar to INDEX, but whose
TEMPLATE_PARM_LEVEL has been decreased by LEVELS. If such a
TEMPLATE_PARM_INDEX already exists, it is returned; otherwise, a
@@ -1520,19 +1554,22 @@ mark_template_parm (t, data)
/* Creates a TEMPLATE_DECL for the indicated DECL using the template
parameters given by current_template_args, or reuses a
previously existing one, if appropriate. Returns the DECL, or an
- equivalent one, if it is replaced via a call to duplicate_decls. */
+ equivalent one, if it is replaced via a call to duplicate_decls.
+
+ If IS_FRIEND is non-zero, DECL is a friend declaration. */
tree
-push_template_decl (decl)
+push_template_decl_real (decl, is_friend)
tree decl;
+ int is_friend;
{
tree tmpl;
tree args;
tree info;
tree ctx;
int primary;
- int is_friend = (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_FRIEND_P (decl));
+
+ is_friend |= (TREE_CODE (decl) == FUNCTION_DECL && DECL_FRIEND_P (decl));
if (is_friend)
/* For a friend, we want the context of the friend function, not
@@ -1550,16 +1587,17 @@ push_template_decl (decl)
/* For determining whether this is a primary template or not, we're really
interested in the lexical context, not the true context. */
if (is_friend)
- info = DECL_CLASS_CONTEXT (decl);
+ /* For a TYPE_DECL, there is no DECL_CLASS_CONTEXT. */
+ info = TREE_CODE (decl) == FUNCTION_DECL
+ ? DECL_CLASS_CONTEXT (decl) : current_class_type;
else
info = ctx;
if (info && TREE_CODE (info) == FUNCTION_DECL)
primary = 0;
- else if (! info
- || (TYPE_BEING_DEFINED (info) && template_header_count
- && ! processing_specialization)
- || (template_header_count > template_class_depth (info)))
+ /* Note that template_class_depth returns 0 if given NULL_TREE, so
+ this next line works even when we are at global scope. */
+ else if (processing_template_decl > template_class_depth (info))
primary = 1;
else
primary = 0;
@@ -1775,14 +1813,14 @@ push_template_decl (decl)
DECL_TEMPLATE_RESULT (tmpl) = decl;
TREE_TYPE (tmpl) = TREE_TYPE (decl);
- if (! ctx && primary)
- /* The check of PRIMARY ensures that we do not try to push a
- global template friend declared in a template class; such a
- thing may well depend on the template parameters of the class. */
+ if (! ctx && !(is_friend && template_class_depth (info) > 0))
+ /* Note that we do not try to push a global template friend
+ declared in a template class; such a thing may well depend on
+ the template parameters of the class. */
tmpl = pushdecl_top_level (tmpl);
if (primary)
- TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (tmpl)) = tmpl;
+ DECL_PRIMARY_TEMPLATE (tmpl) = tmpl;
info = perm_tree_cons (tmpl, args, NULL_TREE);
@@ -1800,18 +1838,26 @@ push_template_decl (decl)
return DECL_TEMPLATE_RESULT (tmpl);
}
-/* Called when a class template TYPE is redeclared, e.g.:
+tree
+push_template_decl (decl)
+ tree decl;
+{
+ return push_template_decl_real (decl, 0);
+}
+
+/* Called when a class template TYPE is redeclared with the indicated
+ template PARMS, e.g.:
template <class T> struct S;
template <class T> struct S {}; */
void
-redeclare_class_template (type)
+redeclare_class_template (type, parms)
tree type;
+ tree parms;
{
tree tmpl = CLASSTYPE_TI_TEMPLATE (type);
- tree tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
- tree parms = INNERMOST_TEMPLATE_PARMS (current_template_parms);
+ tree tmpl_parms;
int i;
if (!PRIMARY_TEMPLATE_P (tmpl))
@@ -1820,6 +1866,9 @@ redeclare_class_template (type)
type. */
return;
+ parms = INNERMOST_TEMPLATE_PARMS (parms);
+ tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
+
if (TREE_VEC_LENGTH (parms) != TREE_VEC_LENGTH (tmpl_parms))
{
cp_error_at ("previous declaration `%D'", tmpl);
@@ -2484,7 +2533,7 @@ coerce_template_parms (parms, arglist, in_decl,
/* Renturns 1 iff the OLDARGS and NEWARGS are in fact identical sets
of template arguments. Returns 0 otherwise. */
-static int
+int
comp_template_args (oldargs, newargs)
tree oldargs, newargs;
{
@@ -3251,7 +3300,6 @@ tinst_for_decl ()
return p;
}
-
/* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the
vector of template arguments, as for tsubst.
@@ -3340,6 +3388,51 @@ tsubst_friend_function (decl, args)
return new_friend;
}
+/* FRIEND_TYPE is a friend RECORD_TYPE or UNION_TYPE. ARGS is the
+ vector of template arguments, as for tsubst.
+
+ Returns an appropriate tsbust'd friend type. */
+
+static tree
+tsubst_friend_class (friend_type, args)
+ tree friend_type;
+ tree args;
+{
+ tree tmpl =
+ lookup_name (DECL_NAME (CLASSTYPE_TI_TEMPLATE (friend_type)), 1);
+
+ tmpl = maybe_get_template_decl_from_type_decl (tmpl);
+
+ if (tmpl != NULL_TREE && DECL_CLASS_TEMPLATE_P (tmpl))
+ {
+ /* The friend template has already been declared. Just
+ check to see that the declarations match. */
+ redeclare_class_template (TREE_TYPE (tmpl),
+ DECL_TEMPLATE_PARMS (CLASSTYPE_TI_TEMPLATE
+ (friend_type)));
+ friend_type = TREE_TYPE (tmpl);
+ }
+ else
+ {
+ /* The friend template has not already been declared. In this
+ case, the instantiation of the template class will cause the
+ injection of this template into the global scope. */
+ tmpl = tsubst (CLASSTYPE_TI_TEMPLATE (friend_type), args, NULL_TREE);
+
+ /* The new TMPL is not an instantiation of anything, so we
+ forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for
+ the new type because that is supposed to be the corresponding
+ template decl, i.e., TMPL. */
+ DECL_USE_TEMPLATE (tmpl) = 0;
+ DECL_TEMPLATE_INFO (tmpl) = NULL_TREE;
+ CLASSTYPE_USE_TEMPLATE (TREE_TYPE (tmpl)) = 0;
+
+ /* Inject this template into the global scope. */
+ friend_type = TREE_TYPE (pushdecl_top_level (tmpl));
+ }
+
+ return friend_type;
+}
tree
instantiate_class_template (type)
@@ -3604,12 +3697,25 @@ instantiate_class_template (type)
}
}
- t = CLASSTYPE_FRIEND_CLASSES (type)
- = tsubst (CLASSTYPE_FRIEND_CLASSES (pattern), args, NULL_TREE);
+ for (t = CLASSTYPE_FRIEND_CLASSES (pattern);
+ t != NULL_TREE;
+ t = TREE_CHAIN (t))
+ {
+ tree friend_type = TREE_VALUE (t);
+
+ if (!CLASSTYPE_IS_TEMPLATE (friend_type))
+ /* The call to xref_tag_from_type does injection for friend
+ classes. */
+ friend_type =
+ xref_tag_from_type (tsubst (friend_type, args, NULL_TREE),
+ NULL_TREE, 1);
+ else
+ friend_type = tsubst_friend_class (friend_type, args);
- /* This does injection for friend classes. */
- for (; t; t = TREE_CHAIN (t))
- TREE_VALUE (t) = xref_tag_from_type (TREE_VALUE (t), NULL_TREE, 1);
+ CLASSTYPE_FRIEND_CLASSES (type) =
+ tree_cons (NULL_TREE, friend_type,
+ CLASSTYPE_FRIEND_CLASSES (type));
+ }
/* This does injection for friend functions. */
if (!processing_template_decl)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index c0b00b0..361a559 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -763,26 +763,8 @@ comptypes (type1, type2, strict)
if (CLASSTYPE_TEMPLATE_INFO (t1) && CLASSTYPE_TEMPLATE_INFO (t2)
&& (CLASSTYPE_TI_TEMPLATE (t1) == CLASSTYPE_TI_TEMPLATE (t2)
|| TREE_CODE (t1) == TEMPLATE_TEMPLATE_PARM))
- {
- int i = TREE_VEC_LENGTH (CLASSTYPE_TI_ARGS (t1));
- tree *p1 = &TREE_VEC_ELT (CLASSTYPE_TI_ARGS (t1), 0);
- tree *p2 = &TREE_VEC_ELT (CLASSTYPE_TI_ARGS (t2), 0);
-
- while (i--)
- {
- if (TREE_CODE_CLASS (TREE_CODE (p1[i])) == 't')
- {
- if (! comptypes (p1[i], p2[i], 1))
- return 0;
- }
- else
- {
- if (simple_cst_equal (p1[i], p2[i]) <= 0)
- return 0;
- }
- }
- return 1;
- }
+ return comp_template_args (CLASSTYPE_TI_ARGS (t1),
+ CLASSTYPE_TI_ARGS (t2));
if (strict <= 0)
goto look_hard;
return 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend14.C b/gcc/testsuite/g++.old-deja/g++.pt/friend14.C
new file mode 100644
index 0000000..4ed5fcc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend14.C
@@ -0,0 +1,25 @@
+// Build don't link:
+
+template <class U>
+class S1
+{
+ template <class T>
+ friend class S2;
+
+ static int i;
+};
+
+
+template <class T>
+class S2
+{
+public:
+ static void f() { S1<T>::i = 3; }
+};
+
+
+void g()
+{
+ S2<double>::f();
+ S2<long>::f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend15.C b/gcc/testsuite/g++.old-deja/g++.pt/friend15.C
new file mode 100644
index 0000000..8d49f6a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend15.C
@@ -0,0 +1,24 @@
+// Build don't link:
+
+class S1
+{
+ template <class T>
+ friend class S2;
+
+ static int i;
+};
+
+
+template <class T>
+class S2
+{
+public:
+ static void f() { S1::i = 3; }
+};
+
+
+void g()
+{
+ S2<double>::f();
+ S2<char>::f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend16.C b/gcc/testsuite/g++.old-deja/g++.pt/friend16.C
new file mode 100644
index 0000000..7f13e5b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend16.C
@@ -0,0 +1,31 @@
+// Build don't link:
+
+template <class T>
+class S2
+{
+public:
+ static void f();
+};
+
+
+template <class U>
+class S1
+{
+ template <class T>
+ friend class S2;
+
+ static int i;
+};
+
+
+template <class T>
+void S2<T>::f()
+{
+ S1<T>::i = 3;
+}
+
+void g()
+{
+ S2<double>::f();
+ S2<char>::f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend17.C b/gcc/testsuite/g++.old-deja/g++.pt/friend17.C
new file mode 100644
index 0000000..cb12ce8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend17.C
@@ -0,0 +1,28 @@
+// Build don't link:
+
+template <class T>
+class S2
+{
+public:
+ static void f();
+};
+
+class S1
+{
+ template <class T>
+ friend class S2;
+
+ static int i;
+};
+
+template <class T>
+void S2<T>::f()
+{
+ S1::i = 3;
+}
+
+void g()
+{
+ S2<double>::f();
+ S2<char>::f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend18.C b/gcc/testsuite/g++.old-deja/g++.pt/friend18.C
new file mode 100644
index 0000000..998e163
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend18.C
@@ -0,0 +1,26 @@
+// Build don't link:
+
+template <class U>
+class S1
+{
+ template <class T>
+ friend class S2;
+
+ static int i;
+};
+
+
+template <class T>
+class S2
+{
+public:
+ static void f() { S1<T>::i = 3; }
+};
+
+
+void g()
+{
+ S2<double>::f();
+ S2<long>::f();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend19.C b/gcc/testsuite/g++.old-deja/g++.pt/friend19.C
new file mode 100644
index 0000000..998e163
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend19.C
@@ -0,0 +1,26 @@
+// Build don't link:
+
+template <class U>
+class S1
+{
+ template <class T>
+ friend class S2;
+
+ static int i;
+};
+
+
+template <class T>
+class S2
+{
+public:
+ static void f() { S1<T>::i = 3; }
+};
+
+
+void g()
+{
+ S2<double>::f();
+ S2<long>::f();
+}
+