1 2010-03-26 Dodji Seketeli <dodji@redhat.com>
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
8 (unify): Handle VAR_DECLs.
10 2010-03-26 Dodji Seketeli <dodji@redhat.com>
12 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
14 * pt.c (get_template_parms_at_level): Adjust.
16 2010-03-25 Dodji Seketeli <dodji@redhat.com>
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
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
29 2010-03-24 Jason Merrill <jason@redhat.com>
32 * parser.c (make_declarator): Initialize id_loc.
33 (cp_parser_lambda_declarator_opt): And set it.
35 2010-03-23 Jason Merrill <jason@redhat.com>
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().
49 * decl2.c (change_return_type): Fix 'this' quals.
51 2010-03-22 Jason Merrill <jason@redhat.com>
54 * tree.c (pod_type_p): Use old meaning in C++98 mode.
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.
61 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
64 * decl2.c (grokfield): Handle invalid initializers for member
67 2010-03-20 Dodji Seketeli <dodji@redhat.com>
70 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
72 * decl2.c (vague_linkage_p): Likewise.
74 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
77 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
78 false, in the cp_parser_expression_statement call.
80 2010-03-05 Jason Merrill <jason@redhat.com>
82 * mangle.c (mangle_decl): Give name collision error even without
85 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
87 * pt.c (process_partial_specialization): Use error_n instead of
90 2010-03-03 Jason Merrill <jason@redhat.com>
93 * mangle.c (mangle_decl): Handle VAR_DECL, too.
95 2010-03-03 Jason Merrill <jason@redhat.com>
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.
109 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
111 * pt.c (redeclare_class_template): Use error_n and inform_n.
113 2010-02-27 Mark Mitchell <mark@codesourcery.com>
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.
123 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
126 * pt.c (redeclare_class_template): Return false if there are erroneous
129 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
131 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
134 2010-02-24 Jason Merrill <jason@redhat.com>
137 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
139 * class.c (layout_class_type): Don't give -Wabi warning for a bug
140 in a previous ABI version.
142 2010-02-23 Jason Merrill <jason@redhat.com>
145 * typeck2.c (digest_init_r): Accept value init of array.
147 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
150 * typeck.c (convert_arguments): Update error message.
152 2010-02-22 Mike Stump <mikestump@comcast.net>
155 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
157 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
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.
164 2010-02-21 Dodji Seketeli <dodji@redhat.com>
167 * pt.c (lookup_template_class): Better support of specialization
168 of member of class template implicit instantiation.
170 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
173 * call.c (conversion_null_warnings): Replace -Wconversion with
175 * cvt.c (build_expr_type_conversion): Likewise.
177 2010-02-18 Jason Merrill <jason@redhat.com>
180 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
183 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
185 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
186 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
189 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
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.
198 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
200 2010-02-17 Jason Merrill <jason@redhat.com>
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.
209 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
210 decl we looked up doesn't match.
213 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
214 have an INIT_EXPR anymore.
217 * pt.c (convert_nontype_argument): Change assert to test.
219 2010-02-16 Jason Merrill <jason@redhat.com>
221 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
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.
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.
233 2010-02-14 Jason Merrill <jason@redhat.com>
236 * semantics.c (finish_compound_literal): Use
237 cp_apply_type_quals_to_decl when creating a static variable.
239 2010-02-12 Jason Merrill <jason@redhat.com>
242 * name-lookup.h (current_binding_level): Check for null
245 2010-02-12 Jason Merrill <jason@redhat.com>
248 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
250 2010-02-12 Jakub Jelinek <jakub@redhat.com>
253 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
256 2010-02-10 Jason Merrill <jason@redhat.com>
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.
266 2010-02-10 Jason Merrill <jason@redhat.com>
269 * semantics.c (outer_lambda_capture_p): Use current_function_decl
270 instead of current_class_type.
272 2010-02-10 Jason Merrill <jason@redhat.com>
274 PR c++/42983, core issue 906
275 * method.c (defaultable_fn_check): Check virtualness.
277 2010-02-10 Jason Merrill <jason@redhat.com>
280 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
282 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
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
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.
295 2010-02-09 Jason Merrill <jason@redhat.com>
298 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
300 2010-02-09 Jason Merrill <jason@redhat.com>
303 * decl2.c (change_return_type): New fn.
304 * semantics.c (apply_lambda_return_type): Use it.
305 * cp-tree.h: Declare it.
307 2010-02-05 Richard Guenther <rguenther@suse.de>
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.
313 2010-02-05 Dodji Seketeli <dodji@redhat.com>
316 * typeck.c (get_template_parms_of_dependent_type): Try getting
317 the template parameters fromt the type itself first.
319 2010-02-03 Jason Merrill <jason@redhat.com>
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.
330 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
333 2010-02-02 Jason Merrill <jason@redhat.com>
336 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
337 * optimize.c (clone_body): Remap their initializers when making base
339 (maybe_clone_body): Complain if multiple clones aren't safe.
341 2010-01-29 Dodji Seketeli <dodji@redhat.com>
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.
367 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
369 * decl.c (redeclaration_error_message): Wrap the return messages into
370 G_() for easy translation.
372 2010-01-28 Jason Merrill <jason@redhat.com>
375 * semantics.c (begin_class_definition): Don't use type_as_string.
377 2010-01-28 Dodji Seketeli <dodji@redhat.com>
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.
390 2010-01-20 Janis Johnson <janis187@us.ibm.com>
391 Jason Merrill <jason@redhat.com>
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.
397 2010-01-20 Jason Merrill <jason@redhat.com>
400 * mangle.c (write_expression): Handle tree codes that have extra
401 arguments in the middle-end.
403 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
406 * except.c (expand_start_catch_block): Deal correctly with
407 do_begin_catch returning error_mark_node.
409 2010-01-20 Jason Merrill <jason@redhat.com>
412 * class.c (layout_class_type): Set packed_maybe_necessary for packed
416 * semantics.c (build_lambda_object): Call mark_used on captured
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.
424 2010-01-20 Jakub Jelinek <jakub@redhat.com>
426 * decl.c (create_array_type_for_decl): Remove set but not used
427 variable error_msg. Remove break stmts after return stmts.
429 2010-01-19 Dodji Seketeli <dodji@redhat.com>
431 * error.c (dump_template_parms, count_non_default_template_args):
432 Revert fix of PR c++/42634.
434 2010-01-18 Dodji Seketeli <dodji@redhat.com>
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
443 2010-01-18 Dodji Seketeli <dodji@redhat.com>
446 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
448 2010-01-17 Dodji Seketeli <dodji@redhat.com>
451 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
453 2010-01-17 Dodji Seketeli <dodji@redhat.com>
456 *pt.c (tsubst_decl): Get the arguments of a specialization from
457 the specialization template, not from the most general template.
459 2010-01-16 Jason Merrill <jason@redhat.com>
462 * semantics.c (finish_decltype_type): Within a template, treat
463 unresolved CALL_EXPR as dependent.
465 2010-01-15 Dodji Seketeli <dodji@redhat.com>
467 * error.c (dump_template_parms,count_non_default_template_args):
468 Revert changes of PR c++/42634.
470 2010-01-14 Jakub Jelinek <jakub@redhat.com>
473 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
474 functions with noreturn attribute.
476 2010-01-14 Jason Merrill <jason@redhat.com>
479 * call.c (build_new_method_call): Don't free the vec here.
482 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
484 2010-01-13 Dodji Seketeli <dodji@redhat.com>
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
493 2010-01-07 Dodji Seketeli <dodji@redhat.com>
496 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
497 arguments that were previously deduced.
499 2010-01-05 Jason Merrill <jason@redhat.com>
501 * pt.c (unify_pack_expansion): Handle deduction from init-list.
502 * call.c (build_over_call): Don't complain about it.
504 2010-01-04 Jason Merrill <jason@redhat.com>
507 * pt.c (tsubst_decl): Don't apply type attributes in place.
510 * semantics.c (describable_type): Remove decltype comment and
515 Copyright (C) 2010 Free Software Foundation, Inc.
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.