OSDN Git Service

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