OSDN Git Service

81e97724d56d81dd6c9d015ce2259ec4b63c0672
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
2
3         PR c++/43327
4         * pt.c (add_to_template_args): Support NULL ARGS;
5         (most_specialized_class): call coerce_template_parms on
6         template arguments passed to get_class_bindings. Use
7         add_to_template_args.
8         (unify): Handle VAR_DECLs.
9
10 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
11
12         * cp-tree.h (get_template_parms_at_level): Change unsigned parm
13         into int.
14         * pt.c (get_template_parms_at_level): Adjust.
15
16 2010-03-25  Dodji Seketeli  <dodji@redhat.com>
17
18         PR c++/43206
19         * cp-tree.h (get_template_parms_at_level): Declare ...
20         * pt.c (get_template_parms_at_level): ... new function.
21         * typeck.c (get_template_parms_of_dependent_type): If a template
22         type parm's DECL_CONTEXT isn't yet set, get its siblings from
23         current_template_parms. Use get_template_parms_at_level. Remove
24         useless test.
25         (incompatible_dependent_types_p): If we get empty parms from just one
26         of the template type parms we are comparing then the template parms are
27         incompatible.
28
29 2010-03-24  Jason Merrill  <jason@redhat.com>
30
31         PR c++/43502
32         * parser.c (make_declarator): Initialize id_loc.
33         (cp_parser_lambda_declarator_opt): And set it.
34
35 2010-03-23  Jason Merrill  <jason@redhat.com>
36
37         Make lambda conversion op and op() non-static.
38         * semantics.c (maybe_add_lambda_conv_op): Make non-static.
39         Also add the thunk function returned by the conversion op.
40         Mark the conversion deleted if the op() is variadic.
41         * decl2.c (mark_used): Give helpful message about deleted conversion.
42         * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
43         * semantics.c (finish_this_expr): Adjust.
44         * mangle.c (write_closure_type_name): Adjust.
45         * decl.c (grok_op_properties): Don't allow it.
46         * call.c (build_user_type_conversion_1): No static conversion ops.
47         (build_op_call): Or op().
48
49         * decl2.c (change_return_type): Fix 'this' quals.
50
51 2010-03-22  Jason Merrill  <jason@redhat.com>
52
53         PR c++/43333
54         * tree.c (pod_type_p): Use old meaning in C++98 mode.
55
56         PR c++/43281
57         * pt.c (contains_auto_r): New fn.
58         (do_auto_deduction): Use it.
59         (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
60
61 2010-03-20  Simon Martin  <simartin@users.sourceforge.net>
62
63         PR c++/43081:
64         * decl2.c (grokfield): Handle invalid initializers for member
65         functions.
66
67 2010-03-20  Dodji Seketeli  <dodji@redhat.com>
68
69         PR c++/43375
70         * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
71         is NULL.
72         * decl2.c (vague_linkage_p): Likewise.
73
74 2010-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
75
76         PR c++/43418
77         * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
78         false, in the cp_parser_expression_statement call.
79
80 2010-03-05  Jason Merrill  <jason@redhat.com>
81
82         * mangle.c (mangle_decl): Give name collision error even without
83         ASM_OUTPUT_DEF.
84
85 2010-03-04  Marco Poletti  <poletti.marco@gmail.com>
86
87         * pt.c (process_partial_specialization): Use error_n instead of
88         error.
89
90 2010-03-03  Jason Merrill  <jason@redhat.com>
91
92         PR c++/12909
93         * mangle.c (mangle_decl): Handle VAR_DECL, too.
94
95 2010-03-03  Jason Merrill  <jason@redhat.com>
96
97         PR c++/12909
98         * mangle.c: Include cgraph.h.
99         (mangle_decl): If the mangled name will change in a later
100         ABI version, make the later mangled name an alias.
101         * method.c (make_alias_for): Copy DECL_ARGUMENTS.
102         * Make-lang.in (mangle.o): Depend on cgraph.h.
103         * method.c (make_alias_for): Handle VAR_DECL, too.
104         * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
105         * tree.c (no_linkage_check): Adjust.
106         * decl.c (maybe_commonize_var): Adjust.
107         * cp-tree.h: Adjust.
108
109 2010-03-01  Marco Poletti  <poletti.marco@gmail.com>
110
111         * pt.c (redeclare_class_template): Use error_n and inform_n.
112
113 2010-02-27  Mark Mitchell  <mark@codesourcery.com>
114
115         PR c++/42748
116         * cp-tree.h (push_tinst_level): Declare.
117         (pop_tinst_level): Likewise.
118         * pt.c (push_tinst_level): Give it external linkage.
119         (pop_tinst_level): Likewise.
120         * mangle.c (mangle_decl_string): Set the source location to that
121         of the decl while mangling.
122
123 2010-02-27  Simon Martin  <simartin@users.sourceforge.net>
124
125         PR c++/42054
126         * pt.c (redeclare_class_template): Return false if there are erroneous
127         template parameters.
128
129 2010-02-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
130
131         * pt.c (push_tinst_level): Replace -ftemplate-depth- with 
132         -ftemplate-depth=.
133
134 2010-02-24  Jason Merrill  <jason@redhat.com>
135
136         PR c++/12909
137         * mangle.c (write_type): Give -Wabi warning for old vector mangling.
138
139         * class.c (layout_class_type): Don't give -Wabi warning for a bug
140         in a previous ABI version.
141
142 2010-02-23  Jason Merrill  <jason@redhat.com>
143
144         PR c++/43143
145         * typeck2.c (digest_init_r): Accept value init of array.
146
147 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
148
149         PR c++/43126
150         * typeck.c (convert_arguments): Update error message.
151
152 2010-02-22  Mike Stump  <mikestump@comcast.net>
153
154         PR c++/43125
155         * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
156
157 2010-02-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
158
159         PR c++/23510
160         * error.c (print_instantiation_partial_context_line): New.
161         (print_instantiation_partial_context): Print at most 12 contexts,
162         skip the rest with a message.
163
164 2010-02-21  Dodji Seketeli  <dodji@redhat.com>
165
166         PR c++/42824
167         * pt.c (lookup_template_class): Better support of specialization
168         of member of class template implicit instantiation.
169
170 2010-02-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
171
172         PR c++/35669
173         * call.c (conversion_null_warnings): Replace -Wconversion with
174         -Wconversion-null.
175         * cvt.c (build_expr_type_conversion): Likewise.
176
177 2010-02-18  Jason Merrill  <jason@redhat.com>
178
179         PR c++/42837
180         * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
181
182         PR c++/43108
183         * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
184         C build_binary_op.
185         * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
186         * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
187
188         PR c++/43070
189         * semantics.c (finish_goto_stmt): Don't call decay_conversion.
190
191         PR c++/26261
192         PR c++/43101
193         * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
194         (maybe_update_decl_type): New fn.
195         * parser.c (cp_parser_init_declarator): Use it.
196
197         PR c++/43109
198         * semantics.c (begin_class_definition): Don't crash on unnamed ns.
199
200 2010-02-17  Jason Merrill  <jason@redhat.com>
201
202         PR c++/43075
203         * call.c (build_over_call): Don't create zero-sized assignments.
204         * cp-gimplify.c (cp_genericize_r): Don't remove them here.
205         * cp-objcp-common.c (cp_expr_size): Remove.
206         * cp-tree.h: Remove prototype.
207
208         PR c++/43069
209         * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
210         decl we looked up doesn't match.
211
212         PR c++/43093
213         * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
214         have an INIT_EXPR anymore.
215
216         PR c++/43079
217         * pt.c (convert_nontype_argument): Change assert to test.
218
219 2010-02-16  Jason Merrill  <jason@redhat.com>
220
221         * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
222
223         PR c++/43031
224         * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
225         VIEW_CONVERT_EXPR for conversions between structural equality types
226         that the back end can't tell are the same.
227
228         PR c++/43036
229         * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
230         cv-quals from element here.
231         (cp_build_qualified_type_real): Not here.  Preserve typedef name.
232
233 2010-02-14  Jason Merrill  <jason@redhat.com>
234
235         PR c++/41997
236         * semantics.c (finish_compound_literal): Use
237         cp_apply_type_quals_to_decl when creating a static variable.
238
239 2010-02-12  Jason Merrill  <jason@redhat.com>
240
241         PR c++/43024
242         * name-lookup.h (current_binding_level): Check for null
243         cp_function_chain.
244
245 2010-02-12  Jason Merrill  <jason@redhat.com>
246
247         PR c++/43054
248         * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
249
250 2010-02-12  Jakub Jelinek  <jakub@redhat.com>
251
252         PR c++/43033
253         * name-lookup.c (pushdecl_maybe_friend): Check default args of t
254         instead of x.
255
256 2010-02-10  Jason Merrill  <jason@redhat.com>
257
258         PR c++/41896
259         * semantics.c (outer_lambda_capture_p): Revert.
260         (add_capture): Only finish_member_declaration if
261         we're in the lambda class.
262         (register_capture_members): New.
263         * cp-tree.h: Declare it.
264         * parser.c (cp_parser_lambda_expression): Call it.
265
266 2010-02-10  Jason Merrill  <jason@redhat.com>
267
268         PR c++/41896
269         * semantics.c (outer_lambda_capture_p): Use current_function_decl
270         instead of current_class_type.
271
272 2010-02-10  Jason Merrill  <jason@redhat.com>
273
274         PR c++/42983, core issue 906
275         * method.c (defaultable_fn_check): Check virtualness.
276
277 2010-02-10  Jason Merrill  <jason@redhat.com>
278
279         PR c++/43016
280         * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
281
282 2010-02-10  Shujing Zhao  <pearly.zhao@oracle.com>
283
284         * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
285         * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
286         translation.
287         * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
288         (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
289         (cp_parser_parameter_declaration)
290         (cp_parser_exception_specification_opt)
291         (cp_parser_exception_declaration): Likewise.
292         * pt.c (check_default_tmpl_args): Likewise.
293         * search.c (lookup_field_r): Likewise.
294
295 2010-02-09  Jason Merrill  <jason@redhat.com>
296
297         PR c++/42399
298         * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
299
300 2010-02-09  Jason Merrill  <jason@redhat.com>
301
302         PR c++/42370
303         * decl2.c (change_return_type): New fn.
304         * semantics.c (apply_lambda_return_type): Use it.
305         * cp-tree.h: Declare it.
306
307 2010-02-05  Richard Guenther  <rguenther@suse.de>
308
309         * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
310         * cp-lang.c: Include gt-cp-cp-lang.h.
311         * config-lang.in (gtfiles): Add cp/cp-lang.c.
312
313 2010-02-05  Dodji Seketeli  <dodji@redhat.com>
314
315         PR c++/42915
316         * typeck.c (get_template_parms_of_dependent_type): Try getting
317         the template parameters fromt the type itself first.
318
319 2010-02-03  Jason Merrill  <jason@redhat.com>
320
321         PR c++/4926
322         PR c++/38600
323         * mangle.c (write_unqualified_id): Split out from write_expression.
324         (write_unqualified_name): Call it.
325         (write_member_name): Likewise.
326         (write_expression): Support TEMPLATE_ID_EXPR.
327         Disambiguate operator names.
328
329         PR c++/12909
330         * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
331         -fabi-version=4.
332
333 2010-02-02  Jason Merrill  <jason@redhat.com>
334
335         PR c++/41090
336         * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
337         * optimize.c (clone_body): Remap their initializers when making base
338         variants.
339         (maybe_clone_body): Complain if multiple clones aren't safe.
340
341 2010-01-29  Dodji Seketeli  <dodji@redhat.com>
342
343         PR c++/42758
344         PR c++/42634
345         PR c++/42336
346         PR c++/42797
347         PR c++/42880
348         * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
349         SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
350         GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
351         * pt.c (coerce_template_parms, type_unification_real,
352         expand_template_argument_pack, coerce_template_parameter_pack):
353         Set the non default template args count.
354         (current_template_args): Always set non defaulted
355         template args count when compiled with --enable-checking
356         (tsubst_template_args, type_unification_real): Propagate the non
357         defaulted template args count.
358         * error.c (get_non_default_template_args_count): Renamed
359         count_non_default_template_args into this. Don't calculate the
360         non default template argument count anymore. Use the new
361         accessor macros above to get it.
362         (dump_template_argument_list, dump_type, dump_decl,
363         dump_template_parms): Adjust.
364         * parser.c (cp_parser_template_argument_list): Always set defaulted
365         template args count when compiled with --enable-checking.
366
367 2010-01-29  Shujing Zhao  <pearly.zhao@oracle.com>
368
369         * decl.c (redeclaration_error_message): Wrap the return messages into
370         G_() for easy translation.
371
372 2010-01-28  Jason Merrill  <jason@redhat.com>
373
374         PR c++/42880
375         * semantics.c (begin_class_definition): Don't use type_as_string.
376
377 2010-01-28  Dodji Seketeli  <dodji@redhat.com>
378
379         PR c++/42713
380         PR c++/42820
381         * typeck.c (get_template_parms_of_dependent_type): Factorized
382         this out of incompatible_template_type_parms_p
383         (incompatible_dependent_types_p): Renamed
384         incompatible_template_type_parms_p into this. Make it detect
385         two incompatible dependent typedefs too.
386         (structural_comptypes): Use incompatible_dependent_types_p.
387         * pt.c (get_template_info):
388         Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
389
390 2010-01-20  Janis Johnson  <janis187@us.ibm.com>
391             Jason Merrill  <jason@redhat.com>
392
393         * mangle.c (write_type): Mangle transparent record as member type.
394         * semantics.c (begin_class_definition): Recognize decimal classes
395         and set TYPE_TRANSPARENT_AGGR.
396
397 2010-01-20  Jason Merrill  <jason@redhat.com>
398
399         PR c++/42338
400         * mangle.c (write_expression): Handle tree codes that have extra
401         arguments in the middle-end.
402
403 2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
404
405         PR c++/42038
406         * except.c (expand_start_catch_block): Deal correctly with
407         do_begin_catch returning error_mark_node.
408
409 2010-01-20  Jason Merrill  <jason@redhat.com>
410
411         PR c++/41788
412         * class.c (layout_class_type): Set packed_maybe_necessary for packed
413         non-PODs.
414
415         PR c++/41920
416         * semantics.c (build_lambda_object): Call mark_used on captured
417         variables.
418
419         PR c++/40750
420         * decl.c (grokdeclarator): Clear type_quals for a member function
421         declared using a typedef.  Don't complain about adding cv-quals
422         to a function typedef in C++0x mode.
423
424 2010-01-20  Jakub Jelinek  <jakub@redhat.com>
425
426         * decl.c (create_array_type_for_decl): Remove set but not used
427         variable error_msg.  Remove break stmts after return stmts.
428
429 2010-01-19  Dodji Seketeli  <dodji@redhat.com>
430
431         * error.c (dump_template_parms, count_non_default_template_args):
432         Revert fix of PR c++/42634.
433
434 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
435
436         PR c++/42634
437         * error.c (dump_template_parms): Use innermost template
438         arguments before calling count_non_default_template_args.
439         (count_non_default_template_args): We are being called with
440         template innermost arguments now. There is no need to ensure
441         that again.
442
443 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
444
445         PR c++/42766
446         * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
447
448 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
449
450         PR c++/42697
451         *pt.c (tsubst_decl):  Revert commit for PR c++/42697.
452
453 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
454
455         PR c++/42697
456         *pt.c (tsubst_decl): Get the arguments of a specialization from
457         the specialization template, not from the most general template.
458
459 2010-01-16  Jason Merrill  <jason@redhat.com>
460
461         PR c++/42761
462         * semantics.c (finish_decltype_type): Within a template, treat
463         unresolved CALL_EXPR as dependent.
464
465 2010-01-15  Dodji Seketeli  <dodji@redhat.com>
466
467         * error.c (dump_template_parms,count_non_default_template_args):
468         Revert changes of PR c++/42634.
469
470 2010-01-14  Jakub Jelinek  <jakub@redhat.com>
471
472         PR middle-end/42674
473         * decl.c (finish_function): Don't emit -Wreturn-type warnings in
474         functions with noreturn attribute.
475
476 2010-01-14  Jason Merrill  <jason@redhat.com>
477
478         PR c++/42701
479         * call.c (build_new_method_call): Don't free the vec here.
480
481         PR c++/42655
482         * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
483
484 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
485
486         PR c++/42634
487         * error.c (dump_template_parms): Use innermost template
488         arguments before calling count_non_default_template_args.
489         (count_non_default_template_args): We are being called with
490         template innermost arguments now. There is no need to ensure
491         that again.
492
493 2010-01-07  Dodji Seketeli  <dodji@redhat.com>
494
495         c++/40155
496         * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
497         arguments that were previously deduced.
498
499 2010-01-05  Jason Merrill  <jason@redhat.com>
500
501         * pt.c (unify_pack_expansion): Handle deduction from init-list.
502         * call.c (build_over_call): Don't complain about it.
503
504 2010-01-04  Jason Merrill  <jason@redhat.com>
505
506         PR c++/42555
507         * pt.c (tsubst_decl): Don't apply type attributes in place.
508
509         PR c++/42567
510         * semantics.c (describable_type): Remove decltype comment and
511         semantics.
512
513
514 \f
515 Copyright (C) 2010 Free Software Foundation, Inc.
516
517 Copying and distribution of this file, with or without modification,
518 are permitted in any medium without royalty provided the copyright
519 notice and this notice are preserved.