1 2012-03-21 Jason Merrill <jason@redhat.com>
3 Implement return type deduction for normal functions with -std=c++1y.
4 * cp-tree.h (FNDECL_USED_AUTO): New macro.
5 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
6 (dependent_lambda_return_type_node): Remove.
7 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
8 (struct language_function): Add x_auto_return_pattern field.
9 (current_function_auto_return_pattern): New.
10 (enum tsubst_flags): Add tf_partial.
11 * decl.c (decls_match): Handle auto return comparison.
12 (duplicate_decls): Adjust error message for auto return.
13 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
14 (cp_finish_decl): Don't do auto deduction for functions.
15 (grokdeclarator): Allow auto return without trailing return type in
17 (check_function_type): Defer checking of deduced return type.
18 (start_preparsed_function): Set current_function_auto_return_pattern.
19 (finish_function): Set deduced return type to void if not previously
21 * decl2.c (change_return_type): Handle error_mark_node.
22 (mark_used): Always instantiate functions with deduced return type.
23 Complain about use if deduction isn't done.
24 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
26 (cp_parser_lambda_body): Don't deduce return type in a template.
27 (cp_parser_conversion_type_id): Allow auto in C++1y.
28 * pt.c (instantiate_class_template_1): Don't mess with
29 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
30 (tsubst_copy_and_build): Likewise.
31 (fn_type_unification, tsubst): Don't reduce the template parm level
32 of 'auto' during deduction.
33 (unify): Compare 'auto' specially.
34 (get_bindings): Change test.
35 (always_instantiate_p): Always instantiate functions with deduced
37 (do_auto_deduction): Handle error_mark_node and lambda context.
38 Don't check for use in initializer.
39 (contains_auto_r): Remove.
40 * search.c (lookup_conversions_r): Handle auto conversion function.
41 * semantics.c (lambda_return_type): Handle null return. Don't mess
42 with dependent_lambda_return_type_node.
43 (apply_deduced_return_type): Rename from apply_lambda_return_type.
44 * typeck.c (merge_types): Handle auto.
45 (check_return_expr): Do auto deduction.
46 * typeck2.c (add_exception_specifier): Fix complain check.
48 2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
51 * class.c (check_field_decls): Call literal_type_p only
54 2012-03-22 Jakub Jelinek <jakub@redhat.com>
57 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
58 on CLASS_TYPE_P types.
60 2012-03-20 Jason Merrill <jason@redhat.com>
62 * lex.c (init_reswords): Use >= for cxx_dialect test.
63 * parser.c (cp_parser_exception_specification_opt): Likewise.
65 * mangle.c (write_type): Handle 'auto'.
66 * init.c (build_new): Don't do auto deduction where it might
67 affect template mangling.
70 * decl.c (reshape_init_class): Handle repeated reshaping.
71 * search.c (lookup_field_1): Add sanity check.
73 2012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
76 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
77 * tree.c (xvalue_p): Define.
78 * typeck.c (maybe_warn_about_useless_cast): Define.
79 (build_reinterpret_cast, build_const_cast,
80 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
81 * rtti.c (build_dynamic_cast): Likewise.
82 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
83 c_inhibit_evaluation_warnings before/after the build_* calls.
85 2012-03-15 Jason Merrill <jason@redhat.com>
88 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
90 2012-03-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
93 * error.c (print_instantiation_partial_context): Use
94 template_backtrace_limit.
96 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
98 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
100 2012-03-14 Jakub Jelinek <jakub@redhat.com>
103 * parser.c (lookup_literal_operator): Return fn only if
104 processed all arguments from args vector and argtypes is
107 2012-01-30 Dodji Seketeli <dodji@redhat.com>
110 * cp-tree.h (template_type_parameter_p): Declare new function.
111 (parameter_of_template_p): Remove.
112 * pt.c (template_type_parameter_p): Define new function.
113 (parameter_of_template_p): Remove.
114 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
115 on parameter_of_template_p anymore. Compare the level of the
116 template parameter to the depth of the template.
118 2011-12-15 Dodji Seketeli <dodji@redhat.com>
120 * call.c (standard_conversion, build_integral_nontype_arg_conv)
121 (build_new_op_1, convert_like_real, is_subseq)
122 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
123 (joust): Use next_conversion instead of accessing fields of struct
126 2012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
129 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
130 division by zero warnings.
132 2012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
134 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
135 build_ptrmemfunc): Consistently forward the tsubst_flags_t
137 * call.c (resolve_args): Likewise.
139 2012-03-07 Jason Merrill <jason@redhat.com>
142 * mangle.c (write_literal_operator_name): The length comes after the
145 2012-03-05 Jakub Jelinek <jakub@redhat.com>
147 * pt.c (local_specializations): Change from htab_t into
148 struct pointer_map_t *.
149 (retrieve_local_specializations, register_local_specialization,
150 tsubst_pack_expansion, instantiate_decl): Adjust users.
151 (eq_local_specializations, hash_local_specialization): Remove.
153 2012-03-05 Jason Merrill <jason@redhat.com>
156 * decl2.c (determine_visibility): Correct calculation of class
158 * decl.c (check_tag_decl): Adjust warning.
160 * method.c (synthesized_method_walk): Cleanups don't affect the EH
163 2012-03-03 Jason Merrill <jason@redhat.com>
165 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
168 * call.c (build_aggr_conv): Call reshape_init.
169 (convert_like_real): Likewise.
170 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
173 * mangle.c (write_nested_name): Use decl_mangling_context.
174 (write_prefix, write_template_prefix): Likewise.
177 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
179 * class.c (add_method): Always build an OVERLOAD for using-decls.
180 * search.c (lookup_member): Handle getting an OVERLOAD for a
183 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
186 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
188 * cp-tree.h (build_x_arrow): Adjust prototype.
189 * pt.c (tsubst_copy_and_build): Adjust call.
190 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
192 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
194 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
196 2012-02-29 Jason Merrill <jason@redhat.com>
199 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
200 (shadow_tag): From here.
201 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
203 2012-02-21 Jakub Jelinek <jakub@redhat.com>
206 * typeck.c (check_literal_operator_args): Initialize *long_double_p
207 and *long_long_unsigned_p even if processing_template_decl.
209 2012-02-16 Jason Merrill <jason@redhat.com>
212 * decl.c (define_label): Use timevar_cond_start/stop.
214 2012-02-16 Fabien Chêne <fabien@gcc.gnu.org>
217 * decl.c (xref_basetypes): call dependent_scope_p instead of
220 2012-02-16 Jason Merrill <jason@redhat.com>
223 * error.c (dump_expr): Handle lambda closures specifically.
225 2012-02-14 Jason Merrill <jason@redhat.com>
227 * parser.c (cp_parser_explicit_instantiation): Give a warning
228 for ignored attributes on explicit class instantiation.
230 2012-02-14 Jakub Jelinek <jakub@redhat.com>
233 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
234 lookup_label on label's name and set TREE_USED.
236 2012-02-14 Jason Merrill <jason@redhat.com>
239 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
241 2012-02-14 Jakub Jelinek <jakub@redhat.com>
244 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
245 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
247 2012-02-07 Jason Merrill <jason@redhat.com>
250 * semantics.c (cx_check_missing_mem_inits): Handle unions.
251 Fix constexpr default constructor logic.
254 * pt.c (tsubst): Strip uninstantiated typedef.
256 2012-02-06 Jason Merrill <jason@redhat.com>
259 * cvt.c (build_expr_type_conversion): Check for template conversion.
261 2012-01-31 Jason Merrill <jason@redhat.com>
264 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
265 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
266 (tsubst_pack_expansion): Check it.
268 2012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
271 * class.c (explain_non_literal_class): Correctly handle implicitly
272 deleted constructors.
274 2012-01-27 Jakub Jelinek <jakub@redhat.com>
277 * pt.c (tsubst_pack_expansion): Delete and restore
278 local_specialization whenever need_local_specialization, not just
279 when saved_local_specializations is non-NULL.
281 2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
284 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
285 as TREE_OPERAND (t, 1).
287 2012-01-24 Jason Merrill <jason@redhat.com>
290 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
293 * tree.c (called_fns_equal): Check template args.
294 (cp_tree_equal): Call it.
296 2012-01-24 Aldy Hernandez <aldyh@redhat.com>
297 Patrick Marlier <patrick.marlier@gmail.com>
300 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
301 thunk for set_one_vmethod_tm_attributes.
303 2012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
306 * call.c (build_over_call): Check for error_mark_node as
307 TREE_VALUE when default arguments are processed.
309 2012-01-23 Jason Merrill <jason@redhat.com>
312 * decl2.c (determine_visibility): Check for visibility attribute
313 on template specialization.
315 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
318 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
320 2012-01-23 Jason Merrill <jason@redhat.com>
323 * class.c (add_method): Set OVL_USED for using-decls.
324 * tree.c (ovl_scope): New.
325 * cp-tree.h: Declare it.
326 * parser.c (cp_parser_template_name): Use it.
327 * semantics.c (baselink_for_fns): Likewise.
328 * name-lookup.c (set_inherited_value_binding_p): Likewise.
330 2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
333 * pt.c (lookup_template_class_1): Check context returned by
334 tsubst for error_mark_node.
336 2012-01-19 Kai Tietz <ktietz@redhat.com>
339 * decl2.c (save_template_attributes): Use merge_attributes
340 instead of chaining up via TREE_CHAIN.
342 2012-01-19 Jason Merrill <jason@redhat.com>
345 * class.c (finish_struct): Call add_method here for function usings.
346 * semantics.c (finish_member_declaration): Not here.
348 2012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
351 * typeck2.c (store_init_value): Within a template guard
352 cxx_constant_value with require_potential_constant_expression.
353 * pt.c (convert_nontype_argument): Likewise.
355 2012-01-16 Jakub Jelinek <jakub@redhat.com>
358 * mangle.c (write_template_arg_literal): Handle complex.
360 2012-01-16 Jason Merrill <jason@redhat.com>
363 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
366 * typeck.c (build_static_cast_1): Handle bit-fields properly.
368 2012-01-13 Ian Lance Taylor <iant@google.com>
371 * typeck.c (enum_cast_to_int): New static function.
372 (cp_build_binary_op): When handling warn_sign_compare, don't test
373 for TREE_NO_WARNING. Do call enum_cast_to_int.
374 * call.c (avoid_sign_compare_warnings): Remove static function.
375 (build_new_op_1): Don't call avoid_sign_compare_warnings.
377 2012-01-13 Steven Bosscher <steven@gcc.gnu.org>
379 * decl2.c: Do not include tree-mudflap.h
380 * semantics.c: Likewise.
382 2012-01-13 Jason Merrill <jason@redhat.com>
385 * semantics.c (finish_break_stmt): Avoid adding an unreachable
389 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
390 when reducing the visibility.
393 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
395 2012-01-12 Jason Merrill <jason@redhat.com>
398 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
401 2012-01-13 Dodji Seketeli <dodji@redhat.com>
404 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
405 Set the pointer to the last block of the constructor to the
407 (build_constexpr_constructor_member_initializers): Get
408 build_data_member_initialization a chance to deal with more
409 statements before we choke.
411 2012-01-12 Jason Merrill <jason@redhat.com>
414 * mangle.c (write_expression): Mangle BASELINK scope if
415 BASELINK_QUALIFIED_P.
416 * search.c (adjust_result_of_qualified_name_lookup): Set
417 BASELINK_QUALIFIED_P.
418 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
419 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
420 adjust_result_of_qualified_name_lookup for non-qualified names.
423 * pt.c (unify): Handle error_mark_node.
425 2012-01-11 Jason Merrill <jason@redhat.com>
428 * call.c (standard_conversion): For ptrmemfuncs, compare the
432 * mangle.c (find_substitution): A type is only a substitution
433 match if we're looking for a type.
434 (write_nested_name): Use decl_mangling_context.
436 * decl.c (decls_match): Assert that the arguments are decls.
439 * pt.c (resolve_overloaded_unification): Compare types with
440 same_type_p, not decls_match.
442 2012-01-10 Jason Merrill <jason@redhat.com>
445 * class.c (build_base_path): Diagnose ambiguous base.
448 * semantics.c (cxx_eval_call_expression): Always retry previously
449 non-constant expressions.
451 2012-01-06 Jason Merrill <jason@redhat.com>
455 * parser.c (cp_parser_new_expression): Set
456 type_definition_forbidden_message.
462 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
463 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
465 (write_template_arg): Fix mangling of class-scope functions and
467 (mangle_decl): Update suggested -fabi-version argument.
468 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
469 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
470 * tree.c (dependent_name): No longer static.
471 * cp-tree.h: Declare it.
472 * pt.c (unify): Defer handling of unconverted functions.
474 * mangle.c (mangle_decl): Don't generate mangling aliases
475 for maybe-in-charge [cd]tors.
477 * error.c (dump_expr): Print type of CONSTRUCTOR.
479 2012-01-05 Dodji Seketeli <dodji@redhat.com>
482 * parser.c (cp_parser_alias_declaration): Get out early upon
483 errors in the identifier or the attributes.
485 2012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
488 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
489 the tree returned by build_x_binary_op.
491 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
494 * parser.c (cp_parser_postfix_open_square_expression): Handle
495 postfix-expression [ braced-init-list ].
497 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
500 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
501 call decay_conversion on v.
503 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
506 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
507 declaration followed by specialization.
509 2012-01-03 Jakub Jelinek <jakub@redhat.com>
512 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
513 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
515 2012-01-02 Jason Merrill <jason@redhat.com>
519 * method.c (walk_field_subobs): Don't check for uninitialized
521 (synthesized_method_walk): Check here.
525 * parser.c (cp_parser_cache_defarg): Split out...
526 (cp_parser_parameter_declaration): ...from here.
527 (cp_parser_save_nsdmi): Use it.
528 (cp_parser_cache_group): Remove CPP_COMMA support.
530 2012-01-02 Dodji Seketeli <dodji@redhat.com>
533 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
536 2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
539 * typeck2.c (digest_init_r): Use copy_init when initializing
542 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
545 * decl.c (build_enumerator): Don't call perform_integral_promotions
548 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
551 * typeck.c (build_reinterpret_cast_1): Implement resolution of
554 2012-01-01 Fabien Chêne <fabien@gcc.gnu.org>
556 * parser.c (cp_parser_using_declaration): Add a warning about
557 deprecated access declarations when no errors were encountered
558 while parsing the access declaration. Save the first token in
559 order to emit the warning at the right place.
561 Copyright (C) 2012 Free Software Foundation, Inc.
563 Copying and distribution of this file, with or without modification,
564 are permitted in any medium without royalty provided the copyright
565 notice and this notice are preserved.