OSDN Git Service

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