OSDN Git Service

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