OSDN Git Service

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