OSDN Git Service

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