1 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
4 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
5 warnings about defaulted functions.
7 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
9 * call.c (build_conditional_expr_1): Add location_t parameter.
10 (build_conditional_expr): Likewise.
11 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
12 get_member_function_from_ptrfunc, build_x_conditional_expr,
13 cp_build_modify_expr): Update.
14 * init.c (build_new_1): Likewise.
15 * cp-tree.h: Update declaration.
17 2013-05-20 Jason Merrill <jason@redhat.com>
20 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
24 * decl.c (fndecl_declared_return_type): Also look in
25 DECL_SAVED_FUNCTION_DATA.
27 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
30 * parser.c (cp_parser_parameter_declaration): Check return value
31 of cp_parser_parse_and_diagnose_invalid_type_name.
33 2013-05-20 Jason Merrill <jason@redhat.com>
36 * class.c (vbase_has_user_provided_move_assign): New.
37 * method.c (synthesized_method_walk): Check it.
38 * cp-tree.h: Declare it.
41 * tree.c (build_cplus_array_type): Copy layout info if element
44 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
47 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
49 2013-05-20 Jason Merrill <jason@redhat.com>
52 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
53 whether a template has its own args.
55 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
58 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
60 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
63 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
64 instead of cp_parser_initializer_list for compound-literals.
66 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
69 * typeck.c (check_return_expr): Reverse the alignment comparison.
71 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
74 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
75 correctly sizeof compound-literal; update comments.
77 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
79 * call.c (build_conditional_expr_1): Use cp_build_binary_op
80 instead of directly calling fold_build2.
82 2013-05-16 Jason Merrill <jason@redhat.com>
84 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
87 * decl.c (grokdeclarator): Allow member function qualifiers in
88 TYPENAME context in C++11 mode.
90 2013-05-16 Dodji Seketeli <dodji@redhat.com>
92 PR c++/56782 - Regression with empty pack expansions
93 * pt.c (use_pack_expansion_extra_args_p): When at least a
94 parameter pack has an empty argument pack, and another parameter
95 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
98 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
100 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
101 warning_at and permerror with warning_at/inform and permerror/
102 inform, respectively.
104 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
107 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
110 2013-05-14 Jason Merrill <jason@redhat.com>
113 * parser.c (cp_parser_range_for): Call complete_type.
116 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
118 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
121 * method.c (defaulted_late_check): Check for compatible exception
122 specification out of class explicitly defaulted functions too.
124 2013-05-14 Jason Merrill <jason@redhat.com>
127 * semantics.c (potential_constant_expression_1): Make sure the
128 called function is potentially constant.
129 * call.c (null_ptr_cst_p): Revert earlier change.
131 2013-05-13 Jason Merrill <jason@redhat.com>
134 * call.c (null_ptr_cst_p): An expression with side-effects can't
135 be a C++03 null pointer constant.
138 * decl.c (reshape_init_class): Handle error_mark_node.
141 * typeck.c (merge_types): Propagate ref-qualifier
145 * decl.c (grokdeclarator): Apply ref-qualifier
146 in the TYPENAME case.
149 * decl.c (decls_match): Compare ref-qualifiers.
151 2013-05-10 Jason Merrill <jason@redhat.com>
154 * pt.c (convert_template_argument): Use dependent_template_arg_p,
155 not uses_template_parms.
158 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
161 * semantics.c (add_capture): Error rather than abort on copy
163 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
164 warn about capture proxy.
166 2013-05-09 Jason Merrill <jason@redhat.com>
168 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
171 * pt.c (lookup_template_class_1): Handle getting a template
172 template parameter as D1.
174 N3639 C++1y VLA diagnostics
175 * decl.c (grokdeclarator): Complain about reference, pointer, or
177 (create_array_type_for_decl): Complain about array of VLA.
178 * pt.c (tsubst): Likewise.
179 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
180 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
181 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
182 (cxx_sizeof_or_alignof_type): Likewise.
184 N3639 C++1y VLA support
185 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
186 (check_array_initializer): Allow VLA init.
187 (reshape_init_array_1): Adjust.
188 (cp_finish_decl): Check for invalid VLA length.
189 * typeck2.c (process_init_constructor_array): Adjust.
190 (store_init_value): Use build_vec_init for VLAs.
191 * semantics.c (add_capture): Capture VLA as ptr+len.
192 (vla_capture_type): New.
193 (build_capture_proxy): Rebuild the VLA.
194 * typeck.c (build_simple_component_ref): Split out from...
195 (build_ptrmemfunc_access_expr): ...here.
196 * tree.c (array_of_runtime_bound_p): New.
197 * init.c (throw_bad_array_length): New.
198 (build_vec_init): Use it.
199 * parser.c (cp_convert_range_for): When iterating over a VLA,
200 use it directly rather than bind a reference.
201 * cp-tree.h: Declare new functions.
203 2013-05-08 Jason Merrill <jason@redhat.com>
205 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
206 variably_modified_type_p.
207 (expand_start_catch_block): Mark the typeinfo used here.
208 * semantics.c (finish_handler_parms): Not here.
210 * error.c (dump_type_suffix): Try harder on VLA length.
213 * init.c (throw_bad_array_new_length): New.
214 (build_new_1): Use it. Don't warn about braced-init-list.
215 (build_vec_init): Use it.
216 * call.c (build_operator_new_call): Use it.
219 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
220 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
221 * error.c (maybe_warn_cpp0x): s/0x/11/.
223 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
226 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
229 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
231 * typeck.c (cp_build_binary_op): Call save_expr before
232 build_vector_from_val.
234 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
237 * decl.c (cp_finish_decl): After do_auto_deduction copy the
238 qualifers with cp_apply_type_quals_to_decl.
240 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
242 * pt.c (convert_nontype_argument): Add missing whitespace in
245 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
248 * decl.c (build_enumerator): Improve error message.
250 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
253 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
254 messages for template types and fix column numbers.
256 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
259 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
260 c_inhibit_evaluation_warnings around build_x_modify_expr call.
262 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
265 * semantics.c (finish_decltype_type): Handle instantiated template
268 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
271 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
273 2013-04-26 Jakub Jelinek <jakub@redhat.com>
275 * error.c (cp_print_error_function): Adjust file_name_as_prefix
278 2013-04-25 Jason Merrill <jason@redhat.com>
281 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
284 * init.c (perform_member_init): Call reshape_init.
286 2013-04-24 Jason Merrill <jason@redhat.com>
289 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
291 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
293 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
294 pedwarn to simply use OPT_Wpointer_arith.
295 (cp_build_unary_op): Likewise.
297 2013-04-24 Jason Merrill <jason@redhat.com>
299 N3648: init-captures are named.
300 * semantics.c (add_capture): Don't prepend "__" to init-captures.
301 (build_capture_proxy): Adjust.
302 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
304 N3648: Allow braced and parenthesized initializers.
305 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
306 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
307 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
308 (add_capture): Collapse a parenthesized initializer into a single
310 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
312 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
315 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
316 * semantics.c (finish_qualified_id_expr): Likewise.
317 (finish_id_expression): Update.
318 * typeck.c (cp_build_addr_expr_1): Likewise.
319 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
320 * cp-tree.h: Update declarations.
322 2013-04-22 Jason Merrill <jason@redhat.com>
325 * parser.c (cp_parser_unqualified_id): Handle ~auto.
326 (cp_parser_pseudo_destructor_name): Likewise.
327 (cp_parser_postfix_dot_deref_expression): Adjust.
328 (cp_lexer_nth_token_is_keyword): New.
329 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
330 * typeck.c (lookup_destructor): Handle ~auto.
332 * pt.c (fn_type_unification): Push tinst level around
333 type_unification_real if we aren't explaining.
334 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
335 * error.c (dump_function_decl): Respect it.
336 (subst_to_string): Pass it.
339 * rtti.c (get_typeid): Diagnose qualified function type.
340 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
342 * error.c (dump_aggr_type): Fix lambda detection.
343 (dump_simple_decl): Pretty-print capture field.
346 * cvt.c (build_expr_type_conversion): Two conversions that return
347 the same type aren't necessarily ambiguous.
350 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
351 pedwarn unconditional except in C++1y mode.
353 * semantics.c (potential_constant_expression_1): Don't crash on
357 * semantics.c (finish_id_expression): Reject capture of anonymous
361 * decl2.c (check_default_args): Check for pack expansion.
363 * mangle.c (write_type): Mangle decltype(auto).
365 2013-04-19 Jason Merrill <jason@redhat.com>
367 N3638 changes to return type deduction
368 * decl.c (undeduced_auto_decl): New.
369 (require_deduced_type): New.
370 (fndecl_declared_return_type): New.
371 (decls_match): Use it.
372 (duplicate_decls): Don't check for auto return.
373 (grokdeclarator): Reject virtual auto.
374 * class.c (resolve_address_of_overloaded_function): Handle
375 auto function templates.
376 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
377 * cp-tree.h: Declare new fns.
378 * error.c (dump_function_decl): Use fndecl_declared_return_type.
379 * search.c (check_final_overrider): Likewise.
380 * pt.c (make_decltype_auto): New.
381 (do_auto_deduction): Require plain decltype(auto).
385 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
386 template specializations.
388 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
390 Implement n3599 - Literal operator templates for strings.
391 * parser.c (make_string_pack (tree value)): New function.
392 (cp_parser_userdef_string_literal (cp_token *)): Use it
393 to construct calls to character string literal operator templates.
394 (cp_parser_template_declaration_after_export): Check for new string
395 literal operator template parameter form.
397 2013-04-15 Jason Merrill <jason@redhat.com>
399 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
402 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
403 rather than a destructor name, it isn't an unqualified-name.
404 (tsubst_copy_and_build): Pass down decltype_flag to operator
408 * semantics.c (insert_capture_proxy): Just use index 1 in the
411 2013-04-12 Jakub Jelinek <jakub@redhat.com>
413 * error.c (cp_print_error_function,
414 print_instantiation_partial_context_line,
415 maybe_print_constexpr_context): Colorize locus strings.
417 2013-04-11 Jason Merrill <jason@redhat.com>
420 * parser.c (complain_flags): New.
421 (cp_parser_postfix_expression): Use it.
422 (cp_parser_unary_expression): Likewise.
423 (cp_parser_binary_expression): Likewise.
424 (cp_parser_assignment_expression): Likewise.
425 (cp_parser_expression): Likewise.
426 (cp_parser_postfix_open_square_expression): Take decltype_p.
427 (cp_parser_builtin_offsetof): Adjust.
428 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
429 * decl2.c (grok_array_decl): Add decltype_p parm.
430 * cp-tree.h: Adjust prototype.
431 * semantics.c (finish_unary_op_expr): Add complain parm.
433 2013-04-11 Jakub Jelinek <jakub@redhat.com>
436 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
437 calling maybe_constant_value for C++98.
439 2013-04-11 Jason Merrill <jason@redhat.com>
442 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
443 Strip references before checking WILDCARD_TYPE_P.
445 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
447 * call.c (build_conditional_expr_1, build_over_call): Protect
448 error calls with complain & tf_error.
449 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
450 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
451 build_ptrmemfunc): Likewise.
452 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
454 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
455 (convert_to_reference): Adjust.
457 2013-04-11 Jason Merrill <jason@redhat.com>
459 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
460 local variables, look them up instead.
461 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
462 proxies and substitution in unevaluated context.
463 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
464 before the iterators.
467 * pt.c (uses_deducible_template_parms): New.
468 (deducible_array_bound, deducible_expression): New.
469 (deducible_template_args): New.
470 (unify_one_argument): Call uses_deducible_template_parms.
472 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
475 * typeck2.c (build_m_component_ref): Protect error calls with
476 (complain & tf_error).
478 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
481 * parser.c (cp_parser_enum_specifier): Check for empty
482 anonymous enums and anonymous scoped enums.
484 2013-04-10 Jakub Jelinek <jakub@redhat.com>
487 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
488 first before calling maybe_constant_value for warn_for_div_by_zero
489 or invalid shift count warning purposes.
491 2013-04-09 Jason Merrill <jason@redhat.com>
494 * rtti.c (build_typeid): Check the address of the argument
495 rather than looking for an INDIRECT_REF.
497 2013-04-04 Jason Merrill <jason@redhat.com>
501 * typeck2.c (abstract_virtuals_error_sfinae): Disable
504 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
507 * decl.c (validate_constexpr_redeclaration): Allow an explicit
508 specialization to be different wrt the constexpr specifier.
510 2013-04-06 Jason Merrill <jason@redhat.com>
512 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
515 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
517 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
518 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
520 2013-04-03 Jason Merrill <jason@redhat.com>
522 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
523 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
524 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
526 * mangle.c (write_type): When writing a function type with
527 function-cv-quals, don't add the unqualified type as a
528 substitution candidate.
530 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
533 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
536 2013-04-03 Jakub Jelinek <jakub@redhat.com>
539 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
540 from args to new_args.
541 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
542 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
544 2013-04-02 Jason Merrill <jason@redhat.com>
547 * mangle.c (write_function_type): Mangle ref-qualifier.
548 (write_nested_name): Likewise.
549 (canonicalize_for_substitution): Preserve ref-qualifier.
550 (write_type): Likewise.
553 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
555 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
557 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
558 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
559 (for_each_template_parm_r): Use TYPE_TI_ARGS.
561 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
563 * cp-tree.h (TAGGED_TYPE_P): Remove.
564 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
565 (TYPE_ANONYMOUS_P): Adjust.
566 * call.c (build_new_op_1): Likewise.
567 * class.c (find_abi_tags_r): Likewise.
568 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
569 type_is_deprecated): Likewise.
570 * decl2.c (grokfield, min_vis_r): Likewise.
571 * pt.c (get_template_info): Likewise.
572 * tree.c (handle_abi_tag_attribute): Likewise.
574 2013-04-01 Jason Merrill <jason@redhat.com>
576 * semantics.c (maybe_constant_value): Check
577 instantiation_dependent_expression_p.
578 * pt.c (build_non_dependent_expr): Don't check it here.
581 * init.c (build_new): Don't try to process an array initializer
582 at template definition time.
585 * typeck.c (finish_class_member_access_expr): Handle enum scope.
588 * parser.c (cp_parser_range_for): Don't try to do auto deduction
589 in a template if the type of the range is incomplete.
591 * call.c (add_function_candidate): Take the address of 'this' here.
592 (build_over_call): And here.
593 (build_new_method_call_1, build_op_call_1): Not here.
594 (build_user_type_conversion_1): Or here.
595 (add_candidates): Adjust.
597 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
598 * class.c (same_signature_p): Use type_memfn_quals.
599 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
600 FUNCTION_OR_METHOD_TYPE_CHECK.
601 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
602 * pt.c (unify): Use static_fn_type.
604 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
605 Jason Merrill <jason@redhat.com>
607 Implement N2439 (ref-qualifiers for 'this')
608 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
609 (FUNCTION_RVALUE_QUALIFIED): New.
610 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
611 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
612 (cp_ref_qualifier): New enum.
613 (cp_declarator): Add ref_qualifier.
614 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
615 (cp_parser_direct_declarator): Use it.
616 (make_call_declarator): Adjust.
617 (cp_parser_lambda_declarator_opt): Adjust.
618 * call.c (add_function_candidate): Handle ref-qualifier overload
619 resolution semantics.
620 (standard_conversion): Adjust.
621 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
622 * decl.c (grokdeclarator): Handle ref-qualifiers.
623 (grokfndecl): Check for invalid ref-qualifiers.
624 (static_fn_type, revert_static_member_fn): Adjust.
625 * decl2.c (build_memfn_type): Handle ref-qualifiers.
626 (check_classfn): Check them.
627 (cp_reconstruct_complex_type): Retain them.
628 * error.c (dump_ref_qualifier): New.
629 (dump_type_suffix, dump_function_decl): Use it.
630 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
631 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
632 (unify): Retain them.
633 * tree.c (cp_check_qualified_type): New.
634 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
635 (build_ref_qualified_type): New.
636 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
637 (cp_build_type_attribute_variant): Keep ref-qualifier.
638 * typeck.c (merge_types): Keep ref-qualifier.
639 (structural_comptypes): Compare ref-qualifier.
640 (type_memfn_rqual): New.
641 (apply_memfn_quals): Take ref-qual argument.
642 * typeck2.c (build_m_component_ref): Check ref-qualifier.
644 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
646 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
647 (DECL_FUNCTION_TEMPLATE_P): Adjust.
649 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
650 pp_cxx_qualified_id): Use get_containing_scope.
651 * parser.c (cp_parser_class_head): Likewise.
652 * pt.c (push_template_decl_real): Likewise.
654 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
655 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
657 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
659 * decl2.c (collect_candidates_for_java_method_aliases): Use
661 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
662 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
663 * decl.c (duplicate_decls): Likewise.
664 * parser.c (cp_parser_template_declaration_after_export): Likewise,
665 also DECL_DECLARES_TYPE_P.
666 * pt.c (instantiate_class_template_1): Likewise.
667 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
668 (lookup_field_r): Likewise.
669 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
670 (lookup_fnfields_slot_nolazy): Likewise.
671 * semantics.c (finish_member_declaration): Likewise.
672 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
674 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
676 * pt.c (template_parms_to_args): Fix typo in comment.
678 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
680 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
682 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
684 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
685 (build_op_call_1): Likewise.
686 (build_over_call): Likewise.
687 (compare_ics): Likewise.
688 * class.c (build_base_path): Likewise.
689 (resolve_address_of_overloaded_function): Likewise.
690 * cp-tree.h: Likewise.
691 * cvt.c (cp_convert_to_pointer): Likewise.
692 (convert_to_reference): Likewise.
693 (ocp_convert): Likewise.
694 (convert_force): Likewise, tidy.
695 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
696 (pp_cxx_ptr_operator): Likewise.
697 * decl.c (duplicate_decls): Likewise.
698 (start_decl): Likewise.
699 (grok_op_properties): Likewise.
700 (start_preparsed_function): Likewise.
701 (store_parm_decls): Likewise.
702 (finish_function): Likewise.
703 * decl2.c (delete_sanity): Likewise.
704 (acceptable_java_type): Likewise.
705 (grokbitfield): Likewise.
706 (cp_reconstruct_complex_type): Likewise.
707 * error.c (dump_type_prefix): Likewise.
708 (dump_expr): Likewise.
709 * except.c (push_eh_cleanup): Likewise.
710 (complete_ptr_ref_or_void_ptr_p): Likewise.
711 (can_convert_eh): Likewise.
712 * init.c (build_new_1): Likewise.
713 (build_delete): Likewise.
714 (build_vec_delete): Likewise.
715 * mangle.c (write_type): Likewise.
716 * parser.c (lookup_literal_operator): Likewise.
717 * pt.c (convert_nontype_argument_function): Likewise.
718 (convert_nontype_argument): Likewise.
721 (dependent_type_p_r): Likewise.
722 * rtti.c (build_headof): Likewise.
723 (build_typeid): Likewise.
724 (build_dynamic_cast_1): Likewise.
725 (target_incomplete_p): Likewise.
726 (typeinfo_in_lib_p): Likewise.
727 * semantics.c (finish_omp_for): Likewise.
728 (cxx_eval_call_expression): Likewise.
729 (maybe_resolve_dummy): Likewise.
730 * tree.c (build_target_expr): Likewise.
731 (cp_build_qualified_type_real): Likewise.
732 * typeck.c (composite_pointer_type_r): Likewise.
733 (composite_pointer_type): Likewise.
734 (comp_except_types): Likewise.
735 (cxx_sizeof_nowarn): Likewise.
736 (string_conv_p): Likewise.
737 (cp_build_array_ref): Likewise.
738 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
739 (pointer_diff): Likewise.
740 (cp_build_addr_expr_1): Likewise.
741 (cp_build_unary_op): Likewise.
742 (build_static_cast_1): Likewise.
743 (cp_build_c_cast): Likewise.
744 (comp_ptr_ttypes_real): Likewise.
745 (ptr_reasonably_similar): Likewise.
746 (comp_ptr_ttypes_const): Likewise.
747 (casts_away_constness): Likewise.
748 (check_literal_operator_args): Likewise.
749 * typeck2.c (build_x_arrow): Likewise.
750 (add_exception_specifier): Likewise.
752 2013-03-29 Jason Merrill <jason@redhat.com>
755 * cp-tree.h (AUTO_IS_DECLTYPE): New.
756 * parser.c (cp_parser_decltype): Handle decltype(auto).
757 (cp_parser_type_id_1): Allow auto without a late-specified
759 (cp_parser_primary_expression): Use the return value of
760 finish_parenthesized_expr.
761 (cp_parser_transaction_expression): Likewise.
762 * semantics.c (force_paren_expr): New.
763 (finish_parenthesized_expr): Use it.
764 * call.c (build_conditional_expr_1): Likewise.
765 * pt.c (do_auto_deduction): Handle decltype(auto).
766 (tsubst_copy): Handle PAREN_EXPR.
767 (tsubst_copy_and_build): Likewise.
768 * error.c (dump_expr): Handle PAREN_EXPR.
769 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
770 * mangle.c (write_expression): Ignore PAREN_EXPR.
772 * parser.c (cp_parser_decltype_expr): Split out...
773 (cp_parser_decltype): ...from here.
777 * pt.c (unify_pack_expansion): Fix indexing.
779 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
781 * call.c (build_java_interface_fn_ref): Likewise.
782 (make_temporary_var_for_ref_to_temp): Likewise.
783 * class.c (check_field_decls): Likewise.
784 (layout_class_type): Likewise.
785 (finish_struct_1): Likewise.
786 (fixed_type_or_null): Likewise.
787 (get_vtbl_decl_for_binfo): Likewise.
788 * cp-gimplify.c (omp_var_to_track): Likewise.
789 (cp_genericize_r): Likewise.
790 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
791 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
792 (DECL_DISCRIMINATOR_P): Likewise.
793 * decl.c (poplevel): Likewise.
794 (decls_match): Likewise.
795 (duplicate_decls): Likewise.
796 (decl_jump_unsafe): Likewise.
797 (start_decl): Likewise.
798 (check_for_uninitialized_const_var): Likewise.
799 (make_rtl_for_nonlocal_decl): Likewise.
800 (cp_finish_decl): Likewise.
801 (expand_static_init): Likewise.
802 (local_variable_p): Likewise.
803 (maybe_register_incomplete_var): Likewise.
804 * decl2.c (grokfield): Likewise.
805 (comdat_linkage): Likewise.
806 (determine_visibility): Likewise.
807 (import_export_decl): Likewise.
808 (prune_vars_needing_no_initialization): Likewise.
809 (decl_maybe_constant_var_p): Likewise.
810 * error.c (dump_simple_decl): Likewise.
811 (dump_template_decl): Likewise.
812 (cp_printer): Likewise.
813 * except.c (build_throw): Likewise.
814 * init.c (build_vtbl_address): Likewise.
815 (member_init_ok_or_else): Likewise.
816 (build_aggr_init): Likewise.
817 (expand_aggr_init_1): Likewise.
818 (build_offset_ref): Likewise.
819 (constant_value_1): Likewise.
820 * mangle.c (write_mangled_name): Likewise.
821 (write_prefix): Likewise.
822 * name-lookup.c (supplement_binding_1): Likewise.
823 (add_decl_to_level): Likewise.
824 (pushdecl_maybe_friend_1): Likewise.
825 (check_for_out_of_scope_variable): Likewise.
826 (validate_nonmember_using_decl): Likewise.
827 (lookup_name_innermost_nonclass_level_1): Likewise.
828 (lookup_arg_dependent_1): Likewise.
829 * parser.c (cp_parser_lambda_introducer): Likewise.
830 (cp_parser_template_argument): Likewise.
831 (cp_parser_single_declaration): Likewise.
832 * pt.c (convert_nontype_argument): Likewise.
833 (instantiate_class_template_1): Likewise.
834 (tsubst_decl): Likewise.
835 (tsubst_expr): Likewise.
836 (do_decl_instantiation): Likewise.
837 (do_type_instantiation): Likewise.
838 (regenerate_decl_from_template): Likewise.
839 (always_instantiate_p): Likewise.
840 (instantiate_decl): Likewise.
841 (type_dependent_expression_p): Likewise.
842 (build_non_dependent_expr): Likewise.
843 * repo.c (repo_emit_p): Likewise.
844 * rtti.c (build_dynamic_cast_1): Likewise.
845 * search.c (shared_member_p): Likewise.
846 * semantics.c (outer_var_p): Likewise.
847 (finish_id_expression): Likewise.
848 (finish_omp_clauses): Likewise.
849 (finish_decltype_type): Likewise.
850 (ensure_literal_type_for_constexpr_object): Likewise.
851 * tree.c (lvalue_kind): Likewise.
852 (bot_replace): Likewise.
853 (cp_tree_equal): Likewise.
854 (handle_init_priority_attribute): Likewise.
855 (decl_storage_duration): Likewise.
856 * typeck.c (cxx_sizeof_expr): Likewise.
857 (cxx_alignof_expr): Likewise.
858 (decay_conversion): Likewise.
859 (build_class_member_access_expr): Likewise.
860 (cp_build_array_ref): Likewise.
861 (cxx_mark_addressable): Likewise.
862 (maybe_warn_about_returning_address_of_local): Likewise.
863 (check_return_expr): Likewise.
864 * typeck2.c (cxx_readonly_error): Likewise.
865 (abstract_virtuals_error_sfinae): Likewise.
866 (cxx_incomplete_type_diagnostic): Likewise.
868 2013-03-28 Lawrence Crowl <crowl@google.com>
871 (CXX_PARSER_H): Add header dependence.
873 (extern debug (cp_binding_level &)): New.
874 (extern debug (cp_binding_level *)): New.
876 (debug (cp_binding_level &)): New.
877 (debug (cp_binding_level *)): New.
879 (debug (cp_parser &)): New.
880 (debug (cp_parser *)): New.
881 (debug (cp_token &)): New.
882 (debug (cp_token *)): New.
883 (debug (vec<cp_token, va_gc> &)): New.
884 (debug (vec<cp_token, va_gc> *)): New.
885 * parser.c: Add header dependence.
886 (extern debug (cp_parser &)): New.
887 (extern debug (cp_parser *)): New.
888 (extern debug (cp_token &)): New.
889 (extern debug (cp_token *)): New.
890 (extern debug (vec<cp_token, va_gc> &)): New.
891 (extern debug (vec<cp_token, va_gc> *)): New.
893 2013-03-28 Jason Merrill <jason@redhat.com>
897 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
898 the type if tf_decltype is set.
899 * pt.c (fn_type_unification): Add decltype_p parm.
900 (get_bindings): Adjust.
902 * class.c (resolve_address_of_overloaded_function): Adjust.
903 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
906 * parser.c (cp_parser_sizeof_pack): Split out from...
907 (cp_parser_sizeof_operand): ...here. Require (id).
910 * semantics.c (finish_this_expr): 'this' is an rvalue.
911 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
914 * semantics.c (finish_member_declaration): Don't push closure
917 * name-lookup.c (pushdecl_maybe_friend_1): Use
918 nonlambda_method_basetype and current_nonlambda_class_type.
921 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
922 conversion from integer to pointer.
923 (cxx_eval_constant_expression): Likewise.
924 (cxx_eval_indirect_ref): Use the folded operand if we still think
925 this might be constant.
927 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
928 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
931 * call.c (convert_like_real): Change series of two permerrors
932 to permerror + inform (and likewise for two errors).
933 (build_new_method_call_1): Likewise.
934 * typeck.c (convert_for_initialization): Change additional
935 warning or error to inform.
937 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
939 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
940 (first_aggr_init_expr): Likewise.
941 (more_aggr_init_expr_args_p): Likewise.
942 (type_of_this_parm): Likewise.
943 (class_of_this_parm): Likewise.
944 * name-lookup.h (get_global_value_if_present): Likewise.
945 (is_typename_at_global_scope): Likewise.
947 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
949 * call.c (joust): Don't call inform for a permerror returning false.
950 * parser.c (cp_parser_check_class_key): Likewise.
951 * pt.c (tsubst_copy_and_build): Likewise.
953 2013-03-27 Jason Merrill <jason@redhat.com>
956 * semantics.c (finish_qualified_id_expr): Return early
959 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
961 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
962 * cvt.c (convert_to_void): Likewise.
963 * error.c (dump_expr): Likewise.
964 * mangle.c (write_expression): Likewise.
965 * parser.c (cp_parser_template_argument): Likewise.
966 * pt.c (convert_nontype_argument): Likewise.
967 (tsubst_copy_and_build): Likewise.
968 * rtti.c (build_typeid): Likewise.
969 * semantics.c (finish_call_expr): Likewise.
970 (finish_decltype_type): Likewise.
971 (build_data_member_initialization): Likewise.
972 * tree.c (is_dummy_object): Likewise.
973 * typeck.c (decay_conversion): Likewise.
974 (build_class_member_access_expr): Likewise.
975 (cp_build_addr_expr_1): Likewise.
976 (unary_complex_lvalue): Likewise.
977 (check_return_expr): Likewise.
978 * typeck2.c (cxx_readonly_error): Likewise.
980 2013-03-26 Jason Merrill <jason@redhat.com>
983 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
984 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
985 * cp-tree.h: Adjust prototype.
988 * typeck2.c (build_m_component_ref): Handle prvalue object.
990 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
992 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
993 * decl.c (duplicate_decls): Likewise.
994 (cp_finish_decl): Likewise.
995 (check_class_member_definition_namespace): Likewise.
996 * decl2.c (grokfield): Likewise.
997 (decl_needed_p): Likewise.
998 (import_export_decl): Likewise.
999 (mark_used): Likewise.
1000 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1001 * pt.c (push_access_scope): Likewise.
1002 (instantiate_decl): Likewise.
1003 * ptree.c (cxx_print_decl): Likewise.
1004 * repo.c (repo_emit_p): Likewise.
1005 * semantics.c (note_decl_for_pch): Likewise.
1006 * tree.c (decl_linkage): Likewise.
1008 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1011 * decl.c (check_array_designated_initializer): Handle CONST_DECL
1014 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1016 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1019 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1021 2013-03-25 Jason Merrill <jason@redhat.com>
1024 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1025 class is derived from the type of the object.
1028 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1029 unevaluated context.
1031 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
1034 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1035 DECL_TEMPLATE_INSTANTIATION.
1037 2013-03-22 Jason Merrill <jason@redhat.com>
1040 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1043 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
1045 * cp-tree.h (identifier_p): New.
1046 * call.c: Throughout, call identifier_p insstead of direct
1047 comparaison of TREE_CODE against IDENTIFIER_NODE.
1048 * decl.c: Likewisse.
1049 * decl2.c: Likewise.
1051 * mangle.c: Likewise.
1052 * name-lookup.c: Likewise.
1053 * parser.c: Likewise.
1055 * search.c: Likewise.
1056 * semantics.c: Likewise.
1058 * typeck.c: Likewise.
1059 * typeck2.c: Likewise.
1061 2013-03-21 Jakub Jelinek <jakub@redhat.com>
1064 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1065 * call.c (build_temp): Likewise.
1066 * method.c (synthesize_method): Likewise.
1067 * typeck.c (convert_for_initialization): Likewise.
1069 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
1071 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
1073 2013-03-21 Richard Biener <rguenther@suse.de>
1075 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
1076 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
1078 2013-03-20 Jason Merrill <jason@redhat.com>
1081 * parser.c (cp_parser_late_return_type_opt): Save and restore
1082 current_class_ptr/ref.
1085 * expr.c (cplus_expand_constant): Do nothing if the class is
1087 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1088 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1089 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1090 (complete_vars): Likewise.
1092 * name-lookup.c (get_anonymous_namespace_name): Never use
1093 get_file_function_name.
1095 * pt.c (retrieve_specialization): Handle null tmpl argument.
1099 * pt.c (tsubst_decl): Check return value of register_specialization.
1100 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1103 2013-03-17 Jason Merrill <jason@redhat.com>
1107 * parser.c (cp_parser_direct_declarator): Bail if we see a
1108 qualified-id not at namespace scope.
1112 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1115 2013-03-16 Jason Merrill <jason@redhat.com>
1117 * decl.c (grokdeclarator): Assert that we won't see a pointer to
1121 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1122 (MAYBE_CLASS_TYPE_P): ...here.
1123 * semantics.c (lambda_capture_field_type): Only build a
1124 magic decltype for wildcard types.
1125 (lambda_proxy_type): Likewise.
1126 (finish_non_static_data_member): Get the quals from
1130 * parser.c (cp_parser_template_argument): Don't
1131 fold_non_dependent_expr.
1133 * parser.c (cp_parser_lambda_declarator_opt): Use
1134 cp_parser_trailing_type_id.
1137 * parser.c (cp_parser_template_id): Don't forget access checks.
1140 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1144 * name-lookup.h (tag_scope): Add ts_lambda.
1145 * semantics.c (begin_lambda_type): Use it.
1146 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1147 * pt.c (check_default_tmpl_args): Ignore lambdas.
1148 (push_template_decl_real): Handle lambdas.
1149 * tree.c (no_linkage_check): Adjust lambda check.
1152 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1155 * parser.c (cp_parser_direct_declarator): Fix late return
1156 for out-of-class defn of member function.
1159 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1160 parms to avoid duplicate -Wshadow warnings.
1162 * search.c (lookup_base): Handle NULL_TREE.
1165 * semantics.c (potential_constant_expression_1): Use of 'this' in
1166 a non-constexpr function makes the expression not potentially
1171 * cp-tree.h (tsubst_flags): Add tf_decltype.
1172 * call.c (build_cxx_call): Don't build a temporary if it's set.
1173 (build_over_call): Make sure it's only passed to build_cxx_call.
1174 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1175 (cp_parser_unary_expression): Likewise.
1176 (cp_parser_cast_expression): Likewise.
1177 (cp_parser_binary_expression): Likewise.
1178 (cp_parser_assignment_expression): Likewise.
1179 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
1180 (cp_parser_expression): Add decltype_p. Force a
1181 temporary for a call on the LHS of a comma.
1182 (cp_parser_decltype): Pass true to decltype_p parms.
1183 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1184 (tsubst_copy_and_build): Pass tf_decltype down only for
1185 CALL_EXPR and the RHS of COMPOUND_EXPR.
1186 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1188 * cp-tree.h (abstract_class_use): New enum.
1189 * typeck2.c (pending_abstract_type): Add use field.
1190 (abstract_virtuals_error_sfinae): Add overloads taking
1191 abstract_class_use instead of tree.
1192 * typeck.c (build_static_cast_1): Call it.
1193 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1194 * pt.c: Adjust calls.
1195 * decl.c (cp_finish_decl): Don't handle functions specially.
1196 (grokdeclarator): Always check return type.
1197 * init.c (build_new_1): Adjust call.
1201 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1202 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1205 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1206 (tsubst_arg_types): Likewise.
1210 * call.c (convert_like_real): Check for explicit constructors
1211 even for value-initialization.
1214 * pt.c (convert_nontype_argument): Handle invalid pointer.
1216 * parser.c (cp_parser_lambda_expression): Use nreverse.
1220 * pt.c (instantiate_class_template_1): Instantiate lambda capture
1222 (tsubst_copy_and_build): Not here.
1225 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1228 * parser.c (parsing_nsdmi): New.
1229 * semantics.c (outer_automatic_var_p): Check it.
1230 (finish_id_expression): Likewise.
1231 * cp-tree.h: Declare it.
1234 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1236 * parser.c (lookup_literal_operator): Correct parm/arg naming
1240 * pt.c (fold_non_dependent_expr_sfinae): Check
1241 instantiation_dependent_expression_p.
1244 * class.c (resolve_address_of_overloaded_function): Accept a
1245 reference to function for target_type.
1246 (instantiate_type): Likewise.
1247 * pt.c (convert_nontype_argument): Pass it to
1248 convert_nontype_argument_function.
1250 2013-03-16 Jakub Jelinek <jakub@redhat.com>
1252 * tree.c (cp_tree_equal): Fix a pasto.
1255 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1256 pass op1 through maybe_constant_value first.
1258 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
1261 * semantics.c (cxx_eval_array_reference): Check for negative index.
1263 2013-03-14 Jason Merrill <jason@redhat.com>
1266 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1269 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1270 dso_handle parm on targets without __cxa_atexit.
1272 2013-03-11 Jason Merrill <jason@redhat.com>
1275 * typeck.c (check_return_expr): Disallow returning init list here.
1276 * semantics.c (apply_deduced_return_type): Not here.
1278 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1281 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1282 * error.c (dump_expr): Likewise.
1284 2013-03-08 Jason Merrill <jason@redhat.com>
1287 * class.c (modify_all_vtables): Mangle the vtable name before
1290 * semantics.c (lambda_expr_this_capture): In unevaluated context,
1291 just return the nearest 'this'.
1296 * tree.c (maybe_dummy_object): Don't capture 'this'.
1297 * semantics.c (maybe_resolve_dummy): New.
1298 (finish_non_static_data_member): Use it.
1299 (finish_qualified_id_expr): Don't test is_dummy_object.
1300 * cp-tree.h: Declare maybe_resolve_dummy.
1301 * call.c (build_new_method_call_1): Use it.
1304 * semantics.c (apply_deduced_return_type): Don't allow returning
1305 std::initializer_list.
1307 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1310 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1311 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1312 * decl.c (check_elaborated_type_specifier): Tidy.
1314 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1317 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1319 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1321 * parser.c (cp_parser_braced_list): For {} initialize
1322 *non_constant_p to false.
1324 2013-03-04 Jason Merrill <jason@redhat.com>
1328 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1329 and non-class scopes.
1331 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1333 * decl.c (grokdeclarator): Remove dead code.
1335 2013-02-28 Jason Merrill <jason@redhat.com>
1338 * semantics.c (potential_constant_expression_1): Use
1339 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1342 * call.c (build_over_call): Avoid virtual lookup in a template.
1344 2013-02-27 Jason Merrill <jason@redhat.com>
1348 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1349 of the base name for inheriting ctors.
1350 (push_class_level_binding_1): Remove inheriting ctor handling.
1351 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1352 * class.c (add_implicitly_declared_members): Adjust.
1354 2013-02-26 David Binderman <dcb314@hotmail.com>
1357 * decl.c (grokdeclarator): Tidy publicp assignment.
1359 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1362 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1363 (build_transaction_expr): Same.
1365 2013-02-25 Jason Merrill <jason@redhat.com>
1368 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1369 we know what args we're looking at.
1372 * semantics.c (potential_constant_expression_1): In C++98, a cast
1373 to non-integral type can't be a constant expression.
1375 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1378 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1381 2013-02-22 Jason Merrill <jason@redhat.com>
1384 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1385 if we got the wrong number of template parms.
1388 * pt.c (fn_type_unification): Use explicit args in template
1389 instantiation context.
1392 * call.c (can_convert_arg): Discard access checks.
1395 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1398 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1401 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1402 * cvt.c (ocp_convert): Use the latter.
1403 (cp_convert_to_pointer): Likewise.
1404 * decl.c (check_default_argument): Likewise.
1405 * typeck.c (cp_build_binary_op): Likewise.
1406 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1408 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1409 Paolo Carlini <paolo.carlini@oracle.com>
1412 * decl2.c (grokbitfield): Allow scoped enumeration types.
1414 2013-02-15 Jason Merrill <jason@redhat.com>
1417 * semantics.c (finish_id_expression): Also return the identifier
1418 for an outer local static.
1421 * class.c (check_bases_and_members): Deduce noexcept after
1425 * semantics.c (finish_id_expression): In a template, return
1426 the identifier for a constant variable.
1428 2013-02-14 Jason Merrill <jason@redhat.com>
1431 * semantics.c (build_anon_member_initialization): New.
1432 (build_data_member_initialization): Use it.
1435 * decl.c (cp_finish_decl): Force instantiation of an
1436 auto static data member.
1439 * pt.c (unify): A pack expansion that is not the last template
1440 argument makes the entire template argument list non-deduced.
1443 * name-lookup.c (do_class_using_decl): Handle typedefs with
1444 inheriting constructors.
1445 (push_class_level_binding_1): Allow inheriting from template
1446 template parameter, too.
1447 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1450 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1451 default argument scope.
1452 * mangle.c (write_name): Likewise.
1455 * error.c (find_typenames_r): Don't walk into a pack expansion.
1457 2013-02-13 Jason Merrill <jason@redhat.com>
1460 * parser.c (cp_parser_member_declaration): Check the declarator
1461 form when detecting a function declaration via typedef.
1464 * pt.c (maybe_process_partial_specialization): A lambda
1465 isn't what's being specialized.
1468 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1472 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1475 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1476 non-zero offsets, too.
1479 * decl.c (build_enumerator): Always convert the value to a
1480 fixed underlying type.
1483 * pt.c (tsubst_copy_and_build): Don't forget any new
1484 captures that arose from use of dependent names.
1486 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1489 * semantics.c (finish_asm_stmt): If input constraints allow
1490 neither register nor memory, try maybe_constant_value to get
1491 a constant if possible.
1493 2013-02-12 Jason Merrill <jason@redhat.com>
1496 * method.c (add_one_base_init): Handle base constructor
1497 taking rvalue reference parm.
1500 * semantics.c (sort_constexpr_mem_initializers): Handle
1503 2013-02-09 Jason Merrill <jason@redhat.com>
1506 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1507 maybe_instantiate_noexcept.
1510 * pt.c (eq_specializations): Set comparing_specializations.
1511 * tree.c (cp_tree_equal): Check it.
1512 * cp-tree.h: Declare it.
1514 * decl.c (decls_match): Check versions later.
1517 * pt.c (build_non_dependent_expr): Don't try to fold
1518 instantiation-dependent expressions.
1519 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1520 [BIND_EXPR]: Treat as dependent.
1522 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1525 * init.c (build_vec_init): Don't append NULL values into new_vec.
1526 (build_zero_init_1): Don't push anything into v if recursive call
1528 (build_value_init_noctor): Don't push anything into v if
1529 build_value_init call returned NULL_TREE.
1532 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1533 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1534 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1535 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1536 (cp_parser_cast_expression): Adjust caller.
1539 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1540 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1541 DECL_LANG_SPECIFIC (t).
1543 2013-02-07 Jason Merrill <jason@redhat.com>
1546 * method.c (do_build_copy_constructor): Don't bother turning
1547 scalars from lvalues to xvalues.
1548 (do_build_copy_assign): Likewise.
1550 2013-02-06 Jason Merrill <jason@redhat.com>
1552 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1554 2013-02-05 Jason Merrill <jason@redhat.com>
1557 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1561 * decl.c (start_preparsed_function): Update restype if we change
1565 * pt.c (fn_type_unification): Discard any access checks from
1566 substituting explicit args.
1568 2013-01-31 Jason Merrill <jason@redhat.com>
1572 * typeck.c (get_member_function_from_ptrfunc): Fix
1573 ptrmemfunc_vbit_in_delta case.
1575 2013-01-29 Jason Merrill <jason@redhat.com>
1578 * class.c (build_ctor_vtbl_group): Give construction vtables
1581 2013-01-25 Jason Merrill <jason@redhat.com>
1584 * pt.c (convert_nontype_argument_function): Handle invalid input.
1585 (convert_nontype_argument): Likewise.
1588 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1589 dynamic type has no virtual functions.
1591 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1594 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1595 on TARGET_EXPR nodes.
1597 2013-01-22 Jason Merrill <jason@redhat.com>
1600 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1602 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1605 * pt.c (argument_pack_element_is_expansion_p)
1606 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1607 (gen_elem_of_pack_expansion_instantiation): New static functions.
1608 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1609 look through the possibly resulting pack expansion as well.
1610 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1611 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1612 Use gen_elem_of_pack_expansion_instantiation to build the
1613 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1614 as gen_elem_of_pack_expansion_instantiation and the change in
1615 tsubst above generalize this particular case.
1616 (arg_from_parm_pack_p): Remove this for it's not used by
1617 tsubst_pack_expansion anymore.
1619 2013-01-21 Jason Merrill <jason@redhat.com>
1622 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1623 template args count.
1625 2013-01-18 Jason Merrill <jason@redhat.com>
1628 * decl2.c (get_local_tls_init_fn): New.
1629 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1630 with aliases for internal variables. Don't use weakrefs if
1631 the variable needs destruction.
1632 (generate_tls_wrapper): Mark the wrapper as const if no
1633 initialization is needed.
1634 (handle_tls_init): Don't require aliases.
1636 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1639 * pt.c (coerce_innermost_template_parms): New static function.
1640 (instantiate_alias_template): Use it here.
1642 2013-01-09 Jason Merrill <jason@redhat.com>
1645 * rtti.c (build_typeid, get_typeid): Add complain parm.
1646 (get_tinfo_decl_dynamic): Likewise.
1647 * cp-tree.h, parser.c, pt.c: Adjust.
1650 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1653 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1656 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1657 call maybe_constant_value for the negative or too big shift
1660 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1663 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1664 of the argument is true.
1666 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1668 * parser.c (cp_parser_initializer_list): Move declaration
1669 of variable non_const to start of lexical block.
1671 2013-01-07 Jason Merrill <jason@redhat.com>
1674 * tree.c (build_aggr_init_expr): Do nothing in a template.
1675 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1676 a FUNCTION_DECL before tsubsting.
1678 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1681 * pt.c (check_instantiated_arg): Allow type template arguments.
1683 2013-01-04 Jason Merrill <jason@redhat.com>
1686 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1687 (grokdeclarator): Use reset_type_linkage.
1688 * name-lookup.c (binding_table_foreach): Handle null table.
1689 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1691 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1693 PR c++/54526 (again)
1694 * parser.c (cp_parser_template_id): Revert core of previous change
1695 (keep adjusted inform message).
1697 2013-01-03 Jason Merrill <jason@redhat.com>
1701 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1705 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1708 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1711 * call.c (type_has_extended_temps): New.
1712 * cp-tree.h: Declare it.
1713 * decl.c (check_initializer): Use build_aggr_init for arrays
1715 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1717 2013-01-02 Jason Merrill <jason@redhat.com>
1720 * call.c (build_new_method_call_1): Don't use build_value_init for
1721 user-provided default constructors.
1723 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1727 * tree.c (build_cplus_array_type): Copy layout information
1728 to main variant if necessary.
1730 Copyright (C) 2013 Free Software Foundation, Inc.
1732 Copying and distribution of this file, with or without modification,
1733 are permitted in any medium without royalty provided the copyright
1734 notice and this notice are preserved.