OSDN Git Service

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