OSDN Git Service

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