OSDN Git Service

PR c++/9634
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-03-04  Jason Merrill  <jason@redhat.com>
2
3         PR c++/9634
4         PR c++/29469
5         PR c++/29607
6         * decl.c (make_typename_type): Do look inside currently open classes.
7         * parser.c (cp_parser_lookup_name): Likewise.
8         (cp_parser_template_name): Likewise.
9         * pt.c (dependent_scope_p): New function.
10         * cp-tree.h: Declare it.
11         * class.c (currently_open_class): Return fast if T isn't a class.
12
13 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
14
15         PR c++/37789
16         * parser.c (cp_parser_mem_initializer): Return error_mark_node
17         if cp_parser_mem_initializer_id returns error_mark_node.
18
19 2009-02-24  Richard Guenther  <rguenther@suse.de>
20
21         PR c++/39242
22         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
23         declared functions.
24
25 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
26
27         PR c++/36411
28         * pt.c (coerce_template_template_parms): Return 0 if parameter
29         is error_mark_node.
30
31 2009-02-23  Jason Merrill  <jason@redhat.com>
32
33         * pt.c (unify): Call maybe_adjust_types_for_deduction when
34         deducing from an initializer list.
35
36 2009-02-20  Jason Merrill  <jason@redhat.com>
37
38         PR c++/39225
39         * decl.c (grokdeclarator): Handle ~identifier.
40
41 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
42
43         PR target/39175
44         * decl2.c (determine_visibility): If visibility changed and
45         DECL_RTL has been already set, call make_decl_rtl to update symbol
46         flags.
47
48 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
49
50         PR c++/39188
51         * cp-tree.h (maybe_commonize_var): New.
52
53         * decl.c (maybe_commonize_var): Make it extern.
54
55         * decl2.c (finish_anon_union): Call maybe_commonize_var.
56
57 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
58
59         PR c++/39219
60         * parser.c (cp_parser_enum_specifier): Apply all attributes.
61
62 2009-02-18  Jason Merrill  <jason@redhat.com>
63
64         * cfns.h: Tweak pathname for cfns.gperf.
65
66 2009-02-13  Jason Merrill  <jason@redhat.com>
67
68         PR c++/39070
69         * semantics.c (finish_call_expr): Change koenig_p parm to int.
70         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
71         * cp-tree.h: Adjust prototype.
72         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
73
74 2009-02-12  Jason Merrill  <jason@redhat.com>
75
76         PR c++/38950
77         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
78
79 2009-02-11  Jason Merrill  <jason@redhat.com>
80
81         PR c++/39153
82         * decl2.c (cp_write_global_declarations): 
83         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
84
85         PR c++/30111
86         * init.c (build_value_init_noctor): Split out from...
87         (build_value_init): ...here.
88         (expand_aggr_init_1): Handle value-initialization.
89         * cp-tree.h: Add declaration.
90         * class.c (type_has_user_provided_constructor): 
91         Handle non-class arguments.
92
93 2009-02-10  Jason Merrill  <jason@redhat.com>
94
95         PR c++/38649
96         * class.c (defaultable_fn_p): Handle ... properly.
97
98         PR c++/36744
99         * tree.c (lvalue_p_1): Condition rvalue ref handling on
100         treat_class_rvalues_as_lvalues, too.
101
102 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
103
104         PR c++/34397
105         * typeck.c (build_x_array_ref): New.
106         * cp-tree.h: Declare it.
107         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
108
109 2009-02-09  Jason Merrill  <jason@redhat.com>
110
111         PR c++/39109
112         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
113         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
114         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
115         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
116         for build_value_init TARGET_EXPR.
117         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
118
119 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
120
121         PR c++/35147
122         PR c++/37737
123         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
124
125 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
126
127         PR c++/39095
128         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
129         remove ./dt operator.
130         * mangle.c (write_expression): Handle COMPONENT_REF after handling
131         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
132         write_string ("dt") instead of using operators.def.
133
134 2009-02-03  Jason Merrill  <jason@redhat.com>
135
136         * typeck.c (cp_build_unary_op): Only complain about taking address
137         of main if pedantic.
138
139 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
140
141         PR inline-asm/39059
142         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
143
144         PR c++/39056
145         * typeck2.c (digest_init_r): Don't call process_init_constructor
146         for COMPLEX_TYPE.
147
148 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
149
150         PR c++/36897
151         * pt.c (convert_nontype_argument_function): Expect expr to be an
152         ADDR_EXPR.
153
154         PR c++/37314
155         * typeck.c (merge_types): Call resolve_typename_type if only
156         one type is a typename.
157
158 2009-02-02  Jason Merrill  <jason@redhat.com>
159
160         PR c++/39054
161         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
162         in BIT_NOT_EXPR.
163
164 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
165
166         PR c++/39053
167         * parser.c (cp_parser_pure_specifier): If there are no tokens left
168         do not call cp_lexer_consume_token.
169
170 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
171
172         PR c++/39028
173         * parser.c (cp_parser_already_scoped_statement): Handle __label__
174         declarations.
175
176 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
177
178         PR c++/33465
179         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
180
181 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
182
183         PR c++/38655
184         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
185
186 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
187
188         * typeck.c (invalid_nonstatic_memfn_p): Use
189         DECL_NONSTATIC_MEMBER_FUNCTION_P.
190
191 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
192
193         PR c++/37554
194         * call.c (build_over_call): If convert_for_arg_passing returns
195         error_mark_node unconditionally return it.
196
197 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
198
199         * class.c (check_field_decls): Also inherit packed for bitfields
200         regardless of their type.
201
202 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
203
204         PR c++/38930
205         * decl2.c (grokfield): Reverting changes of PR c++/26693
206         (save_template_attributes): Likewise.
207         * decl.c (grokdeclarator): Likewise.
208         * name-lookup.c (pushdecl_maybe_friend): Likewise.
209         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
210         (append_type_to_template_for_access_check): Likewise.
211         * semantics.c (check_accessibility_of_qualified_id): Likewise.
212         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
213         (tsubst): Likewise.
214         (resolve_type_name_type): Likewise.
215         (append_type_to_template_for_access_check): Likewise.
216
217 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
218
219         PR c++/26693
220         * decl2.c (grokfield): when a typedef appears in a
221         class, create the typedef variant type node for it.
222         (save_template_attributes): Creating typedef variant type node
223          here is now useless.
224         * decl.c (grokdeclarator): If the typedef'ed struct/class was
225         anonymous, set the proper type name to all its type variants.
226         * name-lookup.c (pushdecl_maybe_friend): Reuse the
227         set_underlying_type function to install typedef variant types.
228         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
229         macro.
230         (append_type_to_template_for_access_check): New entry points.
231         * semantics.c (check_accessibility_of_qualified_id):
232         When a typedef that is a member of a class appears in a template,
233         add it to the template. It will be ...
234         * pt.c (instantiate_class_template, instantiate_template ): ... access
235         checked at template instantiation time.
236         (tsubst): Handle the case of being called with NULL args.
237         (resolve_type_name_type): The type name should be the name of the
238         main type variant.
239         (append_type_to_template_for_access_check): New entry point.
240
241 2009-01-19  Jason Merrill  <jason@redhat.com>
242
243         PR c++/23287
244         * parser.c (cp_parser_unqualified_id): In a template,
245         accept ~identifier.
246         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
247
248 2009-01-16  Jason Merrill  <jason@redhat.com>
249
250         PR c++/38877
251         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
252         * init.c (build_new): Don't call describable_type unless we
253         have an auto.
254
255         PR c++/29470
256         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
257
258         PR c++/38579
259         * search.c (protected_accessible_p): N doesn't vary.
260
261 2009-01-15  Jason Merrill  <jason@redhat.com>
262
263         PR c++/38850
264         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
265         accept hidden friends.
266
267 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
268
269         PR C++/29388
270         * decl.c (grokdeclarator): Check for a non namespace/class context.
271
272 2009-01-15  Jason Merrill  <jason@redhat.com>
273
274         PR c++/36334
275         PR c++/37646
276         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
277         a function isn't necessarily an lvalue. Take tree, not const_tree.
278         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
279         * typeck.c (lvalue_or_else): Likewise.
280         * cp-tree.h: Adjust prototypes.
281
282 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
283
284         PR c++/38357
285         * pt.c (tsubst): Check for NULL args.
286
287 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
288
289         PR c++/38636
290         * name-lookup.c (pushtag): Don't create members to types that are not
291         being created.
292
293 2009-01-14  Nick Clifton  <nickc@redhat.com>
294
295         PR c++/37862
296         * parser.c: Pass cp_id_kind computed in
297         cp_parser_postfix_dot_deref_expression to
298         cp_parser_primary_expression.
299
300 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
301
302         PR c++/38795
303         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
304         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
305         as CAST_EXPR.
306
307 2009-01-12  Jason Merrill  <jason@redhat.com>
308             Steve Ellcey  <sje@cup.hp.com>
309
310         PR c++/35109
311         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
312         binding.
313
314 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
315
316         PR c++/36019
317         * pt.c (parameter_of_template_p): New function.
318         * cp-tree.h: Declare it.
319         * name-lookup.c (binding_to_template_parms_of_scope_p): New
320         function.
321         (outer_binding): Take template parameters in account when looking for
322         a name binding.
323
324 2009-01-12  Jason Merrill  <jason@redhat.com>
325
326         PR c++/31488
327         * tree.c (pod_type_p): Return 1 for structs created by the back end.
328
329 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
330
331         PR c/32041
332         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
333         offsetof member-designator, handle it as `[0].'.
334
335         PR c++/38794
336         * decl.c (start_function): If grokdeclarator hasn't returned
337         FUNCTION_DECL nor error_mark_node, issue diagnostics.
338
339 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
340
341         PR c++/36254
342         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
343         (gimplify_if_stmt): ... this.
344         (cp_gimplify_expr): Don't handle IF_STMT here.
345         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
346
347 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
348
349         PR c++/38648
350         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
351
352         PR c++/36695
353         * typeck2.c (build_functional_cast): Check for reference type and NULL
354         PARMS.
355
356 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
357
358         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
359
360 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
361
362         PR c++/35335
363         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
364
365 2009-01-09  John F. Carr  <jfc@mit.edu>
366
367         PR c++/37877
368         * parser.c (cp_parser_class_specifier): Clear
369         parser->in_unbraced_linkage_specification_p while parsing class
370         specifiers.
371
372 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
373
374         PR c++/38725
375         * semantics.c (finish_goto_stmt): Convert destination to
376         void *.
377
378 2009-01-06  Jason Merrill  <jason@redhat.com>
379
380         PR c++/35297
381         PR c++/35477
382         PR c++/35784
383         PR c++/36846
384         PR c++/38276
385         * pt.c (check_default_tmpl_args): Don't complain about
386         out-of-order parameter packs in the enclosing class
387         or parameter packs after default args.
388         (coerce_template_parms): If we have more than one
389         parameter pack, don't flatten argument packs.
390         (template_args_equal): Handle argument packs.
391         (comp_template_args): Don't flatten argument packs.
392         (check_instantiated_arg): Split out from...
393         (check_instantiated_args): Here.  Handle arg packs.
394         (convert_template_argument): Just check that nontype argument
395         packs have the right type.
396
397 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
398
399         PR c++/38472
400         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
401
402 2009-01-05  Jason Merrill  <jason@redhat.com>
403
404         PR c++/38698
405         * typeck2.c (process_init_constructor_union): Handle union with
406         no fields.
407
408         * mangle.c (write_expression): Remove mangling for zero-operand
409         casts.
410
411         PR c++/38701
412         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
413         defaulting.
414
415         PR c++/38702
416         * class.c (defaultable_fn_p): Only operator== can be a copy
417         assignment operator.
418
419 2009-01-02  Jason Merrill  <jason@redhat.com>
420
421         PR c++/38698
422         * typeck2.c (process_init_constructor_union): Handle excess
423         initializers.
424         (process_init_constructor_record): Likewise.
425
426         PR c++/38684
427         * typeck2.c (digest_init_r): Don't use process_init_constructor
428         for non-aggregate classes.