OSDN Git Service

PR c++/28274
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-03-24  Jason Merrill  <jason@redhat.com>
2
3         PR c++/28274
4         * name-lookup.c (pushdecl_maybe_friend): Check default args later.
5
6 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
7
8         PR c/39495
9         * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
10         code if iter is the second operand.
11         * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
12         argument.  If it is set, don't build the toplevel expression with
13         build_x_binary_op, but build2.
14         (cp_parser_assignment_expression,  cp_parser_omp_for_incr): Adjust
15         callers.
16         (cp_parser_omp_for_cond): Don't assume the first operand of the
17         comparison must be decl.
18
19 2009-03-23  Jason Merrill  <jason@redhat.com>
20
21         PR c++/37729
22         * pt.c (make_fnparm_pack): Split out from...
23         (instantiate_decl): ...here.
24         (tsubst_pack_expansion): Handle being called in a late-specified
25         return type.
26
27         PR c++/39526
28         * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
29         a parm with a parm.
30
31 2009-03-20  Jason Merrill  <jason@redhat.com>
32
33         PR c++/28879
34         * parser.c (cp_parser_direct_declarator): In a template, wrap 
35         non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
36         * pt.c (tsubst): Preserve it in a partial instantiation.
37         (dependent_type_p_r): Don't check value_dependent_expression_p.
38         * decl.c (compute_array_index_type): Don't check
39         value_dependent_expression_p if TREE_SIDE_EFFECTS.
40
41         C++ core issue 703
42         * typeck2.c (check_narrowing): Don't complain about loss of 
43         precision when converting a floating-point constant.
44
45 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
46
47         PR c/39495
48         * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
49         (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
50
51 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
52
53         * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
54         (eof_token): Adjust.
55
56 2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
57
58         PR c++/39425
59         * parser.c (cp_parser_explicit_specialization): Don't skip the
60         rest of the specialization when begin_specialization returns
61         false.
62
63 2009-03-17  Jason Merrill  <jason@redhat.com>
64
65         * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
66         (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
67         * pt.c (check_explicit_specialization): Likewise.
68         (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
69         local specialization.
70         * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
71         * decl2.c (parm_index): New fn.
72         * semantics.c (finish_decltype_type): Don't use describable_type.
73         * mangle.c (write_expression): Likewise.  Mangle ALIGNOF_EXPR.
74         Give a sorry for unsupported codes rather than crash.  Mangle
75         conversions with other than 1 operand.  New mangling for PARM_DECL.
76         * operators.def (ALIGNOF_EXPR): Mangle as "az".
77
78 2009-03-17  Jing Yu  <jingyu@google.com>
79
80         PR middle-end/39378
81         * method.c (use_thunk): Change is_thunk from crtl to cfun.
82
83 2009-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
84
85         PR c++/39475
86         * semantics.c (check_trait_type): New.
87         (finish_trait_expr): Use it.
88
89 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
90
91         * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
92         instead of calling imported_module_or_decl debug hook if
93         building_stmt_tree ().
94         * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
95         is a NAMESPACE_DECL.
96
97         PR debug/37890
98         * name-lookup.c (do_namespace_alias): Don't call global_decl debug
99         hook at function scope.
100
101         PR debug/39471
102         * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
103         on IMPORTED_DECL.
104
105 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
106
107         PR c++/39371
108         * semantics.c (finish_switch_cond): Don't call get_unwidened.
109         * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
110         instead of TREE_TYPE (cond).
111
112 2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>
113
114         PR c++/39060
115         * parser.c (cp_parser_late_parsing_default_args): Continue
116         the loop when cp_parser_assignment_expression returns
117         error_mark_node.
118
119 2009-03-07  Jason Merrill  <jason@redhat.com>
120
121         PR c++/39367
122         * init.c (build_new_1): Don't use a VLA type.
123         (build_vec_init): Handle getting a pointer for BASE.
124
125 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
126
127         PR c++/37520
128         * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
129         when mangling symbols.
130
131 2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
132
133         PR c++/33492
134         * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
135
136 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
137
138         * decl.c (record_builtin_java_type): Use canonicalized integer
139         types.
140
141 2009-03-04  Jason Merrill  <jason@redhat.com>
142
143         PR c++/38908
144         * class.c (is_really_empty_class): New fn.
145         * cp-tree.h: Declare it.
146         * cp-objcp-common.c (cp_expr_size): Use it.
147
148         PR c++/13549
149         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
150         * parser.c (cp_parser_postfix_expression): Call it for 
151         TEMPLATE_ID_EXPR.
152         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
153         (get_first_fn): Likewise.
154
155         PR c++/9634
156         PR c++/29469
157         PR c++/29607
158         Implement DR 224.
159         * decl.c (make_typename_type): Do look inside currently open classes.
160         * parser.c (cp_parser_lookup_name): Likewise.
161         (cp_parser_template_name): Likewise.
162         * pt.c (dependent_scope_p): New function.
163         * cp-tree.h: Declare it.
164         * class.c (currently_open_class): Return fast if T isn't a class.
165
166 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
167
168         PR c++/37789
169         * parser.c (cp_parser_mem_initializer): Return error_mark_node
170         if cp_parser_mem_initializer_id returns error_mark_node.
171
172 2009-02-24  Richard Guenther  <rguenther@suse.de>
173
174         PR c++/39242
175         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
176         declared functions.
177
178 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
179
180         PR c++/36411
181         * pt.c (coerce_template_template_parms): Return 0 if parameter
182         is error_mark_node.
183
184 2009-02-23  Jason Merrill  <jason@redhat.com>
185
186         * pt.c (unify): Call maybe_adjust_types_for_deduction when
187         deducing from an initializer list.
188
189 2009-02-20  Jason Merrill  <jason@redhat.com>
190
191         PR c++/39225
192         * decl.c (grokdeclarator): Handle ~identifier.
193
194 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
195
196         PR target/39175
197         * decl2.c (determine_visibility): If visibility changed and
198         DECL_RTL has been already set, call make_decl_rtl to update symbol
199         flags.
200
201 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
202
203         PR c++/39188
204         * cp-tree.h (maybe_commonize_var): New.
205
206         * decl.c (maybe_commonize_var): Make it extern.
207
208         * decl2.c (finish_anon_union): Call maybe_commonize_var.
209
210 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
211
212         PR c++/39219
213         * parser.c (cp_parser_enum_specifier): Apply all attributes.
214
215 2009-02-18  Jason Merrill  <jason@redhat.com>
216
217         * cfns.h: Tweak pathname for cfns.gperf.
218
219 2009-02-13  Jason Merrill  <jason@redhat.com>
220
221         PR c++/39070
222         * semantics.c (finish_call_expr): Change koenig_p parm to int.
223         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
224         * cp-tree.h: Adjust prototype.
225         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
226
227 2009-02-12  Jason Merrill  <jason@redhat.com>
228
229         PR c++/38950
230         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
231
232 2009-02-11  Jason Merrill  <jason@redhat.com>
233
234         PR c++/39153
235         * decl2.c (cp_write_global_declarations): 
236         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
237
238         PR c++/30111
239         * init.c (build_value_init_noctor): Split out from...
240         (build_value_init): ...here.
241         (expand_aggr_init_1): Handle value-initialization.
242         * cp-tree.h: Add declaration.
243         * class.c (type_has_user_provided_constructor): 
244         Handle non-class arguments.
245
246 2009-02-10  Jason Merrill  <jason@redhat.com>
247
248         PR c++/38649
249         * class.c (defaultable_fn_p): Handle ... properly.
250
251         PR c++/36744
252         * tree.c (lvalue_p_1): Condition rvalue ref handling on
253         treat_class_rvalues_as_lvalues, too.
254
255 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
256
257         PR c++/34397
258         * typeck.c (build_x_array_ref): New.
259         * cp-tree.h: Declare it.
260         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
261
262 2009-02-09  Jason Merrill  <jason@redhat.com>
263
264         PR c++/39109
265         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
266         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
267         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
268         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
269         for build_value_init TARGET_EXPR.
270         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
271
272 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
273
274         PR c++/35147
275         PR c++/37737
276         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
277
278 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
279
280         PR c++/39095
281         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
282         remove ./dt operator.
283         * mangle.c (write_expression): Handle COMPONENT_REF after handling
284         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
285         write_string ("dt") instead of using operators.def.
286
287 2009-02-03  Jason Merrill  <jason@redhat.com>
288
289         * typeck.c (cp_build_unary_op): Only complain about taking address
290         of main if pedantic.
291
292 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
293
294         PR inline-asm/39059
295         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
296
297         PR c++/39056
298         * typeck2.c (digest_init_r): Don't call process_init_constructor
299         for COMPLEX_TYPE.
300
301 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
302
303         PR c++/36897
304         * pt.c (convert_nontype_argument_function): Expect expr to be an
305         ADDR_EXPR.
306
307         PR c++/37314
308         * typeck.c (merge_types): Call resolve_typename_type if only
309         one type is a typename.
310
311 2009-02-02  Jason Merrill  <jason@redhat.com>
312
313         PR c++/39054
314         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
315         in BIT_NOT_EXPR.
316
317 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
318
319         PR c++/39053
320         * parser.c (cp_parser_pure_specifier): If there are no tokens left
321         do not call cp_lexer_consume_token.
322
323 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
324
325         PR c++/39028
326         * parser.c (cp_parser_already_scoped_statement): Handle __label__
327         declarations.
328
329 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
330
331         PR c++/33465
332         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
333
334 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
335
336         PR c++/38655
337         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
338
339 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
340
341         * typeck.c (invalid_nonstatic_memfn_p): Use
342         DECL_NONSTATIC_MEMBER_FUNCTION_P.
343
344 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
345
346         PR c++/37554
347         * call.c (build_over_call): If convert_for_arg_passing returns
348         error_mark_node unconditionally return it.
349
350 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
351
352         * class.c (check_field_decls): Also inherit packed for bitfields
353         regardless of their type.
354
355 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
356
357         PR c++/38930
358         * decl2.c (grokfield): Reverting changes of PR c++/26693
359         (save_template_attributes): Likewise.
360         * decl.c (grokdeclarator): Likewise.
361         * name-lookup.c (pushdecl_maybe_friend): Likewise.
362         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
363         (append_type_to_template_for_access_check): Likewise.
364         * semantics.c (check_accessibility_of_qualified_id): Likewise.
365         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
366         (tsubst): Likewise.
367         (resolve_type_name_type): Likewise.
368         (append_type_to_template_for_access_check): Likewise.
369
370 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
371
372         PR c++/26693
373         * decl2.c (grokfield): when a typedef appears in a
374         class, create the typedef variant type node for it.
375         (save_template_attributes): Creating typedef variant type node
376          here is now useless.
377         * decl.c (grokdeclarator): If the typedef'ed struct/class was
378         anonymous, set the proper type name to all its type variants.
379         * name-lookup.c (pushdecl_maybe_friend): Reuse the
380         set_underlying_type function to install typedef variant types.
381         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
382         macro.
383         (append_type_to_template_for_access_check): New entry points.
384         * semantics.c (check_accessibility_of_qualified_id):
385         When a typedef that is a member of a class appears in a template,
386         add it to the template. It will be ...
387         * pt.c (instantiate_class_template, instantiate_template ): ... access
388         checked at template instantiation time.
389         (tsubst): Handle the case of being called with NULL args.
390         (resolve_type_name_type): The type name should be the name of the
391         main type variant.
392         (append_type_to_template_for_access_check): New entry point.
393
394 2009-01-19  Jason Merrill  <jason@redhat.com>
395
396         PR c++/23287
397         * parser.c (cp_parser_unqualified_id): In a template,
398         accept ~identifier.
399         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
400
401 2009-01-16  Jason Merrill  <jason@redhat.com>
402
403         PR c++/38877
404         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
405         * init.c (build_new): Don't call describable_type unless we
406         have an auto.
407
408         PR c++/29470
409         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
410
411         PR c++/38579
412         * search.c (protected_accessible_p): N doesn't vary.
413
414 2009-01-15  Jason Merrill  <jason@redhat.com>
415
416         PR c++/38850
417         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
418         accept hidden friends.
419
420 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
421
422         PR C++/29388
423         * decl.c (grokdeclarator): Check for a non namespace/class context.
424
425 2009-01-15  Jason Merrill  <jason@redhat.com>
426
427         PR c++/36334
428         PR c++/37646
429         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
430         a function isn't necessarily an lvalue. Take tree, not const_tree.
431         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
432         * typeck.c (lvalue_or_else): Likewise.
433         * cp-tree.h: Adjust prototypes.
434
435 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
436
437         PR c++/38357
438         * pt.c (tsubst): Check for NULL args.
439
440 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
441
442         PR c++/38636
443         * name-lookup.c (pushtag): Don't create members to types that are not
444         being created.
445
446 2009-01-14  Nick Clifton  <nickc@redhat.com>
447
448         PR c++/37862
449         * parser.c: Pass cp_id_kind computed in
450         cp_parser_postfix_dot_deref_expression to
451         cp_parser_primary_expression.
452
453 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
454
455         PR c++/38795
456         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
457         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
458         as CAST_EXPR.
459
460 2009-01-12  Jason Merrill  <jason@redhat.com>
461             Steve Ellcey  <sje@cup.hp.com>
462
463         PR c++/35109
464         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
465         binding.
466
467 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
468
469         PR c++/36019
470         * pt.c (parameter_of_template_p): New function.
471         * cp-tree.h: Declare it.
472         * name-lookup.c (binding_to_template_parms_of_scope_p): New
473         function.
474         (outer_binding): Take template parameters in account when looking for
475         a name binding.
476
477 2009-01-12  Jason Merrill  <jason@redhat.com>
478
479         PR c++/31488
480         * tree.c (pod_type_p): Return 1 for structs created by the back end.
481
482 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
483
484         PR c/32041
485         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
486         offsetof member-designator, handle it as `[0].'.
487
488         PR c++/38794
489         * decl.c (start_function): If grokdeclarator hasn't returned
490         FUNCTION_DECL nor error_mark_node, issue diagnostics.
491
492 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
493
494         PR c++/36254
495         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
496         (gimplify_if_stmt): ... this.
497         (cp_gimplify_expr): Don't handle IF_STMT here.
498         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
499
500 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
501
502         PR c++/38648
503         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
504
505         PR c++/36695
506         * typeck2.c (build_functional_cast): Check for reference type and NULL
507         PARMS.
508
509 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
510
511         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
512
513 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
514
515         PR c++/35335
516         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
517
518 2009-01-09  John F. Carr  <jfc@mit.edu>
519
520         PR c++/37877
521         * parser.c (cp_parser_class_specifier): Clear
522         parser->in_unbraced_linkage_specification_p while parsing class
523         specifiers.
524
525 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
526
527         PR c++/38725
528         * semantics.c (finish_goto_stmt): Convert destination to
529         void *.
530
531 2009-01-06  Jason Merrill  <jason@redhat.com>
532
533         PR c++/35297
534         PR c++/35477
535         PR c++/35784
536         PR c++/36846
537         PR c++/38276
538         * pt.c (check_default_tmpl_args): Don't complain about
539         out-of-order parameter packs in the enclosing class
540         or parameter packs after default args.
541         (coerce_template_parms): If we have more than one
542         parameter pack, don't flatten argument packs.
543         (template_args_equal): Handle argument packs.
544         (comp_template_args): Don't flatten argument packs.
545         (check_instantiated_arg): Split out from...
546         (check_instantiated_args): Here.  Handle arg packs.
547         (convert_template_argument): Just check that nontype argument
548         packs have the right type.
549
550 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
551
552         PR c++/38472
553         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
554
555 2009-01-05  Jason Merrill  <jason@redhat.com>
556
557         PR c++/38698
558         * typeck2.c (process_init_constructor_union): Handle union with
559         no fields.
560
561         * mangle.c (write_expression): Remove mangling for zero-operand
562         casts.
563
564         PR c++/38701
565         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
566         defaulting.
567
568         PR c++/38702
569         * class.c (defaultable_fn_p): Only operator== can be a copy
570         assignment operator.
571
572 2009-01-02  Jason Merrill  <jason@redhat.com>
573
574         PR c++/38698
575         * typeck2.c (process_init_constructor_union): Handle excess
576         initializers.
577         (process_init_constructor_record): Likewise.
578
579         PR c++/38684
580         * typeck2.c (digest_init_r): Don't use process_init_constructor
581         for non-aggregate classes.