OSDN Git Service

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