1 2014-10-15 Jason Merrill <jason@redhat.com>
5 * parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
6 committed to this tentative parse.
9 * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
10 (iterative_hash_template_arg): Likewise.
13 * semantics.c (finish_member_declaration): Don't push closure
17 * pt.c (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
18 * semantics.c (finish_id_expression): Don't call TLS wrapper in a
21 2014-08-07 Jason Merrill <jason@redhat.com>
24 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
27 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
29 2014-01-27 Jason Merrill <jason@redhat.com>
33 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
34 list-initialization. A conversion to rvalue ref that involves
35 an lvalue-rvalue conversion is bad.
36 (convert_like_real): Give helpful error message.
38 2014-01-29 Jason Merrill <jason@redhat.com>
41 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
42 have a friend template in a class template.
43 * pt.c (tsubst_friend_function): Look through it.
44 (push_template_decl_real): A friend member template is
47 2014-02-21 Jason Merrill <jason@redhat.com>
50 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
51 of the partial instantiation, not the most general template.
52 (maybe_process_partial_specialization): Reassign everything on
55 2014-03-05 Jason Merrill <jason@redhat.com>
58 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
59 if re-parsing might succeed.
60 * semantics.c (finish_id_expression): Use of a parameter outside
61 the function body is a parse error.
63 2014-06-30 Jason Merrill <jason@redhat.com>
66 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
69 * pt.c (unify_one_argument): Type/expression mismatch just causes
73 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
75 2014-06-17 Jason Merrill <jason@redhat.com>
78 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
80 2014-06-02 Jason Merrill <jason@redhat.com>
83 * pt.c (pack_deducible_p): Handle canonicalization.
85 2014-05-22 Release Manager
89 2014-05-13 Jason Merrill <jason@redhat.com>
92 * call.c (build_array_conv): Call complete_type.
95 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
96 (picflag_from_initializer): Return it.
97 (process_init_constructor): Handle it.
100 * decl.c (create_array_type_for_decl): Complain about array of auto.
103 * call.c (convert_default_arg): Remove special handling for
106 2014-04-28 Daniel Gutson <daniel.gutson@tallertechnologies.com>
108 * typeck.c (build_reinterpret_cast_1): Pass proper argument to
111 2014-02-28 Jason Merrill <jason@redhat.com>
114 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
116 2014-02-26 Jason Merrill <jason@redhat.com>
119 * pt.c (unify): Ignore alias templates when deducing a template
122 2014-02-24 Jason Merrill <jason@redhat.com>
125 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
126 DECL_EXPR initialize a non-class iterator.
128 2014-02-24 Fabien ChĂȘne <fabien@gcc.gnu.org>
130 * parser.c (cp_parser_nonclass_name): Call strip_using_decl and
131 move the code handling dependent USING_DECLs...
132 * name-lookup.c (strip_using_decl): ...Here.
134 2014-02-21 Jason Merrill <jason@redhat.com>
137 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
140 * parser.c (cp_parser_enum_specifier): Call
141 check_for_bare_parameter_packs.
144 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
147 * pt.c (coerce_template_parms): Bail if argument packing fails.
150 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
152 2014-02-20 Jason Merrill <jason@redhat.com>
157 * pt.c (template_parm_to_arg): Call convert_from_reference.
158 (tsubst_template_arg): Don't strip reference refs.
160 2014-02-20 Kai Tietz <ktietz@redhat.com>
163 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
164 valued type argument as error_mark_node.
167 * semantics.c (finish_fname): Handle error_mark_node.
169 2014-02-19 Jason Merrill <jason@redhat.com>
172 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
173 spec from template context.
175 2014-01-31 Jason Merrill <jason@redhat.com>
178 * decl2.c (handle_tls_init): Handle null init fn.
181 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
184 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
185 [ck_list]: Check for error_mark_node.
188 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
189 during partial ordering.
191 2014-01-30 Jason Merrill <jason@redhat.com>
194 * pt.c (instantiate_template_1): Save/restore local_specializations.
196 2014-01-29 Jason Merrill <jason@redhat.com>
199 * pt.c (expand_template_argument_pack): Correct
200 non_default_args_count calculation.
203 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
205 2014-01-28 Jason Merrill <jason@redhat.com>
208 * decl.c (lookup_and_check_tag): Ignore template parameters if
210 * pt.c (check_template_shadow): Don't complain about the injected
213 2014-01-27 Jason Merrill <jason@redhat.com>
216 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
219 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
223 * pt.c (template_parm_to_arg): Call convert_from_reference.
224 (tsubst_template_arg): Don't strip reference refs.
227 * call.c (build_aggr_conv): Reject value-initialization of reference.
230 * call.c (convert_like_real): Give helpful error about excess braces
231 for reference binding, too.
234 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
238 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
242 * decl.c (compute_array_index_type): Don't call
243 maybe_constant_value for a non-integral expression.
246 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
248 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
251 * name-lookup.c (push_using_directive): Use timevar_cond_start.
253 2014-01-23 Jakub Jelinek <jakub@redhat.com>
256 * semantics.c (finish_omp_clauses): Reject MIN_EXPR, MAX_EXPR,
257 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
259 2014-01-20 Marek Polacek <polacek@redhat.com>
261 Backported from mainline
262 2014-01-17 Marek Polacek <polacek@redhat.com>
265 * cvt.c (ocp_convert): Don't segfault on non-existing
266 ENUM_UNDERLYING_TYPE.
268 2014-01-10 Paolo Carlini <paolo.carlini@oracle.com>
272 * pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
274 2013-12-12 Jason Merrill <jason@redhat.com>
277 * pt.c (resolve_overloaded_unification): Discard access checks.
279 2013-12-05 Jason Merrill <jason@redhat.com>
283 * pt.c (most_specialized_class): Use the partially instantiated
284 template for deduction. Drop the TMPL parameter.
286 2013-12-04 Jakub Jelinek <jakub@redhat.com>
289 * pt.c (tsubst_copy_and_build): Handle POINTER_PLUS_EXPR.
291 2013-11-27 Tom de Vries <tom@codesourcery.com>
292 Marc Glisse <marc.glisse@inria.fr>
295 * typeck.c (cp_build_unary_op): Allow vector increment and decrement.
297 2013-11-27 Tom de Vries <tom@codesourcery.com>
298 Marc Glisse <marc.glisse@inria.fr>
301 * semantics.c (cxx_fold_indirect_ref): Don't create out-of-bounds
304 2013-11-28 Jakub Jelinek <jakub@redhat.com>
307 * semantics.c (finish_omp_atomic): Call finish_expr_stmt
308 rather than add_stmt.
310 2013-11-23 Easwaran Raman <eraman@google.com>
313 * call.c (build_new_method_call_1): Comnpare function context
314 with BASELINK_BINFO type rather than instance type before
315 marking the call with LOOKUP_NONVIRTUAL.
317 2013-10-31 Jason Merrill <jason@redhat.com>
320 * parser.c (cp_parser_late_parse_one_default_arg): Set
321 TARGET_EXPR_DIRECT_INIT_P.
323 2013-11-11 Paolo Carlini <paolo.carlini@oracle.com>
325 * cvt.c (cp_convert_to_pointer): Call build_ptrmemfunc before
326 maybe_warn_zero_as_null_pointer_constant to avoid duplicate
327 -Wzero-as-null-pointer-constant diagnostics.
329 * typeck.c (build_ptrmemfunc): Use cp_build_c_cast.
331 2013-10-25 Tom de Vries <tom@codesourcery.com>
334 * except.c (build_must_not_throw_expr): Handle
337 2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
340 * semantics.c (lambda_expr_this_capture): Handle NSDMIs in the
341 cp_unevaluated_operand case.
343 2013-10-16 Paolo Carlini <paolo.carlini@oracle.com>
346 * parser.c (cp_parser_pseudo_destructor_name): Revert r174385 changes.
348 2013-10-16 Jason Merrill <jason@redhat.com>
351 * decl2.c (dump_tu): Split out from...
352 (cp_write_global_declarations): ...here. Call it in PCH mode.
354 2013-10-16 Release Manager
356 * GCC 4.8.2 released.
358 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
361 * semantics.c (begin_lambda_type): Check return value of xref_tag
362 for error_mark_node; tidy.
363 * decl.c (grokdeclarator): Tweak error message.
365 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
368 * parser.c (cp_parser_function_specifier_opt): Upon error about
369 virtual templates don't set ds_virtual.
371 2013-09-18 Paolo Carlini <paolo.carlini@oracle.com>
374 * class.c (instantiate_type): Loosen a bit the gcc_assert.
376 2013-09-13 Jason Merrill <jason@redhat.com>
379 * pt.c (any_type_dependent_elements_p): Actually check for
380 type-dependence, not value-dependence.
382 2013-09-09 Jakub Jelinek <jakub@redhat.com>
385 * init.c (build_vec_delete): Call mark_rvalue_use on base.
387 2013-08-20 Jason Merrill <jason@redhat.com>
390 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
391 (MAYBE_CLASS_TYPE_P): ...here.
392 * cvt.c (build_expr_type_conversion): Don't complain about a
393 template that can't match the desired type category.
395 2013-08-17 Jason Merrill <jason@redhat.com>
398 * name-lookup.c (push_class_level_binding_1): It's OK to push a
399 lambda type after the enclosing type is complete.
401 2013-08-06 Jason Merrill <jason@redhat.com>
404 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
406 2013-07-29 Jason Merrill <jason@redhat.com>
409 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
410 Use break_out_target_exprs instead of unshare_expr.
413 * typeck2.c (abstract_virtuals_error_sfinae): Don't remember
414 lookup in SFINAE context.
416 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
419 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
421 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
422 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
423 a tsubst_flags_t parameter.
424 (tsubst_decl): Adjust.
425 * call.c (convert_default_arg): Likewise.
426 * cp-tree.h (check_default_argument, tsubst_default_argument):
429 2013-07-12 Jason Merrill <jason@redhat.com>
431 * init.c (build_vec_init): Value-initialize the rest of the array.
433 2013-07-09 Jason Merrill <jason@redhat.com>
436 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
437 if the variable type uses 'auto'.
440 * typeck.c (check_return_expr): Lambda proxies aren't eligible
441 for nrv or return by move.
444 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
445 a ref-qualifier in C++98 mode.
448 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
449 argument to have the exact type of the parameter.
452 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
453 a POINTER_PLUS_EXPR for type punning diagnostic.
456 * pt.c (tsubst_copy): Handle USING_DECL.
458 2013-07-08 Jason Merrill <jason@redhat.com>
461 * pt.c (fn_type_unification): Only defer during substitution.
462 (type_unification_real): Defer during defarg substitution,
463 add checks parm to pass back deferred checks.
464 (unify, do_auto_deduction): Adjust.
465 * semantics.c (reopen_deferring_access_checks): New.
466 * cp-tree.h: Declare it.
468 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
471 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
472 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
475 2013-07-03 Jakub Jelinek <jakub@redhat.com>
478 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
479 Temporarily set parser->greater_than_is_operator_p for
480 cp_parser_expression and restore from saved value afterwards.
482 2013-06-21 Paolo Carlini <paolo.carlini@oracle.com>
485 * pt.c (type_dependent_expression_p): Handle an array of unknown
486 bound depending on a variadic parameter.
487 * parser.c (cp_parser_range_for): Revert PR56794 changes.
489 2013-05-31 Jason Merrill <jason@redhat.com>
492 * class.c (vbase_has_user_provided_move_assign): New.
493 * method.c (synthesized_method_walk): Check it.
494 * cp-tree.h: Declare it.
497 * call.c (convert_like_real): Use cp_convert_and_check.
498 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
499 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
500 (potential_constant_expression_1): Handle OMP_ATOMIC*.
502 2013-05-31 Release Manager
504 * GCC 4.8.1 released.
506 2013-05-24 Jason Merrill <jason@redhat.com>
509 * tree.c (build_ref_qualified_type): Clear
510 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
513 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
516 2013-05-20 Jason Merrill <jason@redhat.com>
519 * tree.c (build_cplus_array_type): Copy layout info if element
523 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
524 whether a template has its own args.
526 2013-05-16 Jason Merrill <jason@redhat.com>
529 * decl.c (grokdeclarator): Allow member function qualifiers in
530 TYPENAME context in C++11 mode.
532 2013-05-16 Dodji Seketeli <dodji@redhat.com>
534 PR c++/56782 - Regression with empty pack expansions
535 * pt.c (use_pack_expansion_extra_args_p): When at least a
536 parameter pack has an empty argument pack, and another parameter
537 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
540 2013-05-14 Jason Merrill <jason@redhat.com>
543 * parser.c (cp_parser_range_for): Call complete_type.
546 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
548 2013-05-13 Jason Merrill <jason@redhat.com>
551 * semantics.c (potential_constant_expression_1): Make sure the
552 called function is potentially constant.
555 * decl.c (reshape_init_class): Handle error_mark_node.
558 * typeck.c (merge_types): Propagate ref-qualifier
562 * decl.c (grokdeclarator): Apply ref-qualifier
563 in the TYPENAME case.
566 * decl.c (decls_match): Compare ref-qualifiers.
569 * pt.c (convert_template_argument): Use dependent_template_arg_p,
570 not uses_template_parms.
572 2013-05-10 Jason Merrill <jason@redhat.com>
575 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
577 2013-05-09 Jason Merrill <jason@redhat.com>
580 * pt.c (lookup_template_class_1): Handle getting a template
581 template parameter as D1.
583 2013-05-08 Jason Merrill <jason@redhat.com>
586 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
587 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
588 * error.c (maybe_warn_cpp0x): s/0x/11/.
590 2013-05-08 Marc Glisse <marc.glisse@inria.fr>
592 * typeck.c (cp_build_binary_op): Call save_expr before
593 build_vector_from_val.
595 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
598 * decl.c (cp_finish_decl): After do_auto_deduction copy the
599 qualifers with cp_apply_type_quals_to_decl.
601 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
604 * semantics.c (finish_decltype_type): Handle instantiated template
607 2013-04-29 Paolo Carlini <paolo.carlini@oracle.com>
610 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
612 2013-04-25 Jason Merrill <jason@redhat.com>
615 * call.c (add_function_candidate): Strip ref-to-ptr conversion.
618 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
621 * init.c (perform_member_init): Call reshape_init.
623 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
626 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
627 * semantics.c (finish_qualified_id_expr): Likewise.
628 (finish_id_expression): Update.
629 * typeck.c (cp_build_addr_expr_1): Likewise.
630 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
631 * cp-tree.h: Update declarations.
633 2013-04-17 Jason Merrill <jason@redhat.com>
636 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
637 template specializations.
639 2013-04-15 Jason Merrill <jason@redhat.com>
642 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
643 rather than a destructor name, it isn't an unqualified-name.
644 (tsubst_copy_and_build): Pass down decltype_flag to operator
648 * semantics.c (insert_capture_proxy): Just use index 1 in the
651 2013-04-11 Jason Merrill <jason@redhat.com>
654 * parser.c (complain_flags): New.
655 (cp_parser_postfix_expression): Use it.
656 (cp_parser_unary_expression): Likewise.
657 (cp_parser_binary_expression): Likewise.
658 (cp_parser_assignment_expression): Likewise.
659 (cp_parser_expression): Likewise.
660 (cp_parser_postfix_open_square_expression): Take decltype_p.
661 (cp_parser_builtin_offsetof): Adjust.
662 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
663 * decl2.c (grok_array_decl): Add decltype_p parm.
664 * cp-tree.h: Adjust prototype.
665 * semantics.c (finish_unary_op_expr): Add complain parm.
667 2013-04-11 Jakub Jelinek <jakub@redhat.com>
670 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
671 calling maybe_constant_value for C++98.
673 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
676 * typeck2.c (build_m_component_ref): Protect error calls with
677 (complain & tf_error).
679 2013-04-10 Jakub Jelinek <jakub@redhat.com>
682 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
683 first before calling maybe_constant_value for warn_for_div_by_zero
684 or invalid shift count warning purposes.
686 2013-04-06 Jason Merrill <jason@redhat.com>
688 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
691 2013-04-03 Jason Merrill <jason@redhat.com>
693 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
694 (FUNCTION_REF_QUALIFIED): Use FUNC_OR_METHOD_CHECK instead.
695 (FUNCTION_RVALUE_QUALIFIED): Likewise.
697 2013-04-03 Jakub Jelinek <jakub@redhat.com>
700 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
701 from args to new_args.
702 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
703 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
705 2013-04-02 Jason Merrill <jason@redhat.com>
708 * mangle.c (write_function_type): Mangle ref-qualifier.
709 (write_nested_name): Likewise.
710 (canonicalize_for_substitution): Preserve ref-qualifier.
711 (write_type): Likewise.
713 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
716 * decl.c (check_array_designated_initializer): Handle CONST_DECL
719 2013-04-01 Jason Merrill <jason@redhat.com>
722 * init.c (build_new): Don't try to process an array initializer
723 at template definition time.
725 2013-04-01 Jason Merrill <jason@redhat.com>
728 * typeck.c (finish_class_member_access_expr): Handle enum scope.
730 2013-04-01 Jason Merrill <jason@redhat.com>
733 * parser.c (cp_parser_range_for): Don't try to do auto deduction
734 in a template if the type of the range is incomplete.
736 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
737 Jason Merrill <jason@redhat.com>
739 Implement N2439 (ref-qualifiers for 'this')
740 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
741 (FUNCTION_RVALUE_QUALIFIED): New.
742 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
743 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
744 (cp_ref_qualifier): New enum.
745 (cp_declarator): Add ref_qualifier.
746 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
747 (cp_parser_direct_declarator): Use it.
748 (make_call_declarator): Adjust.
749 (cp_parser_lambda_declarator_opt): Adjust.
750 * call.c (add_function_candidate): Handle ref-qualifier overload
751 resolution semantics.
752 (standard_conversion): Adjust.
753 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
754 * decl.c (grokdeclarator): Handle ref-qualifiers.
755 (grokfndecl): Check for invalid ref-qualifiers.
756 (static_fn_type, revert_static_member_fn): Adjust.
757 * decl2.c (build_memfn_type): Handle ref-qualifiers.
758 (check_classfn): Check them.
759 (cp_reconstruct_complex_type): Retain them.
760 * error.c (dump_ref_qualifier): New.
761 (dump_type_suffix, dump_function_decl): Use it.
762 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
763 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
764 (unify): Retain them.
765 * tree.c (cp_check_qualified_type): New.
766 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
767 (build_ref_qualified_type): New.
768 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
769 (cp_build_type_attribute_variant): Keep ref-qualifier.
770 * typeck.c (merge_types): Keep ref-qualifier.
771 (structural_comptypes): Compare ref-qualifier.
772 (type_memfn_rqual): New.
773 (apply_memfn_quals): Take ref-qual argument.
774 * typeck2.c (build_m_component_ref): Check ref-qualifier.
776 2013-03-29 Jason Merrill <jason@redhat.com>
780 * pt.c (unify_pack_expansion): Fix indexing.
782 2013-03-28 Jason Merrill <jason@redhat.com>
785 * semantics.c (cxx_eval_indirect_ref): Use the folded operand if
786 we still think this might be constant.
788 2013-03-27 Jason Merrill <jason@redhat.com>
791 * semantics.c (finish_qualified_id_expr): Return early
794 2013-03-26 Jason Merrill <jason@redhat.com>
797 * typeck2.c (build_m_component_ref): Handle prvalue object.
799 2013-03-25 Jason Merrill <jason@redhat.com>
802 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
803 class is derived from the type of the object.
806 * search.c (lookup_base): Handle NULL_TREE.
808 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
811 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
812 DECL_TEMPLATE_INSTANTIATION.
814 2013-03-25 Jason Merrill <jason@redhat.com>
817 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
820 2013-03-23 Jason Merrill <jason@redhat.com>
823 * parser.c (cp_parser_direct_declarator): Fix late return
824 for out-of-class defn of member function.
826 2013-03-22 Paolo Carlini <paolo.carlini@oracle.com>
829 * semantics.c (cxx_eval_array_reference): Check for negative index.
831 2013-03-22 Jason Merrill <jason@redhat.com>
834 * parser.c (cp_parser_late_return_type_opt): Save and restore
835 current_class_ptr/ref.
839 * cp-tree.h (tsubst_flags): Add tf_decltype.
840 * call.c (build_cxx_call): Don't build a temporary if it's set.
841 (build_over_call): Make sure it's only passed to build_cxx_call.
842 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
843 (cp_parser_unary_expression): Likewise.
844 (cp_parser_cast_expression): Likewise.
845 (cp_parser_binary_expression): Likewise.
846 (cp_parser_assignment_expression): Likewise.
847 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
848 (cp_parser_explicit_instantiation): Add decltype_p. Force a
849 temporary for a call on the LHS of a comma.
850 (cp_parser_decltype): Pass true to decltype_p parms.
851 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
852 (tsubst_copy_and_build): Pass tf_decltype down only for
853 CALL_EXPR and the RHS of COMPOUND_EXPR.
854 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
857 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
858 (tsubst_arg_types): Likewise.
861 * semantics.c (lambda_capture_field_type): Don't build a
862 magic decltype for pointer types.
863 (lambda_proxy_type): Likewise.
864 (finish_non_static_data_member): Get the quals from
868 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
872 * name-lookup.h (tag_scope): Add ts_lambda.
873 * semantics.c (begin_lambda_type): Use it.
874 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
875 * pt.c (check_default_tmpl_args): Ignore lambdas.
876 (push_template_decl_real): Handle lambdas.
877 * tree.c (no_linkage_check): Adjust lambda check.
880 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
884 * pt.c (instantiate_class_template_1): Instantiate lambda capture
886 (tsubst_copy_and_build): Not here.
888 2013-03-22 Jakub Jelinek <jakub@redhat.com>
890 Backported from mainline
891 2013-03-16 Jakub Jelinek <jakub@redhat.com>
894 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
895 pass op1 through maybe_constant_value first.
897 * tree.c (cp_tree_equal): Fix a pasto.
899 2013-03-22 Release Manager
901 * GCC 4.8.0 released.
903 2013-03-14 Jason Merrill <jason@redhat.com>
906 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
909 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
910 dso_handle parm on targets without __cxa_atexit.
912 2013-03-11 Jason Merrill <jason@redhat.com>
915 * typeck.c (check_return_expr): Disallow returning init list here.
916 * semantics.c (apply_deduced_return_type): Not here.
918 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
921 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
922 * error.c (dump_expr): Likewise.
924 2013-03-08 Jason Merrill <jason@redhat.com>
927 * class.c (modify_all_vtables): Mangle the vtable name before
930 * semantics.c (lambda_expr_this_capture): In unevaluated context,
931 just return the nearest 'this'.
936 * tree.c (maybe_dummy_object): Don't capture 'this'.
937 * semantics.c (maybe_resolve_dummy): New.
938 (finish_non_static_data_member): Use it.
939 (finish_qualified_id_expr): Don't test is_dummy_object.
940 * cp-tree.h: Declare maybe_resolve_dummy.
941 * call.c (build_new_method_call_1): Use it.
944 * semantics.c (apply_deduced_return_type): Don't allow returning
945 std::initializer_list.
947 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
950 * parser.c (cp_parser_elaborated_type_specifier): Don't call
951 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
952 * decl.c (check_elaborated_type_specifier): Tidy.
954 2013-03-06 Jakub Jelinek <jakub@redhat.com>
957 * tree.c (strip_typedefs): Don't copy args if they are NULL.
959 2013-03-05 Jakub Jelinek <jakub@redhat.com>
961 * parser.c (cp_parser_braced_list): For {} initialize
962 *non_constant_p to false.
964 2013-03-04 Jason Merrill <jason@redhat.com>
968 * semantics.c (lambda_expr_this_capture): Handle NSDMI
969 and non-class scopes.
971 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
973 * decl.c (grokdeclarator): Remove dead code.
975 2013-02-28 Jason Merrill <jason@redhat.com>
978 * semantics.c (potential_constant_expression_1): Use
979 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
982 * call.c (build_over_call): Avoid virtual lookup in a template.
984 2013-02-27 Jason Merrill <jason@redhat.com>
988 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
989 of the base name for inheriting ctors.
990 (push_class_level_binding_1): Remove inheriting ctor handling.
991 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
992 * class.c (add_implicitly_declared_members): Adjust.
994 2013-02-26 David Binderman <dcb314@hotmail.com>
997 * decl.c (grokdeclarator): Tidy publicp assignment.
999 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1002 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1003 (build_transaction_expr): Same.
1005 2013-02-25 Jason Merrill <jason@redhat.com>
1008 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1009 we know what args we're looking at.
1012 * semantics.c (potential_constant_expression_1): In C++98, a cast
1013 to non-integral type can't be a constant expression.
1015 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1018 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1021 2013-02-22 Jason Merrill <jason@redhat.com>
1024 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1025 if we got the wrong number of template parms.
1028 * pt.c (fn_type_unification): Use explicit args in template
1029 instantiation context.
1032 * call.c (can_convert_arg): Discard access checks.
1035 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1038 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1041 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1042 * cvt.c (ocp_convert): Use the latter.
1043 (cp_convert_to_pointer): Likewise.
1044 * decl.c (check_default_argument): Likewise.
1045 * typeck.c (cp_build_binary_op): Likewise.
1046 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1048 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1049 Paolo Carlini <paolo.carlini@oracle.com>
1052 * decl2.c (grokbitfield): Allow scoped enumeration types.
1054 2013-02-15 Jason Merrill <jason@redhat.com>
1057 * semantics.c (finish_id_expression): Also return the identifier
1058 for an outer local static.
1061 * class.c (check_bases_and_members): Deduce noexcept after
1065 * semantics.c (finish_id_expression): In a template, return
1066 the identifier for a constant variable.
1068 2013-02-14 Jason Merrill <jason@redhat.com>
1071 * semantics.c (build_anon_member_initialization): New.
1072 (build_data_member_initialization): Use it.
1075 * decl.c (cp_finish_decl): Force instantiation of an
1076 auto static data member.
1079 * pt.c (unify): A pack expansion that is not the last template
1080 argument makes the entire template argument list non-deduced.
1083 * name-lookup.c (do_class_using_decl): Handle typedefs with
1084 inheriting constructors.
1085 (push_class_level_binding_1): Allow inheriting from template
1086 template parameter, too.
1087 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1090 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1091 default argument scope.
1092 * mangle.c (write_name): Likewise.
1095 * error.c (find_typenames_r): Don't walk into a pack expansion.
1097 2013-02-13 Jason Merrill <jason@redhat.com>
1100 * parser.c (cp_parser_member_declaration): Check the declarator
1101 form when detecting a function declaration via typedef.
1104 * pt.c (maybe_process_partial_specialization): A lambda
1105 isn't what's being specialized.
1108 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1112 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1115 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1116 non-zero offsets, too.
1119 * decl.c (build_enumerator): Always convert the value to a
1120 fixed underlying type.
1123 * pt.c (tsubst_copy_and_build): Don't forget any new
1124 captures that arose from use of dependent names.
1126 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1129 * semantics.c (finish_asm_stmt): If input constraints allow
1130 neither register nor memory, try maybe_constant_value to get
1131 a constant if possible.
1133 2013-02-12 Jason Merrill <jason@redhat.com>
1136 * method.c (add_one_base_init): Handle base constructor
1137 taking rvalue reference parm.
1140 * semantics.c (sort_constexpr_mem_initializers): Handle
1143 2013-02-09 Jason Merrill <jason@redhat.com>
1146 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1147 maybe_instantiate_noexcept.
1150 * pt.c (eq_specializations): Set comparing_specializations.
1151 * tree.c (cp_tree_equal): Check it.
1152 * cp-tree.h: Declare it.
1154 * decl.c (decls_match): Check versions later.
1157 * pt.c (build_non_dependent_expr): Don't try to fold
1158 instantiation-dependent expressions.
1159 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1160 [BIND_EXPR]: Treat as dependent.
1162 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1165 * init.c (build_vec_init): Don't append NULL values into new_vec.
1166 (build_zero_init_1): Don't push anything into v if recursive call
1168 (build_value_init_noctor): Don't push anything into v if
1169 build_value_init call returned NULL_TREE.
1172 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1173 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1174 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1175 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1176 (cp_parser_cast_expression): Adjust caller.
1179 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1180 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1181 DECL_LANG_SPECIFIC (t).
1183 2013-02-07 Jason Merrill <jason@redhat.com>
1186 * method.c (do_build_copy_constructor): Don't bother turning
1187 scalars from lvalues to xvalues.
1188 (do_build_copy_assign): Likewise.
1190 2013-02-06 Jason Merrill <jason@redhat.com>
1192 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1194 2013-02-05 Jason Merrill <jason@redhat.com>
1197 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1201 * decl.c (start_preparsed_function): Update restype if we change
1205 * pt.c (fn_type_unification): Discard any access checks from
1206 substituting explicit args.
1208 2013-01-31 Jason Merrill <jason@redhat.com>
1212 * typeck.c (get_member_function_from_ptrfunc): Fix
1213 ptrmemfunc_vbit_in_delta case.
1215 2013-01-29 Jason Merrill <jason@redhat.com>
1218 * class.c (build_ctor_vtbl_group): Give construction vtables
1221 2013-01-25 Jason Merrill <jason@redhat.com>
1224 * pt.c (convert_nontype_argument_function): Handle invalid input.
1225 (convert_nontype_argument): Likewise.
1228 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1229 dynamic type has no virtual functions.
1231 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1234 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1235 on TARGET_EXPR nodes.
1237 2013-01-22 Jason Merrill <jason@redhat.com>
1240 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1242 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1245 * pt.c (argument_pack_element_is_expansion_p)
1246 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1247 (gen_elem_of_pack_expansion_instantiation): New static functions.
1248 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1249 look through the possibly resulting pack expansion as well.
1250 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1251 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1252 Use gen_elem_of_pack_expansion_instantiation to build the
1253 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1254 as gen_elem_of_pack_expansion_instantiation and the change in
1255 tsubst above generalize this particular case.
1256 (arg_from_parm_pack_p): Remove this for it's not used by
1257 tsubst_pack_expansion anymore.
1259 2013-01-21 Jason Merrill <jason@redhat.com>
1262 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1263 template args count.
1265 2013-01-18 Jason Merrill <jason@redhat.com>
1268 * decl2.c (get_local_tls_init_fn): New.
1269 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1270 with aliases for internal variables. Don't use weakrefs if
1271 the variable needs destruction.
1272 (generate_tls_wrapper): Mark the wrapper as const if no
1273 initialization is needed.
1274 (handle_tls_init): Don't require aliases.
1276 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1279 * pt.c (coerce_innermost_template_parms): New static function.
1280 (instantiate_alias_template): Use it here.
1282 2013-01-09 Jason Merrill <jason@redhat.com>
1285 * rtti.c (build_typeid, get_typeid): Add complain parm.
1286 (get_tinfo_decl_dynamic): Likewise.
1287 * cp-tree.h, parser.c, pt.c: Adjust.
1290 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1293 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1296 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1297 call maybe_constant_value for the negative or too big shift
1300 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1303 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1304 of the argument is true.
1306 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1308 * parser.c (cp_parser_initializer_list): Move declaration
1309 of variable non_const to start of lexical block.
1311 2013-01-07 Jason Merrill <jason@redhat.com>
1314 * tree.c (build_aggr_init_expr): Do nothing in a template.
1315 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1316 a FUNCTION_DECL before tsubsting.
1318 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1321 * pt.c (check_instantiated_arg): Allow type template arguments.
1323 2013-01-04 Jason Merrill <jason@redhat.com>
1326 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1327 (grokdeclarator): Use reset_type_linkage.
1328 * name-lookup.c (binding_table_foreach): Handle null table.
1329 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1331 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1333 PR c++/54526 (again)
1334 * parser.c (cp_parser_template_id): Revert core of previous change
1335 (keep adjusted inform message).
1337 2013-01-03 Jason Merrill <jason@redhat.com>
1341 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1345 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1348 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1351 * call.c (type_has_extended_temps): New.
1352 * cp-tree.h: Declare it.
1353 * decl.c (check_initializer): Use build_aggr_init for arrays
1355 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1357 2013-01-02 Jason Merrill <jason@redhat.com>
1360 * call.c (build_new_method_call_1): Don't use build_value_init for
1361 user-provided default constructors.
1363 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1367 * tree.c (build_cplus_array_type): Copy layout information
1368 to main variant if necessary.
1370 Copyright (C) 2013 Free Software Foundation, Inc.
1372 Copying and distribution of this file, with or without modification,
1373 are permitted in any medium without royalty provided the copyright
1374 notice and this notice are preserved.