1 2013-06-20 Jason Merrill <jason@redhat.com>
4 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
5 context if we're in C++14 mode.
6 * tree.c (array_of_runtime_bound_p): Return true for a dependent
7 bound that is not potentually constant.
8 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
9 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
10 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
11 (build_capture_proxy): Set REFERENCE_VLA_OK.
12 (vla_capture_type): Make it a proper C++ class.
13 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
16 * decl.c (compute_array_index_type): Use size_one_node.
18 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
19 a partial specialization.
20 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
22 (most_specialized_class): Adjust.
24 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
25 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
28 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
31 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
32 TREE_TYPE (arg), not arg itself.
34 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
37 * pt.c (type_dependent_expression_p): Handle an array of unknown
38 bound depending on a variadic parameter.
39 * parser.c (cp_parser_range_for): Revert PR56794 changes.
41 2013-06-17 Richard Biener <rguenther@suse.de>
43 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
45 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
48 * parser.c (cp_parser_expression_statement): Check whether
49 cp_parser_expression returns error_mark_node.
51 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
54 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
56 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
59 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
60 accessible base simply forward to build_static_cast.
62 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
65 * decl.c (poplevel): For the benefit of -Wunused-variable see
68 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
70 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
72 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
75 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
76 again diagnostic already emitted by cp_parser_lookup_name.
78 2013-06-11 Jan Hubicka <jh@suse.cz>
81 * cp/pt.c (mark_decl_instantiated): Do not export explicit
82 instantiations of anonymous namespace templates.
84 2013-06-10 Jason Merrill <jason@redhat.com>
86 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
87 namespace to static_decls.
89 2013-06-07 Sriraman Tallam <tmsriram@google.com>
92 * call.c (build_over_call): Check if current_function_decl is
95 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
98 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
99 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
101 2013-06-06 Jason Merrill <jason@redhat.com>
104 * semantics.c (add_capture): Diagnose capture of variable-size
105 type that is not a C++1y array of runtime bound.
107 * decl.c (grokdeclarator): Keep a decl with error type.
108 (grokfield, grokbitfield): Likewise.
109 * pt.c (instantiate_class_template_1): Likewise.
110 (tsubst_decl): Drop redundant error.
111 * class.c (walk_subobject_offsets): Handle erroneous fields.
112 * typeck2.c (process_init_constructor_record): Likewise.
114 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
117 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
118 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
120 2013-06-03 Jan Hubicka <jh@suse.cz>
122 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
123 mark_decl_referenced.
124 (mark_needed): Likewise.
126 2013-06-03 Jason Merrill <jason@redhat.com>
128 * class.c (mark_type_abi_tags): New.
129 (check_abi_tags): Use it.
131 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
134 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
135 * semantics.c (finish_qualified_id_expr): Use it.
138 2013-06-01 Jan Hubicka <jh@suse.cz>
140 * decl2.c (cp_write_global_declarations): Replace same_body_alias
141 by symbol.cpp_implicit_alias.
143 2013-05-30 Jason Merrill <jason@redhat.com>
146 * cp-lang.c (cp_classify_record): Handle structs without
150 * class.c (common_enclosing_class): New.
151 * cp-tree.h: Declare it.
152 * init.c (sort_mem_initializers): Don't splice out a union member
155 2013-05-29 Jan Hubicka <jh@suse.cz>
157 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
158 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
160 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
163 * decl2.c (check_classfn): Check for destructors declared as member
166 2013-05-24 Jason Merrill <jason@redhat.com>
169 * pt.c (any_template_arguments_need_structural_equality_p): A
170 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
172 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
175 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
176 with width exceeding the type.
178 2013-05-24 Jason Merrill <jason@redhat.com>
181 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
182 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
184 2013-05-23 Jason Merrill <jason@redhat.com>
187 * tree.c (build_ref_qualified_type): Clear
188 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
190 2013-05-22 Jason Merrill <jason@redhat.com>
193 * call.c (convert_like_real): Use cp_convert_and_check.
194 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
195 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
196 (potential_constant_expression_1): Handle OMP_ATOMIC*.
199 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
202 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
205 * parser.c (cp_parser_conversion_type_id): Set up
206 parser->type_definition_forbidden_message before calling
207 cp_parser_type_specifier_seq.
209 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
212 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
213 warnings about defaulted functions.
215 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
217 * call.c (build_conditional_expr_1): Add location_t parameter.
218 (build_conditional_expr): Likewise.
219 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
220 get_member_function_from_ptrfunc, build_x_conditional_expr,
221 cp_build_modify_expr): Update.
222 * init.c (build_new_1): Likewise.
223 * cp-tree.h: Update declaration.
225 2013-05-20 Jason Merrill <jason@redhat.com>
228 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
232 * decl.c (fndecl_declared_return_type): Also look in
233 DECL_SAVED_FUNCTION_DATA.
235 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
238 * parser.c (cp_parser_parameter_declaration): Check return value
239 of cp_parser_parse_and_diagnose_invalid_type_name.
241 2013-05-20 Jason Merrill <jason@redhat.com>
244 * class.c (vbase_has_user_provided_move_assign): New.
245 * method.c (synthesized_method_walk): Check it.
246 * cp-tree.h: Declare it.
249 * tree.c (build_cplus_array_type): Copy layout info if element
252 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
255 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
257 2013-05-20 Jason Merrill <jason@redhat.com>
260 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
261 whether a template has its own args.
263 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
266 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
268 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
271 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
272 instead of cp_parser_initializer_list for compound-literals.
274 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
277 * typeck.c (check_return_expr): Reverse the alignment comparison.
279 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
282 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
283 correctly sizeof compound-literal; update comments.
285 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
287 * call.c (build_conditional_expr_1): Use cp_build_binary_op
288 instead of directly calling fold_build2.
290 2013-05-16 Jason Merrill <jason@redhat.com>
292 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
295 * decl.c (grokdeclarator): Allow member function qualifiers in
296 TYPENAME context in C++11 mode.
298 2013-05-16 Dodji Seketeli <dodji@redhat.com>
300 PR c++/56782 - Regression with empty pack expansions
301 * pt.c (use_pack_expansion_extra_args_p): When at least a
302 parameter pack has an empty argument pack, and another parameter
303 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
306 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
308 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
309 warning_at and permerror with warning_at/inform and permerror/
310 inform, respectively.
312 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
315 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
318 2013-05-14 Jason Merrill <jason@redhat.com>
321 * parser.c (cp_parser_range_for): Call complete_type.
324 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
326 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
329 * method.c (defaulted_late_check): Check for compatible exception
330 specification out of class explicitly defaulted functions too.
332 2013-05-14 Jason Merrill <jason@redhat.com>
335 * semantics.c (potential_constant_expression_1): Make sure the
336 called function is potentially constant.
337 * call.c (null_ptr_cst_p): Revert earlier change.
339 2013-05-13 Jason Merrill <jason@redhat.com>
342 * call.c (null_ptr_cst_p): An expression with side-effects can't
343 be a C++03 null pointer constant.
346 * decl.c (reshape_init_class): Handle error_mark_node.
349 * typeck.c (merge_types): Propagate ref-qualifier
353 * decl.c (grokdeclarator): Apply ref-qualifier
354 in the TYPENAME case.
357 * decl.c (decls_match): Compare ref-qualifiers.
359 2013-05-10 Jason Merrill <jason@redhat.com>
362 * pt.c (convert_template_argument): Use dependent_template_arg_p,
363 not uses_template_parms.
366 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
369 * semantics.c (add_capture): Error rather than abort on copy
371 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
372 warn about capture proxy.
374 2013-05-09 Jason Merrill <jason@redhat.com>
376 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
379 * pt.c (lookup_template_class_1): Handle getting a template
380 template parameter as D1.
382 N3639 C++1y VLA diagnostics
383 * decl.c (grokdeclarator): Complain about reference, pointer, or
385 (create_array_type_for_decl): Complain about array of VLA.
386 * pt.c (tsubst): Likewise.
387 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
388 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
389 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
390 (cxx_sizeof_or_alignof_type): Likewise.
392 N3639 C++1y VLA support
393 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
394 (check_array_initializer): Allow VLA init.
395 (reshape_init_array_1): Adjust.
396 (cp_finish_decl): Check for invalid VLA length.
397 * typeck2.c (process_init_constructor_array): Adjust.
398 (store_init_value): Use build_vec_init for VLAs.
399 * semantics.c (add_capture): Capture VLA as ptr+len.
400 (vla_capture_type): New.
401 (build_capture_proxy): Rebuild the VLA.
402 * typeck.c (build_simple_component_ref): Split out from...
403 (build_ptrmemfunc_access_expr): ...here.
404 * tree.c (array_of_runtime_bound_p): New.
405 * init.c (throw_bad_array_length): New.
406 (build_vec_init): Use it.
407 * parser.c (cp_convert_range_for): When iterating over a VLA,
408 use it directly rather than bind a reference.
409 * cp-tree.h: Declare new functions.
411 2013-05-08 Jason Merrill <jason@redhat.com>
413 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
414 variably_modified_type_p.
415 (expand_start_catch_block): Mark the typeinfo used here.
416 * semantics.c (finish_handler_parms): Not here.
418 * error.c (dump_type_suffix): Try harder on VLA length.
421 * init.c (throw_bad_array_new_length): New.
422 (build_new_1): Use it. Don't warn about braced-init-list.
423 (build_vec_init): Use it.
424 * call.c (build_operator_new_call): Use it.
427 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
428 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
429 * error.c (maybe_warn_cpp0x): s/0x/11/.
431 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
434 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
437 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
439 * typeck.c (cp_build_binary_op): Call save_expr before
440 build_vector_from_val.
442 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
445 * decl.c (cp_finish_decl): After do_auto_deduction copy the
446 qualifers with cp_apply_type_quals_to_decl.
448 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
450 * pt.c (convert_nontype_argument): Add missing whitespace in
453 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
456 * decl.c (build_enumerator): Improve error message.
458 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
461 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
462 messages for template types and fix column numbers.
464 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
467 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
468 c_inhibit_evaluation_warnings around build_x_modify_expr call.
470 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
473 * semantics.c (finish_decltype_type): Handle instantiated template
476 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
479 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
481 2013-04-26 Jakub Jelinek <jakub@redhat.com>
483 * error.c (cp_print_error_function): Adjust file_name_as_prefix
486 2013-04-25 Jason Merrill <jason@redhat.com>
489 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
492 * init.c (perform_member_init): Call reshape_init.
494 2013-04-24 Jason Merrill <jason@redhat.com>
497 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
499 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
501 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
502 pedwarn to simply use OPT_Wpointer_arith.
503 (cp_build_unary_op): Likewise.
505 2013-04-24 Jason Merrill <jason@redhat.com>
507 N3648: init-captures are named.
508 * semantics.c (add_capture): Don't prepend "__" to init-captures.
509 (build_capture_proxy): Adjust.
510 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
512 N3648: Allow braced and parenthesized initializers.
513 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
514 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
515 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
516 (add_capture): Collapse a parenthesized initializer into a single
518 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
520 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
523 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
524 * semantics.c (finish_qualified_id_expr): Likewise.
525 (finish_id_expression): Update.
526 * typeck.c (cp_build_addr_expr_1): Likewise.
527 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
528 * cp-tree.h: Update declarations.
530 2013-04-22 Jason Merrill <jason@redhat.com>
533 * parser.c (cp_parser_unqualified_id): Handle ~auto.
534 (cp_parser_pseudo_destructor_name): Likewise.
535 (cp_parser_postfix_dot_deref_expression): Adjust.
536 (cp_lexer_nth_token_is_keyword): New.
537 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
538 * typeck.c (lookup_destructor): Handle ~auto.
540 * pt.c (fn_type_unification): Push tinst level around
541 type_unification_real if we aren't explaining.
542 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
543 * error.c (dump_function_decl): Respect it.
544 (subst_to_string): Pass it.
547 * rtti.c (get_typeid): Diagnose qualified function type.
548 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
550 * error.c (dump_aggr_type): Fix lambda detection.
551 (dump_simple_decl): Pretty-print capture field.
554 * cvt.c (build_expr_type_conversion): Two conversions that return
555 the same type aren't necessarily ambiguous.
558 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
559 pedwarn unconditional except in C++1y mode.
561 * semantics.c (potential_constant_expression_1): Don't crash on
565 * semantics.c (finish_id_expression): Reject capture of anonymous
569 * decl2.c (check_default_args): Check for pack expansion.
571 * mangle.c (write_type): Mangle decltype(auto).
573 2013-04-19 Jason Merrill <jason@redhat.com>
575 N3638 changes to return type deduction
576 * decl.c (undeduced_auto_decl): New.
577 (require_deduced_type): New.
578 (fndecl_declared_return_type): New.
579 (decls_match): Use it.
580 (duplicate_decls): Don't check for auto return.
581 (grokdeclarator): Reject virtual auto.
582 * class.c (resolve_address_of_overloaded_function): Handle
583 auto function templates.
584 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
585 * cp-tree.h: Declare new fns.
586 * error.c (dump_function_decl): Use fndecl_declared_return_type.
587 * search.c (check_final_overrider): Likewise.
588 * pt.c (make_decltype_auto): New.
589 (do_auto_deduction): Require plain decltype(auto).
593 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
594 template specializations.
596 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
598 Implement n3599 - Literal operator templates for strings.
599 * parser.c (make_string_pack (tree value)): New function.
600 (cp_parser_userdef_string_literal (cp_token *)): Use it
601 to construct calls to character string literal operator templates.
602 (cp_parser_template_declaration_after_export): Check for new string
603 literal operator template parameter form.
605 2013-04-15 Jason Merrill <jason@redhat.com>
607 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
610 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
611 rather than a destructor name, it isn't an unqualified-name.
612 (tsubst_copy_and_build): Pass down decltype_flag to operator
616 * semantics.c (insert_capture_proxy): Just use index 1 in the
619 2013-04-12 Jakub Jelinek <jakub@redhat.com>
621 * error.c (cp_print_error_function,
622 print_instantiation_partial_context_line,
623 maybe_print_constexpr_context): Colorize locus strings.
625 2013-04-11 Jason Merrill <jason@redhat.com>
628 * parser.c (complain_flags): New.
629 (cp_parser_postfix_expression): Use it.
630 (cp_parser_unary_expression): Likewise.
631 (cp_parser_binary_expression): Likewise.
632 (cp_parser_assignment_expression): Likewise.
633 (cp_parser_expression): Likewise.
634 (cp_parser_postfix_open_square_expression): Take decltype_p.
635 (cp_parser_builtin_offsetof): Adjust.
636 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
637 * decl2.c (grok_array_decl): Add decltype_p parm.
638 * cp-tree.h: Adjust prototype.
639 * semantics.c (finish_unary_op_expr): Add complain parm.
641 2013-04-11 Jakub Jelinek <jakub@redhat.com>
644 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
645 calling maybe_constant_value for C++98.
647 2013-04-11 Jason Merrill <jason@redhat.com>
650 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
651 Strip references before checking WILDCARD_TYPE_P.
653 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
655 * call.c (build_conditional_expr_1, build_over_call): Protect
656 error calls with complain & tf_error.
657 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
658 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
659 build_ptrmemfunc): Likewise.
660 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
662 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
663 (convert_to_reference): Adjust.
665 2013-04-11 Jason Merrill <jason@redhat.com>
667 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
668 local variables, look them up instead.
669 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
670 proxies and substitution in unevaluated context.
671 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
672 before the iterators.
675 * pt.c (uses_deducible_template_parms): New.
676 (deducible_array_bound, deducible_expression): New.
677 (deducible_template_args): New.
678 (unify_one_argument): Call uses_deducible_template_parms.
680 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
683 * typeck2.c (build_m_component_ref): Protect error calls with
684 (complain & tf_error).
686 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
689 * parser.c (cp_parser_enum_specifier): Check for empty
690 anonymous enums and anonymous scoped enums.
692 2013-04-10 Jakub Jelinek <jakub@redhat.com>
695 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
696 first before calling maybe_constant_value for warn_for_div_by_zero
697 or invalid shift count warning purposes.
699 2013-04-09 Jason Merrill <jason@redhat.com>
702 * rtti.c (build_typeid): Check the address of the argument
703 rather than looking for an INDIRECT_REF.
705 2013-04-04 Jason Merrill <jason@redhat.com>
709 * typeck2.c (abstract_virtuals_error_sfinae): Disable
712 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
715 * decl.c (validate_constexpr_redeclaration): Allow an explicit
716 specialization to be different wrt the constexpr specifier.
718 2013-04-06 Jason Merrill <jason@redhat.com>
720 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
723 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
725 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
726 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
728 2013-04-03 Jason Merrill <jason@redhat.com>
730 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
731 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
732 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
734 * mangle.c (write_type): When writing a function type with
735 function-cv-quals, don't add the unqualified type as a
736 substitution candidate.
738 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
741 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
744 2013-04-03 Jakub Jelinek <jakub@redhat.com>
747 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
748 from args to new_args.
749 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
750 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
752 2013-04-02 Jason Merrill <jason@redhat.com>
755 * mangle.c (write_function_type): Mangle ref-qualifier.
756 (write_nested_name): Likewise.
757 (canonicalize_for_substitution): Preserve ref-qualifier.
758 (write_type): Likewise.
761 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
763 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
765 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
766 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
767 (for_each_template_parm_r): Use TYPE_TI_ARGS.
769 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
771 * cp-tree.h (TAGGED_TYPE_P): Remove.
772 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
773 (TYPE_ANONYMOUS_P): Adjust.
774 * call.c (build_new_op_1): Likewise.
775 * class.c (find_abi_tags_r): Likewise.
776 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
777 type_is_deprecated): Likewise.
778 * decl2.c (grokfield, min_vis_r): Likewise.
779 * pt.c (get_template_info): Likewise.
780 * tree.c (handle_abi_tag_attribute): Likewise.
782 2013-04-01 Jason Merrill <jason@redhat.com>
784 * semantics.c (maybe_constant_value): Check
785 instantiation_dependent_expression_p.
786 * pt.c (build_non_dependent_expr): Don't check it here.
789 * init.c (build_new): Don't try to process an array initializer
790 at template definition time.
793 * typeck.c (finish_class_member_access_expr): Handle enum scope.
796 * parser.c (cp_parser_range_for): Don't try to do auto deduction
797 in a template if the type of the range is incomplete.
799 * call.c (add_function_candidate): Take the address of 'this' here.
800 (build_over_call): And here.
801 (build_new_method_call_1, build_op_call_1): Not here.
802 (build_user_type_conversion_1): Or here.
803 (add_candidates): Adjust.
805 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
806 * class.c (same_signature_p): Use type_memfn_quals.
807 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
808 FUNCTION_OR_METHOD_TYPE_CHECK.
809 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
810 * pt.c (unify): Use static_fn_type.
812 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
813 Jason Merrill <jason@redhat.com>
815 Implement N2439 (ref-qualifiers for 'this')
816 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
817 (FUNCTION_RVALUE_QUALIFIED): New.
818 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
819 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
820 (cp_ref_qualifier): New enum.
821 (cp_declarator): Add ref_qualifier.
822 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
823 (cp_parser_direct_declarator): Use it.
824 (make_call_declarator): Adjust.
825 (cp_parser_lambda_declarator_opt): Adjust.
826 * call.c (add_function_candidate): Handle ref-qualifier overload
827 resolution semantics.
828 (standard_conversion): Adjust.
829 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
830 * decl.c (grokdeclarator): Handle ref-qualifiers.
831 (grokfndecl): Check for invalid ref-qualifiers.
832 (static_fn_type, revert_static_member_fn): Adjust.
833 * decl2.c (build_memfn_type): Handle ref-qualifiers.
834 (check_classfn): Check them.
835 (cp_reconstruct_complex_type): Retain them.
836 * error.c (dump_ref_qualifier): New.
837 (dump_type_suffix, dump_function_decl): Use it.
838 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
839 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
840 (unify): Retain them.
841 * tree.c (cp_check_qualified_type): New.
842 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
843 (build_ref_qualified_type): New.
844 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
845 (cp_build_type_attribute_variant): Keep ref-qualifier.
846 * typeck.c (merge_types): Keep ref-qualifier.
847 (structural_comptypes): Compare ref-qualifier.
848 (type_memfn_rqual): New.
849 (apply_memfn_quals): Take ref-qual argument.
850 * typeck2.c (build_m_component_ref): Check ref-qualifier.
852 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
854 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
855 (DECL_FUNCTION_TEMPLATE_P): Adjust.
857 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
858 pp_cxx_qualified_id): Use get_containing_scope.
859 * parser.c (cp_parser_class_head): Likewise.
860 * pt.c (push_template_decl_real): Likewise.
862 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
863 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
865 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
867 * decl2.c (collect_candidates_for_java_method_aliases): Use
869 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
870 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
871 * decl.c (duplicate_decls): Likewise.
872 * parser.c (cp_parser_template_declaration_after_export): Likewise,
873 also DECL_DECLARES_TYPE_P.
874 * pt.c (instantiate_class_template_1): Likewise.
875 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
876 (lookup_field_r): Likewise.
877 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
878 (lookup_fnfields_slot_nolazy): Likewise.
879 * semantics.c (finish_member_declaration): Likewise.
880 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
882 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
884 * pt.c (template_parms_to_args): Fix typo in comment.
886 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
888 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
890 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
892 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
893 (build_op_call_1): Likewise.
894 (build_over_call): Likewise.
895 (compare_ics): Likewise.
896 * class.c (build_base_path): Likewise.
897 (resolve_address_of_overloaded_function): Likewise.
898 * cp-tree.h: Likewise.
899 * cvt.c (cp_convert_to_pointer): Likewise.
900 (convert_to_reference): Likewise.
901 (ocp_convert): Likewise.
902 (convert_force): Likewise, tidy.
903 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
904 (pp_cxx_ptr_operator): Likewise.
905 * decl.c (duplicate_decls): Likewise.
906 (start_decl): Likewise.
907 (grok_op_properties): Likewise.
908 (start_preparsed_function): Likewise.
909 (store_parm_decls): Likewise.
910 (finish_function): Likewise.
911 * decl2.c (delete_sanity): Likewise.
912 (acceptable_java_type): Likewise.
913 (grokbitfield): Likewise.
914 (cp_reconstruct_complex_type): Likewise.
915 * error.c (dump_type_prefix): Likewise.
916 (dump_expr): Likewise.
917 * except.c (push_eh_cleanup): Likewise.
918 (complete_ptr_ref_or_void_ptr_p): Likewise.
919 (can_convert_eh): Likewise.
920 * init.c (build_new_1): Likewise.
921 (build_delete): Likewise.
922 (build_vec_delete): Likewise.
923 * mangle.c (write_type): Likewise.
924 * parser.c (lookup_literal_operator): Likewise.
925 * pt.c (convert_nontype_argument_function): Likewise.
926 (convert_nontype_argument): Likewise.
929 (dependent_type_p_r): Likewise.
930 * rtti.c (build_headof): Likewise.
931 (build_typeid): Likewise.
932 (build_dynamic_cast_1): Likewise.
933 (target_incomplete_p): Likewise.
934 (typeinfo_in_lib_p): Likewise.
935 * semantics.c (finish_omp_for): Likewise.
936 (cxx_eval_call_expression): Likewise.
937 (maybe_resolve_dummy): Likewise.
938 * tree.c (build_target_expr): Likewise.
939 (cp_build_qualified_type_real): Likewise.
940 * typeck.c (composite_pointer_type_r): Likewise.
941 (composite_pointer_type): Likewise.
942 (comp_except_types): Likewise.
943 (cxx_sizeof_nowarn): Likewise.
944 (string_conv_p): Likewise.
945 (cp_build_array_ref): Likewise.
946 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
947 (pointer_diff): Likewise.
948 (cp_build_addr_expr_1): Likewise.
949 (cp_build_unary_op): Likewise.
950 (build_static_cast_1): Likewise.
951 (cp_build_c_cast): Likewise.
952 (comp_ptr_ttypes_real): Likewise.
953 (ptr_reasonably_similar): Likewise.
954 (comp_ptr_ttypes_const): Likewise.
955 (casts_away_constness): Likewise.
956 (check_literal_operator_args): Likewise.
957 * typeck2.c (build_x_arrow): Likewise.
958 (add_exception_specifier): Likewise.
960 2013-03-29 Jason Merrill <jason@redhat.com>
963 * cp-tree.h (AUTO_IS_DECLTYPE): New.
964 * parser.c (cp_parser_decltype): Handle decltype(auto).
965 (cp_parser_type_id_1): Allow auto without a late-specified
967 (cp_parser_primary_expression): Use the return value of
968 finish_parenthesized_expr.
969 (cp_parser_transaction_expression): Likewise.
970 * semantics.c (force_paren_expr): New.
971 (finish_parenthesized_expr): Use it.
972 * call.c (build_conditional_expr_1): Likewise.
973 * pt.c (do_auto_deduction): Handle decltype(auto).
974 (tsubst_copy): Handle PAREN_EXPR.
975 (tsubst_copy_and_build): Likewise.
976 * error.c (dump_expr): Handle PAREN_EXPR.
977 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
978 * mangle.c (write_expression): Ignore PAREN_EXPR.
980 * parser.c (cp_parser_decltype_expr): Split out...
981 (cp_parser_decltype): ...from here.
985 * pt.c (unify_pack_expansion): Fix indexing.
987 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
989 * call.c (build_java_interface_fn_ref): Likewise.
990 (make_temporary_var_for_ref_to_temp): Likewise.
991 * class.c (check_field_decls): Likewise.
992 (layout_class_type): Likewise.
993 (finish_struct_1): Likewise.
994 (fixed_type_or_null): Likewise.
995 (get_vtbl_decl_for_binfo): Likewise.
996 * cp-gimplify.c (omp_var_to_track): Likewise.
997 (cp_genericize_r): Likewise.
998 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
999 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
1000 (DECL_DISCRIMINATOR_P): Likewise.
1001 * decl.c (poplevel): Likewise.
1002 (decls_match): Likewise.
1003 (duplicate_decls): Likewise.
1004 (decl_jump_unsafe): Likewise.
1005 (start_decl): Likewise.
1006 (check_for_uninitialized_const_var): Likewise.
1007 (make_rtl_for_nonlocal_decl): Likewise.
1008 (cp_finish_decl): Likewise.
1009 (expand_static_init): Likewise.
1010 (local_variable_p): Likewise.
1011 (maybe_register_incomplete_var): Likewise.
1012 * decl2.c (grokfield): Likewise.
1013 (comdat_linkage): Likewise.
1014 (determine_visibility): Likewise.
1015 (import_export_decl): Likewise.
1016 (prune_vars_needing_no_initialization): Likewise.
1017 (decl_maybe_constant_var_p): Likewise.
1018 * error.c (dump_simple_decl): Likewise.
1019 (dump_template_decl): Likewise.
1020 (cp_printer): Likewise.
1021 * except.c (build_throw): Likewise.
1022 * init.c (build_vtbl_address): Likewise.
1023 (member_init_ok_or_else): Likewise.
1024 (build_aggr_init): Likewise.
1025 (expand_aggr_init_1): Likewise.
1026 (build_offset_ref): Likewise.
1027 (constant_value_1): Likewise.
1028 * mangle.c (write_mangled_name): Likewise.
1029 (write_prefix): Likewise.
1030 * name-lookup.c (supplement_binding_1): Likewise.
1031 (add_decl_to_level): Likewise.
1032 (pushdecl_maybe_friend_1): Likewise.
1033 (check_for_out_of_scope_variable): Likewise.
1034 (validate_nonmember_using_decl): Likewise.
1035 (lookup_name_innermost_nonclass_level_1): Likewise.
1036 (lookup_arg_dependent_1): Likewise.
1037 * parser.c (cp_parser_lambda_introducer): Likewise.
1038 (cp_parser_template_argument): Likewise.
1039 (cp_parser_single_declaration): Likewise.
1040 * pt.c (convert_nontype_argument): Likewise.
1041 (instantiate_class_template_1): Likewise.
1042 (tsubst_decl): Likewise.
1043 (tsubst_expr): Likewise.
1044 (do_decl_instantiation): Likewise.
1045 (do_type_instantiation): Likewise.
1046 (regenerate_decl_from_template): Likewise.
1047 (always_instantiate_p): Likewise.
1048 (instantiate_decl): Likewise.
1049 (type_dependent_expression_p): Likewise.
1050 (build_non_dependent_expr): Likewise.
1051 * repo.c (repo_emit_p): Likewise.
1052 * rtti.c (build_dynamic_cast_1): Likewise.
1053 * search.c (shared_member_p): Likewise.
1054 * semantics.c (outer_var_p): Likewise.
1055 (finish_id_expression): Likewise.
1056 (finish_omp_clauses): Likewise.
1057 (finish_decltype_type): Likewise.
1058 (ensure_literal_type_for_constexpr_object): Likewise.
1059 * tree.c (lvalue_kind): Likewise.
1060 (bot_replace): Likewise.
1061 (cp_tree_equal): Likewise.
1062 (handle_init_priority_attribute): Likewise.
1063 (decl_storage_duration): Likewise.
1064 * typeck.c (cxx_sizeof_expr): Likewise.
1065 (cxx_alignof_expr): Likewise.
1066 (decay_conversion): Likewise.
1067 (build_class_member_access_expr): Likewise.
1068 (cp_build_array_ref): Likewise.
1069 (cxx_mark_addressable): Likewise.
1070 (maybe_warn_about_returning_address_of_local): Likewise.
1071 (check_return_expr): Likewise.
1072 * typeck2.c (cxx_readonly_error): Likewise.
1073 (abstract_virtuals_error_sfinae): Likewise.
1074 (cxx_incomplete_type_diagnostic): Likewise.
1076 2013-03-28 Lawrence Crowl <crowl@google.com>
1079 (CXX_PARSER_H): Add header dependence.
1081 (extern debug (cp_binding_level &)): New.
1082 (extern debug (cp_binding_level *)): New.
1084 (debug (cp_binding_level &)): New.
1085 (debug (cp_binding_level *)): New.
1087 (debug (cp_parser &)): New.
1088 (debug (cp_parser *)): New.
1089 (debug (cp_token &)): New.
1090 (debug (cp_token *)): New.
1091 (debug (vec<cp_token, va_gc> &)): New.
1092 (debug (vec<cp_token, va_gc> *)): New.
1093 * parser.c: Add header dependence.
1094 (extern debug (cp_parser &)): New.
1095 (extern debug (cp_parser *)): New.
1096 (extern debug (cp_token &)): New.
1097 (extern debug (cp_token *)): New.
1098 (extern debug (vec<cp_token, va_gc> &)): New.
1099 (extern debug (vec<cp_token, va_gc> *)): New.
1101 2013-03-28 Jason Merrill <jason@redhat.com>
1105 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
1106 the type if tf_decltype is set.
1107 * pt.c (fn_type_unification): Add decltype_p parm.
1108 (get_bindings): Adjust.
1109 * cp-tree.h: Adjust.
1110 * class.c (resolve_address_of_overloaded_function): Adjust.
1111 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
1114 * parser.c (cp_parser_sizeof_pack): Split out from...
1115 (cp_parser_sizeof_operand): ...here. Require (id).
1118 * semantics.c (finish_this_expr): 'this' is an rvalue.
1119 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
1122 * semantics.c (finish_member_declaration): Don't push closure
1125 * name-lookup.c (pushdecl_maybe_friend_1): Use
1126 nonlambda_method_basetype and current_nonlambda_class_type.
1129 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
1130 conversion from integer to pointer.
1131 (cxx_eval_constant_expression): Likewise.
1132 (cxx_eval_indirect_ref): Use the folded operand if we still think
1133 this might be constant.
1135 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1136 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1139 * call.c (convert_like_real): Change series of two permerrors
1140 to permerror + inform (and likewise for two errors).
1141 (build_new_method_call_1): Likewise.
1142 * typeck.c (convert_for_initialization): Change additional
1143 warning or error to inform.
1145 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1147 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
1148 (first_aggr_init_expr): Likewise.
1149 (more_aggr_init_expr_args_p): Likewise.
1150 (type_of_this_parm): Likewise.
1151 (class_of_this_parm): Likewise.
1152 * name-lookup.h (get_global_value_if_present): Likewise.
1153 (is_typename_at_global_scope): Likewise.
1155 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1157 * call.c (joust): Don't call inform for a permerror returning false.
1158 * parser.c (cp_parser_check_class_key): Likewise.
1159 * pt.c (tsubst_copy_and_build): Likewise.
1161 2013-03-27 Jason Merrill <jason@redhat.com>
1164 * semantics.c (finish_qualified_id_expr): Return early
1167 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1169 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1170 * cvt.c (convert_to_void): Likewise.
1171 * error.c (dump_expr): Likewise.
1172 * mangle.c (write_expression): Likewise.
1173 * parser.c (cp_parser_template_argument): Likewise.
1174 * pt.c (convert_nontype_argument): Likewise.
1175 (tsubst_copy_and_build): Likewise.
1176 * rtti.c (build_typeid): Likewise.
1177 * semantics.c (finish_call_expr): Likewise.
1178 (finish_decltype_type): Likewise.
1179 (build_data_member_initialization): Likewise.
1180 * tree.c (is_dummy_object): Likewise.
1181 * typeck.c (decay_conversion): Likewise.
1182 (build_class_member_access_expr): Likewise.
1183 (cp_build_addr_expr_1): Likewise.
1184 (unary_complex_lvalue): Likewise.
1185 (check_return_expr): Likewise.
1186 * typeck2.c (cxx_readonly_error): Likewise.
1188 2013-03-26 Jason Merrill <jason@redhat.com>
1191 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
1192 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
1193 * cp-tree.h: Adjust prototype.
1196 * typeck2.c (build_m_component_ref): Handle prvalue object.
1198 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1200 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
1201 * decl.c (duplicate_decls): Likewise.
1202 (cp_finish_decl): Likewise.
1203 (check_class_member_definition_namespace): Likewise.
1204 * decl2.c (grokfield): Likewise.
1205 (decl_needed_p): Likewise.
1206 (import_export_decl): Likewise.
1207 (mark_used): Likewise.
1208 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1209 * pt.c (push_access_scope): Likewise.
1210 (instantiate_decl): Likewise.
1211 * ptree.c (cxx_print_decl): Likewise.
1212 * repo.c (repo_emit_p): Likewise.
1213 * semantics.c (note_decl_for_pch): Likewise.
1214 * tree.c (decl_linkage): Likewise.
1216 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1219 * decl.c (check_array_designated_initializer): Handle CONST_DECL
1222 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1224 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1227 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1229 2013-03-25 Jason Merrill <jason@redhat.com>
1232 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1233 class is derived from the type of the object.
1236 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1237 unevaluated context.
1239 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
1242 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1243 DECL_TEMPLATE_INSTANTIATION.
1245 2013-03-22 Jason Merrill <jason@redhat.com>
1248 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1251 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
1253 * cp-tree.h (identifier_p): New.
1254 * call.c: Throughout, call identifier_p insstead of direct
1255 comparaison of TREE_CODE against IDENTIFIER_NODE.
1256 * decl.c: Likewisse.
1257 * decl2.c: Likewise.
1259 * mangle.c: Likewise.
1260 * name-lookup.c: Likewise.
1261 * parser.c: Likewise.
1263 * search.c: Likewise.
1264 * semantics.c: Likewise.
1266 * typeck.c: Likewise.
1267 * typeck2.c: Likewise.
1269 2013-03-21 Jakub Jelinek <jakub@redhat.com>
1272 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1273 * call.c (build_temp): Likewise.
1274 * method.c (synthesize_method): Likewise.
1275 * typeck.c (convert_for_initialization): Likewise.
1277 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
1279 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
1281 2013-03-21 Richard Biener <rguenther@suse.de>
1283 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
1284 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
1286 2013-03-20 Jason Merrill <jason@redhat.com>
1289 * parser.c (cp_parser_late_return_type_opt): Save and restore
1290 current_class_ptr/ref.
1293 * expr.c (cplus_expand_constant): Do nothing if the class is
1295 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1296 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1297 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1298 (complete_vars): Likewise.
1300 * name-lookup.c (get_anonymous_namespace_name): Never use
1301 get_file_function_name.
1303 * pt.c (retrieve_specialization): Handle null tmpl argument.
1307 * pt.c (tsubst_decl): Check return value of register_specialization.
1308 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1311 2013-03-17 Jason Merrill <jason@redhat.com>
1315 * parser.c (cp_parser_direct_declarator): Bail if we see a
1316 qualified-id not at namespace scope.
1320 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1323 2013-03-16 Jason Merrill <jason@redhat.com>
1325 * decl.c (grokdeclarator): Assert that we won't see a pointer to
1329 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1330 (MAYBE_CLASS_TYPE_P): ...here.
1331 * semantics.c (lambda_capture_field_type): Only build a
1332 magic decltype for wildcard types.
1333 (lambda_proxy_type): Likewise.
1334 (finish_non_static_data_member): Get the quals from
1338 * parser.c (cp_parser_template_argument): Don't
1339 fold_non_dependent_expr.
1341 * parser.c (cp_parser_lambda_declarator_opt): Use
1342 cp_parser_trailing_type_id.
1345 * parser.c (cp_parser_template_id): Don't forget access checks.
1348 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1352 * name-lookup.h (tag_scope): Add ts_lambda.
1353 * semantics.c (begin_lambda_type): Use it.
1354 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1355 * pt.c (check_default_tmpl_args): Ignore lambdas.
1356 (push_template_decl_real): Handle lambdas.
1357 * tree.c (no_linkage_check): Adjust lambda check.
1360 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1363 * parser.c (cp_parser_direct_declarator): Fix late return
1364 for out-of-class defn of member function.
1367 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1368 parms to avoid duplicate -Wshadow warnings.
1370 * search.c (lookup_base): Handle NULL_TREE.
1373 * semantics.c (potential_constant_expression_1): Use of 'this' in
1374 a non-constexpr function makes the expression not potentially
1379 * cp-tree.h (tsubst_flags): Add tf_decltype.
1380 * call.c (build_cxx_call): Don't build a temporary if it's set.
1381 (build_over_call): Make sure it's only passed to build_cxx_call.
1382 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1383 (cp_parser_unary_expression): Likewise.
1384 (cp_parser_cast_expression): Likewise.
1385 (cp_parser_binary_expression): Likewise.
1386 (cp_parser_assignment_expression): Likewise.
1387 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
1388 (cp_parser_expression): Add decltype_p. Force a
1389 temporary for a call on the LHS of a comma.
1390 (cp_parser_decltype): Pass true to decltype_p parms.
1391 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1392 (tsubst_copy_and_build): Pass tf_decltype down only for
1393 CALL_EXPR and the RHS of COMPOUND_EXPR.
1394 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1396 * cp-tree.h (abstract_class_use): New enum.
1397 * typeck2.c (pending_abstract_type): Add use field.
1398 (abstract_virtuals_error_sfinae): Add overloads taking
1399 abstract_class_use instead of tree.
1400 * typeck.c (build_static_cast_1): Call it.
1401 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1402 * pt.c: Adjust calls.
1403 * decl.c (cp_finish_decl): Don't handle functions specially.
1404 (grokdeclarator): Always check return type.
1405 * init.c (build_new_1): Adjust call.
1409 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1410 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1413 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1414 (tsubst_arg_types): Likewise.
1418 * call.c (convert_like_real): Check for explicit constructors
1419 even for value-initialization.
1422 * pt.c (convert_nontype_argument): Handle invalid pointer.
1424 * parser.c (cp_parser_lambda_expression): Use nreverse.
1428 * pt.c (instantiate_class_template_1): Instantiate lambda capture
1430 (tsubst_copy_and_build): Not here.
1433 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1436 * parser.c (parsing_nsdmi): New.
1437 * semantics.c (outer_automatic_var_p): Check it.
1438 (finish_id_expression): Likewise.
1439 * cp-tree.h: Declare it.
1442 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1444 * parser.c (lookup_literal_operator): Correct parm/arg naming
1448 * pt.c (fold_non_dependent_expr_sfinae): Check
1449 instantiation_dependent_expression_p.
1452 * class.c (resolve_address_of_overloaded_function): Accept a
1453 reference to function for target_type.
1454 (instantiate_type): Likewise.
1455 * pt.c (convert_nontype_argument): Pass it to
1456 convert_nontype_argument_function.
1458 2013-03-16 Jakub Jelinek <jakub@redhat.com>
1460 * tree.c (cp_tree_equal): Fix a pasto.
1463 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1464 pass op1 through maybe_constant_value first.
1466 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
1469 * semantics.c (cxx_eval_array_reference): Check for negative index.
1471 2013-03-14 Jason Merrill <jason@redhat.com>
1474 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1477 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1478 dso_handle parm on targets without __cxa_atexit.
1480 2013-03-11 Jason Merrill <jason@redhat.com>
1483 * typeck.c (check_return_expr): Disallow returning init list here.
1484 * semantics.c (apply_deduced_return_type): Not here.
1486 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1489 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1490 * error.c (dump_expr): Likewise.
1492 2013-03-08 Jason Merrill <jason@redhat.com>
1495 * class.c (modify_all_vtables): Mangle the vtable name before
1498 * semantics.c (lambda_expr_this_capture): In unevaluated context,
1499 just return the nearest 'this'.
1504 * tree.c (maybe_dummy_object): Don't capture 'this'.
1505 * semantics.c (maybe_resolve_dummy): New.
1506 (finish_non_static_data_member): Use it.
1507 (finish_qualified_id_expr): Don't test is_dummy_object.
1508 * cp-tree.h: Declare maybe_resolve_dummy.
1509 * call.c (build_new_method_call_1): Use it.
1512 * semantics.c (apply_deduced_return_type): Don't allow returning
1513 std::initializer_list.
1515 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1518 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1519 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1520 * decl.c (check_elaborated_type_specifier): Tidy.
1522 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1525 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1527 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1529 * parser.c (cp_parser_braced_list): For {} initialize
1530 *non_constant_p to false.
1532 2013-03-04 Jason Merrill <jason@redhat.com>
1536 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1537 and non-class scopes.
1539 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1541 * decl.c (grokdeclarator): Remove dead code.
1543 2013-02-28 Jason Merrill <jason@redhat.com>
1546 * semantics.c (potential_constant_expression_1): Use
1547 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1550 * call.c (build_over_call): Avoid virtual lookup in a template.
1552 2013-02-27 Jason Merrill <jason@redhat.com>
1556 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1557 of the base name for inheriting ctors.
1558 (push_class_level_binding_1): Remove inheriting ctor handling.
1559 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1560 * class.c (add_implicitly_declared_members): Adjust.
1562 2013-02-26 David Binderman <dcb314@hotmail.com>
1565 * decl.c (grokdeclarator): Tidy publicp assignment.
1567 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1570 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1571 (build_transaction_expr): Same.
1573 2013-02-25 Jason Merrill <jason@redhat.com>
1576 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1577 we know what args we're looking at.
1580 * semantics.c (potential_constant_expression_1): In C++98, a cast
1581 to non-integral type can't be a constant expression.
1583 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1586 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1589 2013-02-22 Jason Merrill <jason@redhat.com>
1592 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1593 if we got the wrong number of template parms.
1596 * pt.c (fn_type_unification): Use explicit args in template
1597 instantiation context.
1600 * call.c (can_convert_arg): Discard access checks.
1603 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1606 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1609 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1610 * cvt.c (ocp_convert): Use the latter.
1611 (cp_convert_to_pointer): Likewise.
1612 * decl.c (check_default_argument): Likewise.
1613 * typeck.c (cp_build_binary_op): Likewise.
1614 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1616 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1617 Paolo Carlini <paolo.carlini@oracle.com>
1620 * decl2.c (grokbitfield): Allow scoped enumeration types.
1622 2013-02-15 Jason Merrill <jason@redhat.com>
1625 * semantics.c (finish_id_expression): Also return the identifier
1626 for an outer local static.
1629 * class.c (check_bases_and_members): Deduce noexcept after
1633 * semantics.c (finish_id_expression): In a template, return
1634 the identifier for a constant variable.
1636 2013-02-14 Jason Merrill <jason@redhat.com>
1639 * semantics.c (build_anon_member_initialization): New.
1640 (build_data_member_initialization): Use it.
1643 * decl.c (cp_finish_decl): Force instantiation of an
1644 auto static data member.
1647 * pt.c (unify): A pack expansion that is not the last template
1648 argument makes the entire template argument list non-deduced.
1651 * name-lookup.c (do_class_using_decl): Handle typedefs with
1652 inheriting constructors.
1653 (push_class_level_binding_1): Allow inheriting from template
1654 template parameter, too.
1655 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1658 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1659 default argument scope.
1660 * mangle.c (write_name): Likewise.
1663 * error.c (find_typenames_r): Don't walk into a pack expansion.
1665 2013-02-13 Jason Merrill <jason@redhat.com>
1668 * parser.c (cp_parser_member_declaration): Check the declarator
1669 form when detecting a function declaration via typedef.
1672 * pt.c (maybe_process_partial_specialization): A lambda
1673 isn't what's being specialized.
1676 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1680 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1683 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1684 non-zero offsets, too.
1687 * decl.c (build_enumerator): Always convert the value to a
1688 fixed underlying type.
1691 * pt.c (tsubst_copy_and_build): Don't forget any new
1692 captures that arose from use of dependent names.
1694 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1697 * semantics.c (finish_asm_stmt): If input constraints allow
1698 neither register nor memory, try maybe_constant_value to get
1699 a constant if possible.
1701 2013-02-12 Jason Merrill <jason@redhat.com>
1704 * method.c (add_one_base_init): Handle base constructor
1705 taking rvalue reference parm.
1708 * semantics.c (sort_constexpr_mem_initializers): Handle
1711 2013-02-09 Jason Merrill <jason@redhat.com>
1714 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1715 maybe_instantiate_noexcept.
1718 * pt.c (eq_specializations): Set comparing_specializations.
1719 * tree.c (cp_tree_equal): Check it.
1720 * cp-tree.h: Declare it.
1722 * decl.c (decls_match): Check versions later.
1725 * pt.c (build_non_dependent_expr): Don't try to fold
1726 instantiation-dependent expressions.
1727 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1728 [BIND_EXPR]: Treat as dependent.
1730 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1733 * init.c (build_vec_init): Don't append NULL values into new_vec.
1734 (build_zero_init_1): Don't push anything into v if recursive call
1736 (build_value_init_noctor): Don't push anything into v if
1737 build_value_init call returned NULL_TREE.
1740 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1741 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1742 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1743 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1744 (cp_parser_cast_expression): Adjust caller.
1747 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1748 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1749 DECL_LANG_SPECIFIC (t).
1751 2013-02-07 Jason Merrill <jason@redhat.com>
1754 * method.c (do_build_copy_constructor): Don't bother turning
1755 scalars from lvalues to xvalues.
1756 (do_build_copy_assign): Likewise.
1758 2013-02-06 Jason Merrill <jason@redhat.com>
1760 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1762 2013-02-05 Jason Merrill <jason@redhat.com>
1765 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1769 * decl.c (start_preparsed_function): Update restype if we change
1773 * pt.c (fn_type_unification): Discard any access checks from
1774 substituting explicit args.
1776 2013-01-31 Jason Merrill <jason@redhat.com>
1780 * typeck.c (get_member_function_from_ptrfunc): Fix
1781 ptrmemfunc_vbit_in_delta case.
1783 2013-01-29 Jason Merrill <jason@redhat.com>
1786 * class.c (build_ctor_vtbl_group): Give construction vtables
1789 2013-01-25 Jason Merrill <jason@redhat.com>
1792 * pt.c (convert_nontype_argument_function): Handle invalid input.
1793 (convert_nontype_argument): Likewise.
1796 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1797 dynamic type has no virtual functions.
1799 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1802 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1803 on TARGET_EXPR nodes.
1805 2013-01-22 Jason Merrill <jason@redhat.com>
1808 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1810 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1813 * pt.c (argument_pack_element_is_expansion_p)
1814 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1815 (gen_elem_of_pack_expansion_instantiation): New static functions.
1816 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1817 look through the possibly resulting pack expansion as well.
1818 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1819 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1820 Use gen_elem_of_pack_expansion_instantiation to build the
1821 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1822 as gen_elem_of_pack_expansion_instantiation and the change in
1823 tsubst above generalize this particular case.
1824 (arg_from_parm_pack_p): Remove this for it's not used by
1825 tsubst_pack_expansion anymore.
1827 2013-01-21 Jason Merrill <jason@redhat.com>
1830 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1831 template args count.
1833 2013-01-18 Jason Merrill <jason@redhat.com>
1836 * decl2.c (get_local_tls_init_fn): New.
1837 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1838 with aliases for internal variables. Don't use weakrefs if
1839 the variable needs destruction.
1840 (generate_tls_wrapper): Mark the wrapper as const if no
1841 initialization is needed.
1842 (handle_tls_init): Don't require aliases.
1844 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1847 * pt.c (coerce_innermost_template_parms): New static function.
1848 (instantiate_alias_template): Use it here.
1850 2013-01-09 Jason Merrill <jason@redhat.com>
1853 * rtti.c (build_typeid, get_typeid): Add complain parm.
1854 (get_tinfo_decl_dynamic): Likewise.
1855 * cp-tree.h, parser.c, pt.c: Adjust.
1858 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1861 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1864 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1865 call maybe_constant_value for the negative or too big shift
1868 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1871 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1872 of the argument is true.
1874 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1876 * parser.c (cp_parser_initializer_list): Move declaration
1877 of variable non_const to start of lexical block.
1879 2013-01-07 Jason Merrill <jason@redhat.com>
1882 * tree.c (build_aggr_init_expr): Do nothing in a template.
1883 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1884 a FUNCTION_DECL before tsubsting.
1886 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1889 * pt.c (check_instantiated_arg): Allow type template arguments.
1891 2013-01-04 Jason Merrill <jason@redhat.com>
1894 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1895 (grokdeclarator): Use reset_type_linkage.
1896 * name-lookup.c (binding_table_foreach): Handle null table.
1897 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1899 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1901 PR c++/54526 (again)
1902 * parser.c (cp_parser_template_id): Revert core of previous change
1903 (keep adjusted inform message).
1905 2013-01-03 Jason Merrill <jason@redhat.com>
1909 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1913 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1916 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1919 * call.c (type_has_extended_temps): New.
1920 * cp-tree.h: Declare it.
1921 * decl.c (check_initializer): Use build_aggr_init for arrays
1923 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1925 2013-01-02 Jason Merrill <jason@redhat.com>
1928 * call.c (build_new_method_call_1): Don't use build_value_init for
1929 user-provided default constructors.
1931 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1935 * tree.c (build_cplus_array_type): Copy layout information
1936 to main variant if necessary.
1938 Copyright (C) 2013 Free Software Foundation, Inc.
1940 Copying and distribution of this file, with or without modification,
1941 are permitted in any medium without royalty provided the copyright
1942 notice and this notice are preserved.