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