1 2013-05-16 Jason Merrill <jason@redhat.com>
3 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
6 * decl.c (grokdeclarator): Allow member function qualifiers in
7 TYPENAME context in C++11 mode.
9 2013-05-16 Dodji Seketeli <dodji@redhat.com>
11 PR c++/56782 - Regression with empty pack expansions
12 * pt.c (use_pack_expansion_extra_args_p): When at least a
13 parameter pack has an empty argument pack, and another parameter
14 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
17 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
19 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
20 warning_at and permerror with warning_at/inform and permerror/
23 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
26 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
29 2013-05-14 Jason Merrill <jason@redhat.com>
32 * parser.c (cp_parser_range_for): Call complete_type.
35 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
37 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
40 * method.c (defaulted_late_check): Check for compatible exception
41 specification out of class explicitly defaulted functions too.
43 2013-05-14 Jason Merrill <jason@redhat.com>
46 * semantics.c (potential_constant_expression_1): Make sure the
47 called function is potentially constant.
48 * call.c (null_ptr_cst_p): Revert earlier change.
50 2013-05-13 Jason Merrill <jason@redhat.com>
53 * call.c (null_ptr_cst_p): An expression with side-effects can't
54 be a C++03 null pointer constant.
57 * decl.c (reshape_init_class): Handle error_mark_node.
60 * typeck.c (merge_types): Propagate ref-qualifier
64 * decl.c (grokdeclarator): Apply ref-qualifier
68 * decl.c (decls_match): Compare ref-qualifiers.
70 2013-05-10 Jason Merrill <jason@redhat.com>
73 * pt.c (convert_template_argument): Use dependent_template_arg_p,
74 not uses_template_parms.
77 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
80 * semantics.c (add_capture): Error rather than abort on copy
82 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
83 warn about capture proxy.
85 2013-05-09 Jason Merrill <jason@redhat.com>
87 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
90 * pt.c (lookup_template_class_1): Handle getting a template
91 template parameter as D1.
93 N3639 C++1y VLA diagnostics
94 * decl.c (grokdeclarator): Complain about reference, pointer, or
96 (create_array_type_for_decl): Complain about array of VLA.
97 * pt.c (tsubst): Likewise.
98 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
99 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
100 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
101 (cxx_sizeof_or_alignof_type): Likewise.
103 N3639 C++1y VLA support
104 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
105 (check_array_initializer): Allow VLA init.
106 (reshape_init_array_1): Adjust.
107 (cp_finish_decl): Check for invalid VLA length.
108 * typeck2.c (process_init_constructor_array): Adjust.
109 (store_init_value): Use build_vec_init for VLAs.
110 * semantics.c (add_capture): Capture VLA as ptr+len.
111 (vla_capture_type): New.
112 (build_capture_proxy): Rebuild the VLA.
113 * typeck.c (build_simple_component_ref): Split out from...
114 (build_ptrmemfunc_access_expr): ...here.
115 * tree.c (array_of_runtime_bound_p): New.
116 * init.c (throw_bad_array_length): New.
117 (build_vec_init): Use it.
118 * parser.c (cp_convert_range_for): When iterating over a VLA,
119 use it directly rather than bind a reference.
120 * cp-tree.h: Declare new functions.
122 2013-05-08 Jason Merrill <jason@redhat.com>
124 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
125 variably_modified_type_p.
126 (expand_start_catch_block): Mark the typeinfo used here.
127 * semantics.c (finish_handler_parms): Not here.
129 * error.c (dump_type_suffix): Try harder on VLA length.
132 * init.c (throw_bad_array_new_length): New.
133 (build_new_1): Use it. Don't warn about braced-init-list.
134 (build_vec_init): Use it.
135 * call.c (build_operator_new_call): Use it.
138 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
139 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
140 * error.c (maybe_warn_cpp0x): s/0x/11/.
142 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
145 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
148 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
150 * typeck.c (cp_build_binary_op): Call save_expr before
151 build_vector_from_val.
153 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
156 * decl.c (cp_finish_decl): After do_auto_deduction copy the
157 qualifers with cp_apply_type_quals_to_decl.
159 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
161 * pt.c (convert_nontype_argument): Add missing whitespace in
164 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
167 * decl.c (build_enumerator): Improve error message.
169 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
172 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
173 messages for template types and fix column numbers.
175 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
178 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
179 c_inhibit_evaluation_warnings around build_x_modify_expr call.
181 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
184 * semantics.c (finish_decltype_type): Handle instantiated template
187 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
190 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
192 2013-04-26 Jakub Jelinek <jakub@redhat.com>
194 * error.c (cp_print_error_function): Adjust file_name_as_prefix
197 2013-04-25 Jason Merrill <jason@redhat.com>
200 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
203 * init.c (perform_member_init): Call reshape_init.
205 2013-04-24 Jason Merrill <jason@redhat.com>
208 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
210 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
212 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
213 pedwarn to simply use OPT_Wpointer_arith.
214 (cp_build_unary_op): Likewise.
216 2013-04-24 Jason Merrill <jason@redhat.com>
218 N3648: init-captures are named.
219 * semantics.c (add_capture): Don't prepend "__" to init-captures.
220 (build_capture_proxy): Adjust.
221 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
223 N3648: Allow braced and parenthesized initializers.
224 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
225 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
226 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
227 (add_capture): Collapse a parenthesized initializer into a single
229 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
231 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
234 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
235 * semantics.c (finish_qualified_id_expr): Likewise.
236 (finish_id_expression): Update.
237 * typeck.c (cp_build_addr_expr_1): Likewise.
238 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
239 * cp-tree.h: Update declarations.
241 2013-04-22 Jason Merrill <jason@redhat.com>
244 * parser.c (cp_parser_unqualified_id): Handle ~auto.
245 (cp_parser_pseudo_destructor_name): Likewise.
246 (cp_parser_postfix_dot_deref_expression): Adjust.
247 (cp_lexer_nth_token_is_keyword): New.
248 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
249 * typeck.c (lookup_destructor): Handle ~auto.
251 * pt.c (fn_type_unification): Push tinst level around
252 type_unification_real if we aren't explaining.
253 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
254 * error.c (dump_function_decl): Respect it.
255 (subst_to_string): Pass it.
258 * rtti.c (get_typeid): Diagnose qualified function type.
259 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
261 * error.c (dump_aggr_type): Fix lambda detection.
262 (dump_simple_decl): Pretty-print capture field.
265 * cvt.c (build_expr_type_conversion): Two conversions that return
266 the same type aren't necessarily ambiguous.
269 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
270 pedwarn unconditional except in C++1y mode.
272 * semantics.c (potential_constant_expression_1): Don't crash on
276 * semantics.c (finish_id_expression): Reject capture of anonymous
280 * decl2.c (check_default_args): Check for pack expansion.
282 * mangle.c (write_type): Mangle decltype(auto).
284 2013-04-19 Jason Merrill <jason@redhat.com>
286 N3638 changes to return type deduction
287 * decl.c (undeduced_auto_decl): New.
288 (require_deduced_type): New.
289 (fndecl_declared_return_type): New.
290 (decls_match): Use it.
291 (duplicate_decls): Don't check for auto return.
292 (grokdeclarator): Reject virtual auto.
293 * class.c (resolve_address_of_overloaded_function): Handle
294 auto function templates.
295 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
296 * cp-tree.h: Declare new fns.
297 * error.c (dump_function_decl): Use fndecl_declared_return_type.
298 * search.c (check_final_overrider): Likewise.
299 * pt.c (make_decltype_auto): New.
300 (do_auto_deduction): Require plain decltype(auto).
304 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
305 template specializations.
307 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
309 Implement n3599 - Literal operator templates for strings.
310 * parser.c (make_string_pack (tree value)): New function.
311 (cp_parser_userdef_string_literal (cp_token *)): Use it
312 to construct calls to character string literal operator templates.
313 (cp_parser_template_declaration_after_export): Check for new string
314 literal operator template parameter form.
316 2013-04-15 Jason Merrill <jason@redhat.com>
318 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
321 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
322 rather than a destructor name, it isn't an unqualified-name.
323 (tsubst_copy_and_build): Pass down decltype_flag to operator
327 * semantics.c (insert_capture_proxy): Just use index 1 in the
330 2013-04-12 Jakub Jelinek <jakub@redhat.com>
332 * error.c (cp_print_error_function,
333 print_instantiation_partial_context_line,
334 maybe_print_constexpr_context): Colorize locus strings.
336 2013-04-11 Jason Merrill <jason@redhat.com>
339 * parser.c (complain_flags): New.
340 (cp_parser_postfix_expression): Use it.
341 (cp_parser_unary_expression): Likewise.
342 (cp_parser_binary_expression): Likewise.
343 (cp_parser_assignment_expression): Likewise.
344 (cp_parser_expression): Likewise.
345 (cp_parser_postfix_open_square_expression): Take decltype_p.
346 (cp_parser_builtin_offsetof): Adjust.
347 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
348 * decl2.c (grok_array_decl): Add decltype_p parm.
349 * cp-tree.h: Adjust prototype.
350 * semantics.c (finish_unary_op_expr): Add complain parm.
352 2013-04-11 Jakub Jelinek <jakub@redhat.com>
355 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
356 calling maybe_constant_value for C++98.
358 2013-04-11 Jason Merrill <jason@redhat.com>
361 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
362 Strip references before checking WILDCARD_TYPE_P.
364 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
366 * call.c (build_conditional_expr_1, build_over_call): Protect
367 error calls with complain & tf_error.
368 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
369 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
370 build_ptrmemfunc): Likewise.
371 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
373 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
374 (convert_to_reference): Adjust.
376 2013-04-11 Jason Merrill <jason@redhat.com>
378 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
379 local variables, look them up instead.
380 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
381 proxies and substitution in unevaluated context.
382 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
383 before the iterators.
386 * pt.c (uses_deducible_template_parms): New.
387 (deducible_array_bound, deducible_expression): New.
388 (deducible_template_args): New.
389 (unify_one_argument): Call uses_deducible_template_parms.
391 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
394 * typeck2.c (build_m_component_ref): Protect error calls with
395 (complain & tf_error).
397 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
400 * parser.c (cp_parser_enum_specifier): Check for empty
401 anonymous enums and anonymous scoped enums.
403 2013-04-10 Jakub Jelinek <jakub@redhat.com>
406 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
407 first before calling maybe_constant_value for warn_for_div_by_zero
408 or invalid shift count warning purposes.
410 2013-04-09 Jason Merrill <jason@redhat.com>
413 * rtti.c (build_typeid): Check the address of the argument
414 rather than looking for an INDIRECT_REF.
416 2013-04-04 Jason Merrill <jason@redhat.com>
420 * typeck2.c (abstract_virtuals_error_sfinae): Disable
423 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
426 * decl.c (validate_constexpr_redeclaration): Allow an explicit
427 specialization to be different wrt the constexpr specifier.
429 2013-04-06 Jason Merrill <jason@redhat.com>
431 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
434 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
436 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
437 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
439 2013-04-03 Jason Merrill <jason@redhat.com>
441 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
442 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
443 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
445 * mangle.c (write_type): When writing a function type with
446 function-cv-quals, don't add the unqualified type as a
447 substitution candidate.
449 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
452 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
455 2013-04-03 Jakub Jelinek <jakub@redhat.com>
458 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
459 from args to new_args.
460 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
461 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
463 2013-04-02 Jason Merrill <jason@redhat.com>
466 * mangle.c (write_function_type): Mangle ref-qualifier.
467 (write_nested_name): Likewise.
468 (canonicalize_for_substitution): Preserve ref-qualifier.
469 (write_type): Likewise.
472 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
474 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
476 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
477 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
478 (for_each_template_parm_r): Use TYPE_TI_ARGS.
480 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
482 * cp-tree.h (TAGGED_TYPE_P): Remove.
483 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
484 (TYPE_ANONYMOUS_P): Adjust.
485 * call.c (build_new_op_1): Likewise.
486 * class.c (find_abi_tags_r): Likewise.
487 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
488 type_is_deprecated): Likewise.
489 * decl2.c (grokfield, min_vis_r): Likewise.
490 * pt.c (get_template_info): Likewise.
491 * tree.c (handle_abi_tag_attribute): Likewise.
493 2013-04-01 Jason Merrill <jason@redhat.com>
495 * semantics.c (maybe_constant_value): Check
496 instantiation_dependent_expression_p.
497 * pt.c (build_non_dependent_expr): Don't check it here.
500 * init.c (build_new): Don't try to process an array initializer
501 at template definition time.
504 * typeck.c (finish_class_member_access_expr): Handle enum scope.
507 * parser.c (cp_parser_range_for): Don't try to do auto deduction
508 in a template if the type of the range is incomplete.
510 * call.c (add_function_candidate): Take the address of 'this' here.
511 (build_over_call): And here.
512 (build_new_method_call_1, build_op_call_1): Not here.
513 (build_user_type_conversion_1): Or here.
514 (add_candidates): Adjust.
516 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
517 * class.c (same_signature_p): Use type_memfn_quals.
518 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
519 FUNCTION_OR_METHOD_TYPE_CHECK.
520 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
521 * pt.c (unify): Use static_fn_type.
523 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
524 Jason Merrill <jason@redhat.com>
526 Implement N2439 (ref-qualifiers for 'this')
527 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
528 (FUNCTION_RVALUE_QUALIFIED): New.
529 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
530 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
531 (cp_ref_qualifier): New enum.
532 (cp_declarator): Add ref_qualifier.
533 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
534 (cp_parser_direct_declarator): Use it.
535 (make_call_declarator): Adjust.
536 (cp_parser_lambda_declarator_opt): Adjust.
537 * call.c (add_function_candidate): Handle ref-qualifier overload
538 resolution semantics.
539 (standard_conversion): Adjust.
540 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
541 * decl.c (grokdeclarator): Handle ref-qualifiers.
542 (grokfndecl): Check for invalid ref-qualifiers.
543 (static_fn_type, revert_static_member_fn): Adjust.
544 * decl2.c (build_memfn_type): Handle ref-qualifiers.
545 (check_classfn): Check them.
546 (cp_reconstruct_complex_type): Retain them.
547 * error.c (dump_ref_qualifier): New.
548 (dump_type_suffix, dump_function_decl): Use it.
549 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
550 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
551 (unify): Retain them.
552 * tree.c (cp_check_qualified_type): New.
553 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
554 (build_ref_qualified_type): New.
555 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
556 (cp_build_type_attribute_variant): Keep ref-qualifier.
557 * typeck.c (merge_types): Keep ref-qualifier.
558 (structural_comptypes): Compare ref-qualifier.
559 (type_memfn_rqual): New.
560 (apply_memfn_quals): Take ref-qual argument.
561 * typeck2.c (build_m_component_ref): Check ref-qualifier.
563 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
565 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
566 (DECL_FUNCTION_TEMPLATE_P): Adjust.
568 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
569 pp_cxx_qualified_id): Use get_containing_scope.
570 * parser.c (cp_parser_class_head): Likewise.
571 * pt.c (push_template_decl_real): Likewise.
573 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
574 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
576 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
578 * decl2.c (collect_candidates_for_java_method_aliases): Use
580 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
581 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
582 * decl.c (duplicate_decls): Likewise.
583 * parser.c (cp_parser_template_declaration_after_export): Likewise,
584 also DECL_DECLARES_TYPE_P.
585 * pt.c (instantiate_class_template_1): Likewise.
586 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
587 (lookup_field_r): Likewise.
588 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
589 (lookup_fnfields_slot_nolazy): Likewise.
590 * semantics.c (finish_member_declaration): Likewise.
591 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
593 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
595 * pt.c (template_parms_to_args): Fix typo in comment.
597 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
599 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
601 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
603 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
604 (build_op_call_1): Likewise.
605 (build_over_call): Likewise.
606 (compare_ics): Likewise.
607 * class.c (build_base_path): Likewise.
608 (resolve_address_of_overloaded_function): Likewise.
609 * cp-tree.h: Likewise.
610 * cvt.c (cp_convert_to_pointer): Likewise.
611 (convert_to_reference): Likewise.
612 (ocp_convert): Likewise.
613 (convert_force): Likewise, tidy.
614 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
615 (pp_cxx_ptr_operator): Likewise.
616 * decl.c (duplicate_decls): Likewise.
617 (start_decl): Likewise.
618 (grok_op_properties): Likewise.
619 (start_preparsed_function): Likewise.
620 (store_parm_decls): Likewise.
621 (finish_function): Likewise.
622 * decl2.c (delete_sanity): Likewise.
623 (acceptable_java_type): Likewise.
624 (grokbitfield): Likewise.
625 (cp_reconstruct_complex_type): Likewise.
626 * error.c (dump_type_prefix): Likewise.
627 (dump_expr): Likewise.
628 * except.c (push_eh_cleanup): Likewise.
629 (complete_ptr_ref_or_void_ptr_p): Likewise.
630 (can_convert_eh): Likewise.
631 * init.c (build_new_1): Likewise.
632 (build_delete): Likewise.
633 (build_vec_delete): Likewise.
634 * mangle.c (write_type): Likewise.
635 * parser.c (lookup_literal_operator): Likewise.
636 * pt.c (convert_nontype_argument_function): Likewise.
637 (convert_nontype_argument): Likewise.
640 (dependent_type_p_r): Likewise.
641 * rtti.c (build_headof): Likewise.
642 (build_typeid): Likewise.
643 (build_dynamic_cast_1): Likewise.
644 (target_incomplete_p): Likewise.
645 (typeinfo_in_lib_p): Likewise.
646 * semantics.c (finish_omp_for): Likewise.
647 (cxx_eval_call_expression): Likewise.
648 (maybe_resolve_dummy): Likewise.
649 * tree.c (build_target_expr): Likewise.
650 (cp_build_qualified_type_real): Likewise.
651 * typeck.c (composite_pointer_type_r): Likewise.
652 (composite_pointer_type): Likewise.
653 (comp_except_types): Likewise.
654 (cxx_sizeof_nowarn): Likewise.
655 (string_conv_p): Likewise.
656 (cp_build_array_ref): Likewise.
657 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
658 (pointer_diff): Likewise.
659 (cp_build_addr_expr_1): Likewise.
660 (cp_build_unary_op): Likewise.
661 (build_static_cast_1): Likewise.
662 (cp_build_c_cast): Likewise.
663 (comp_ptr_ttypes_real): Likewise.
664 (ptr_reasonably_similar): Likewise.
665 (comp_ptr_ttypes_const): Likewise.
666 (casts_away_constness): Likewise.
667 (check_literal_operator_args): Likewise.
668 * typeck2.c (build_x_arrow): Likewise.
669 (add_exception_specifier): Likewise.
671 2013-03-29 Jason Merrill <jason@redhat.com>
674 * cp-tree.h (AUTO_IS_DECLTYPE): New.
675 * parser.c (cp_parser_decltype): Handle decltype(auto).
676 (cp_parser_type_id_1): Allow auto without a late-specified
678 (cp_parser_primary_expression): Use the return value of
679 finish_parenthesized_expr.
680 (cp_parser_transaction_expression): Likewise.
681 * semantics.c (force_paren_expr): New.
682 (finish_parenthesized_expr): Use it.
683 * call.c (build_conditional_expr_1): Likewise.
684 * pt.c (do_auto_deduction): Handle decltype(auto).
685 (tsubst_copy): Handle PAREN_EXPR.
686 (tsubst_copy_and_build): Likewise.
687 * error.c (dump_expr): Handle PAREN_EXPR.
688 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
689 * mangle.c (write_expression): Ignore PAREN_EXPR.
691 * parser.c (cp_parser_decltype_expr): Split out...
692 (cp_parser_decltype): ...from here.
696 * pt.c (unify_pack_expansion): Fix indexing.
698 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
700 * call.c (build_java_interface_fn_ref): Likewise.
701 (make_temporary_var_for_ref_to_temp): Likewise.
702 * class.c (check_field_decls): Likewise.
703 (layout_class_type): Likewise.
704 (finish_struct_1): Likewise.
705 (fixed_type_or_null): Likewise.
706 (get_vtbl_decl_for_binfo): Likewise.
707 * cp-gimplify.c (omp_var_to_track): Likewise.
708 (cp_genericize_r): Likewise.
709 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
710 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
711 (DECL_DISCRIMINATOR_P): Likewise.
712 * decl.c (poplevel): Likewise.
713 (decls_match): Likewise.
714 (duplicate_decls): Likewise.
715 (decl_jump_unsafe): Likewise.
716 (start_decl): Likewise.
717 (check_for_uninitialized_const_var): Likewise.
718 (make_rtl_for_nonlocal_decl): Likewise.
719 (cp_finish_decl): Likewise.
720 (expand_static_init): Likewise.
721 (local_variable_p): Likewise.
722 (maybe_register_incomplete_var): Likewise.
723 * decl2.c (grokfield): Likewise.
724 (comdat_linkage): Likewise.
725 (determine_visibility): Likewise.
726 (import_export_decl): Likewise.
727 (prune_vars_needing_no_initialization): Likewise.
728 (decl_maybe_constant_var_p): Likewise.
729 * error.c (dump_simple_decl): Likewise.
730 (dump_template_decl): Likewise.
731 (cp_printer): Likewise.
732 * except.c (build_throw): Likewise.
733 * init.c (build_vtbl_address): Likewise.
734 (member_init_ok_or_else): Likewise.
735 (build_aggr_init): Likewise.
736 (expand_aggr_init_1): Likewise.
737 (build_offset_ref): Likewise.
738 (constant_value_1): Likewise.
739 * mangle.c (write_mangled_name): Likewise.
740 (write_prefix): Likewise.
741 * name-lookup.c (supplement_binding_1): Likewise.
742 (add_decl_to_level): Likewise.
743 (pushdecl_maybe_friend_1): Likewise.
744 (check_for_out_of_scope_variable): Likewise.
745 (validate_nonmember_using_decl): Likewise.
746 (lookup_name_innermost_nonclass_level_1): Likewise.
747 (lookup_arg_dependent_1): Likewise.
748 * parser.c (cp_parser_lambda_introducer): Likewise.
749 (cp_parser_template_argument): Likewise.
750 (cp_parser_single_declaration): Likewise.
751 * pt.c (convert_nontype_argument): Likewise.
752 (instantiate_class_template_1): Likewise.
753 (tsubst_decl): Likewise.
754 (tsubst_expr): Likewise.
755 (do_decl_instantiation): Likewise.
756 (do_type_instantiation): Likewise.
757 (regenerate_decl_from_template): Likewise.
758 (always_instantiate_p): Likewise.
759 (instantiate_decl): Likewise.
760 (type_dependent_expression_p): Likewise.
761 (build_non_dependent_expr): Likewise.
762 * repo.c (repo_emit_p): Likewise.
763 * rtti.c (build_dynamic_cast_1): Likewise.
764 * search.c (shared_member_p): Likewise.
765 * semantics.c (outer_var_p): Likewise.
766 (finish_id_expression): Likewise.
767 (finish_omp_clauses): Likewise.
768 (finish_decltype_type): Likewise.
769 (ensure_literal_type_for_constexpr_object): Likewise.
770 * tree.c (lvalue_kind): Likewise.
771 (bot_replace): Likewise.
772 (cp_tree_equal): Likewise.
773 (handle_init_priority_attribute): Likewise.
774 (decl_storage_duration): Likewise.
775 * typeck.c (cxx_sizeof_expr): Likewise.
776 (cxx_alignof_expr): Likewise.
777 (decay_conversion): Likewise.
778 (build_class_member_access_expr): Likewise.
779 (cp_build_array_ref): Likewise.
780 (cxx_mark_addressable): Likewise.
781 (maybe_warn_about_returning_address_of_local): Likewise.
782 (check_return_expr): Likewise.
783 * typeck2.c (cxx_readonly_error): Likewise.
784 (abstract_virtuals_error_sfinae): Likewise.
785 (cxx_incomplete_type_diagnostic): Likewise.
787 2013-03-28 Lawrence Crowl <crowl@google.com>
790 (CXX_PARSER_H): Add header dependence.
792 (extern debug (cp_binding_level &)): New.
793 (extern debug (cp_binding_level *)): New.
795 (debug (cp_binding_level &)): New.
796 (debug (cp_binding_level *)): New.
798 (debug (cp_parser &)): New.
799 (debug (cp_parser *)): New.
800 (debug (cp_token &)): New.
801 (debug (cp_token *)): New.
802 (debug (vec<cp_token, va_gc> &)): New.
803 (debug (vec<cp_token, va_gc> *)): New.
804 * parser.c: Add header dependence.
805 (extern debug (cp_parser &)): New.
806 (extern debug (cp_parser *)): New.
807 (extern debug (cp_token &)): New.
808 (extern debug (cp_token *)): New.
809 (extern debug (vec<cp_token, va_gc> &)): New.
810 (extern debug (vec<cp_token, va_gc> *)): New.
812 2013-03-28 Jason Merrill <jason@redhat.com>
816 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
817 the type if tf_decltype is set.
818 * pt.c (fn_type_unification): Add decltype_p parm.
819 (get_bindings): Adjust.
821 * class.c (resolve_address_of_overloaded_function): Adjust.
822 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
825 * parser.c (cp_parser_sizeof_pack): Split out from...
826 (cp_parser_sizeof_operand): ...here. Require (id).
829 * semantics.c (finish_this_expr): 'this' is an rvalue.
830 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
833 * semantics.c (finish_member_declaration): Don't push closure
836 * name-lookup.c (pushdecl_maybe_friend_1): Use
837 nonlambda_method_basetype and current_nonlambda_class_type.
840 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
841 conversion from integer to pointer.
842 (cxx_eval_constant_expression): Likewise.
843 (cxx_eval_indirect_ref): Use the folded operand if we still think
844 this might be constant.
846 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
847 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
850 * call.c (convert_like_real): Change series of two permerrors
851 to permerror + inform (and likewise for two errors).
852 (build_new_method_call_1): Likewise.
853 * typeck.c (convert_for_initialization): Change additional
854 warning or error to inform.
856 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
858 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
859 (first_aggr_init_expr): Likewise.
860 (more_aggr_init_expr_args_p): Likewise.
861 (type_of_this_parm): Likewise.
862 (class_of_this_parm): Likewise.
863 * name-lookup.h (get_global_value_if_present): Likewise.
864 (is_typename_at_global_scope): Likewise.
866 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
868 * call.c (joust): Don't call inform for a permerror returning false.
869 * parser.c (cp_parser_check_class_key): Likewise.
870 * pt.c (tsubst_copy_and_build): Likewise.
872 2013-03-27 Jason Merrill <jason@redhat.com>
875 * semantics.c (finish_qualified_id_expr): Return early
878 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
880 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
881 * cvt.c (convert_to_void): Likewise.
882 * error.c (dump_expr): Likewise.
883 * mangle.c (write_expression): Likewise.
884 * parser.c (cp_parser_template_argument): Likewise.
885 * pt.c (convert_nontype_argument): Likewise.
886 (tsubst_copy_and_build): Likewise.
887 * rtti.c (build_typeid): Likewise.
888 * semantics.c (finish_call_expr): Likewise.
889 (finish_decltype_type): Likewise.
890 (build_data_member_initialization): Likewise.
891 * tree.c (is_dummy_object): Likewise.
892 * typeck.c (decay_conversion): Likewise.
893 (build_class_member_access_expr): Likewise.
894 (cp_build_addr_expr_1): Likewise.
895 (unary_complex_lvalue): Likewise.
896 (check_return_expr): Likewise.
897 * typeck2.c (cxx_readonly_error): Likewise.
899 2013-03-26 Jason Merrill <jason@redhat.com>
902 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
903 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
904 * cp-tree.h: Adjust prototype.
907 * typeck2.c (build_m_component_ref): Handle prvalue object.
909 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
911 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
912 * decl.c (duplicate_decls): Likewise.
913 (cp_finish_decl): Likewise.
914 (check_class_member_definition_namespace): Likewise.
915 * decl2.c (grokfield): Likewise.
916 (decl_needed_p): Likewise.
917 (import_export_decl): Likewise.
918 (mark_used): Likewise.
919 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
920 * pt.c (push_access_scope): Likewise.
921 (instantiate_decl): Likewise.
922 * ptree.c (cxx_print_decl): Likewise.
923 * repo.c (repo_emit_p): Likewise.
924 * semantics.c (note_decl_for_pch): Likewise.
925 * tree.c (decl_linkage): Likewise.
927 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
930 * decl.c (check_array_designated_initializer): Handle CONST_DECL
933 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
935 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
938 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
940 2013-03-25 Jason Merrill <jason@redhat.com>
943 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
944 class is derived from the type of the object.
947 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
950 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
953 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
954 DECL_TEMPLATE_INSTANTIATION.
956 2013-03-22 Jason Merrill <jason@redhat.com>
959 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
962 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
964 * cp-tree.h (identifier_p): New.
965 * call.c: Throughout, call identifier_p insstead of direct
966 comparaison of TREE_CODE against IDENTIFIER_NODE.
970 * mangle.c: Likewise.
971 * name-lookup.c: Likewise.
972 * parser.c: Likewise.
974 * search.c: Likewise.
975 * semantics.c: Likewise.
977 * typeck.c: Likewise.
978 * typeck2.c: Likewise.
980 2013-03-21 Jakub Jelinek <jakub@redhat.com>
983 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
984 * call.c (build_temp): Likewise.
985 * method.c (synthesize_method): Likewise.
986 * typeck.c (convert_for_initialization): Likewise.
988 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
990 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
992 2013-03-21 Richard Biener <rguenther@suse.de>
994 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
995 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
997 2013-03-20 Jason Merrill <jason@redhat.com>
1000 * parser.c (cp_parser_late_return_type_opt): Save and restore
1001 current_class_ptr/ref.
1004 * expr.c (cplus_expand_constant): Do nothing if the class is
1006 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1007 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1008 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1009 (complete_vars): Likewise.
1011 * name-lookup.c (get_anonymous_namespace_name): Never use
1012 get_file_function_name.
1014 * pt.c (retrieve_specialization): Handle null tmpl argument.
1018 * pt.c (tsubst_decl): Check return value of register_specialization.
1019 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1022 2013-03-17 Jason Merrill <jason@redhat.com>
1026 * parser.c (cp_parser_direct_declarator): Bail if we see a
1027 qualified-id not at namespace scope.
1031 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1034 2013-03-16 Jason Merrill <jason@redhat.com>
1036 * decl.c (grokdeclarator): Assert that we won't see a pointer to
1040 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1041 (MAYBE_CLASS_TYPE_P): ...here.
1042 * semantics.c (lambda_capture_field_type): Only build a
1043 magic decltype for wildcard types.
1044 (lambda_proxy_type): Likewise.
1045 (finish_non_static_data_member): Get the quals from
1049 * parser.c (cp_parser_template_argument): Don't
1050 fold_non_dependent_expr.
1052 * parser.c (cp_parser_lambda_declarator_opt): Use
1053 cp_parser_trailing_type_id.
1056 * parser.c (cp_parser_template_id): Don't forget access checks.
1059 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1063 * name-lookup.h (tag_scope): Add ts_lambda.
1064 * semantics.c (begin_lambda_type): Use it.
1065 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1066 * pt.c (check_default_tmpl_args): Ignore lambdas.
1067 (push_template_decl_real): Handle lambdas.
1068 * tree.c (no_linkage_check): Adjust lambda check.
1071 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1074 * parser.c (cp_parser_direct_declarator): Fix late return
1075 for out-of-class defn of member function.
1078 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1079 parms to avoid duplicate -Wshadow warnings.
1081 * search.c (lookup_base): Handle NULL_TREE.
1084 * semantics.c (potential_constant_expression_1): Use of 'this' in
1085 a non-constexpr function makes the expression not potentially
1090 * cp-tree.h (tsubst_flags): Add tf_decltype.
1091 * call.c (build_cxx_call): Don't build a temporary if it's set.
1092 (build_over_call): Make sure it's only passed to build_cxx_call.
1093 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1094 (cp_parser_unary_expression): Likewise.
1095 (cp_parser_cast_expression): Likewise.
1096 (cp_parser_binary_expression): Likewise.
1097 (cp_parser_assignment_expression): Likewise.
1098 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
1099 (cp_parser_expression): Add decltype_p. Force a
1100 temporary for a call on the LHS of a comma.
1101 (cp_parser_decltype): Pass true to decltype_p parms.
1102 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1103 (tsubst_copy_and_build): Pass tf_decltype down only for
1104 CALL_EXPR and the RHS of COMPOUND_EXPR.
1105 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1107 * cp-tree.h (abstract_class_use): New enum.
1108 * typeck2.c (pending_abstract_type): Add use field.
1109 (abstract_virtuals_error_sfinae): Add overloads taking
1110 abstract_class_use instead of tree.
1111 * typeck.c (build_static_cast_1): Call it.
1112 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1113 * pt.c: Adjust calls.
1114 * decl.c (cp_finish_decl): Don't handle functions specially.
1115 (grokdeclarator): Always check return type.
1116 * init.c (build_new_1): Adjust call.
1120 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1121 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1124 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1125 (tsubst_arg_types): Likewise.
1129 * call.c (convert_like_real): Check for explicit constructors
1130 even for value-initialization.
1133 * pt.c (convert_nontype_argument): Handle invalid pointer.
1135 * parser.c (cp_parser_lambda_expression): Use nreverse.
1139 * pt.c (instantiate_class_template_1): Instantiate lambda capture
1141 (tsubst_copy_and_build): Not here.
1144 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1147 * parser.c (parsing_nsdmi): New.
1148 * semantics.c (outer_automatic_var_p): Check it.
1149 (finish_id_expression): Likewise.
1150 * cp-tree.h: Declare it.
1153 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1155 * parser.c (lookup_literal_operator): Correct parm/arg naming
1159 * pt.c (fold_non_dependent_expr_sfinae): Check
1160 instantiation_dependent_expression_p.
1163 * class.c (resolve_address_of_overloaded_function): Accept a
1164 reference to function for target_type.
1165 (instantiate_type): Likewise.
1166 * pt.c (convert_nontype_argument): Pass it to
1167 convert_nontype_argument_function.
1169 2013-03-16 Jakub Jelinek <jakub@redhat.com>
1171 * tree.c (cp_tree_equal): Fix a pasto.
1174 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1175 pass op1 through maybe_constant_value first.
1177 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
1180 * semantics.c (cxx_eval_array_reference): Check for negative index.
1182 2013-03-14 Jason Merrill <jason@redhat.com>
1185 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1188 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1189 dso_handle parm on targets without __cxa_atexit.
1191 2013-03-11 Jason Merrill <jason@redhat.com>
1194 * typeck.c (check_return_expr): Disallow returning init list here.
1195 * semantics.c (apply_deduced_return_type): Not here.
1197 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1200 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1201 * error.c (dump_expr): Likewise.
1203 2013-03-08 Jason Merrill <jason@redhat.com>
1206 * class.c (modify_all_vtables): Mangle the vtable name before
1209 * semantics.c (lambda_expr_this_capture): In unevaluated context,
1210 just return the nearest 'this'.
1215 * tree.c (maybe_dummy_object): Don't capture 'this'.
1216 * semantics.c (maybe_resolve_dummy): New.
1217 (finish_non_static_data_member): Use it.
1218 (finish_qualified_id_expr): Don't test is_dummy_object.
1219 * cp-tree.h: Declare maybe_resolve_dummy.
1220 * call.c (build_new_method_call_1): Use it.
1223 * semantics.c (apply_deduced_return_type): Don't allow returning
1224 std::initializer_list.
1226 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1229 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1230 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1231 * decl.c (check_elaborated_type_specifier): Tidy.
1233 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1236 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1238 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1240 * parser.c (cp_parser_braced_list): For {} initialize
1241 *non_constant_p to false.
1243 2013-03-04 Jason Merrill <jason@redhat.com>
1247 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1248 and non-class scopes.
1250 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1252 * decl.c (grokdeclarator): Remove dead code.
1254 2013-02-28 Jason Merrill <jason@redhat.com>
1257 * semantics.c (potential_constant_expression_1): Use
1258 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1261 * call.c (build_over_call): Avoid virtual lookup in a template.
1263 2013-02-27 Jason Merrill <jason@redhat.com>
1267 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1268 of the base name for inheriting ctors.
1269 (push_class_level_binding_1): Remove inheriting ctor handling.
1270 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1271 * class.c (add_implicitly_declared_members): Adjust.
1273 2013-02-26 David Binderman <dcb314@hotmail.com>
1276 * decl.c (grokdeclarator): Tidy publicp assignment.
1278 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1281 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1282 (build_transaction_expr): Same.
1284 2013-02-25 Jason Merrill <jason@redhat.com>
1287 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1288 we know what args we're looking at.
1291 * semantics.c (potential_constant_expression_1): In C++98, a cast
1292 to non-integral type can't be a constant expression.
1294 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1297 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1300 2013-02-22 Jason Merrill <jason@redhat.com>
1303 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1304 if we got the wrong number of template parms.
1307 * pt.c (fn_type_unification): Use explicit args in template
1308 instantiation context.
1311 * call.c (can_convert_arg): Discard access checks.
1314 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1317 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1320 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1321 * cvt.c (ocp_convert): Use the latter.
1322 (cp_convert_to_pointer): Likewise.
1323 * decl.c (check_default_argument): Likewise.
1324 * typeck.c (cp_build_binary_op): Likewise.
1325 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1327 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1328 Paolo Carlini <paolo.carlini@oracle.com>
1331 * decl2.c (grokbitfield): Allow scoped enumeration types.
1333 2013-02-15 Jason Merrill <jason@redhat.com>
1336 * semantics.c (finish_id_expression): Also return the identifier
1337 for an outer local static.
1340 * class.c (check_bases_and_members): Deduce noexcept after
1344 * semantics.c (finish_id_expression): In a template, return
1345 the identifier for a constant variable.
1347 2013-02-14 Jason Merrill <jason@redhat.com>
1350 * semantics.c (build_anon_member_initialization): New.
1351 (build_data_member_initialization): Use it.
1354 * decl.c (cp_finish_decl): Force instantiation of an
1355 auto static data member.
1358 * pt.c (unify): A pack expansion that is not the last template
1359 argument makes the entire template argument list non-deduced.
1362 * name-lookup.c (do_class_using_decl): Handle typedefs with
1363 inheriting constructors.
1364 (push_class_level_binding_1): Allow inheriting from template
1365 template parameter, too.
1366 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1369 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1370 default argument scope.
1371 * mangle.c (write_name): Likewise.
1374 * error.c (find_typenames_r): Don't walk into a pack expansion.
1376 2013-02-13 Jason Merrill <jason@redhat.com>
1379 * parser.c (cp_parser_member_declaration): Check the declarator
1380 form when detecting a function declaration via typedef.
1383 * pt.c (maybe_process_partial_specialization): A lambda
1384 isn't what's being specialized.
1387 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1391 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1394 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1395 non-zero offsets, too.
1398 * decl.c (build_enumerator): Always convert the value to a
1399 fixed underlying type.
1402 * pt.c (tsubst_copy_and_build): Don't forget any new
1403 captures that arose from use of dependent names.
1405 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1408 * semantics.c (finish_asm_stmt): If input constraints allow
1409 neither register nor memory, try maybe_constant_value to get
1410 a constant if possible.
1412 2013-02-12 Jason Merrill <jason@redhat.com>
1415 * method.c (add_one_base_init): Handle base constructor
1416 taking rvalue reference parm.
1419 * semantics.c (sort_constexpr_mem_initializers): Handle
1422 2013-02-09 Jason Merrill <jason@redhat.com>
1425 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1426 maybe_instantiate_noexcept.
1429 * pt.c (eq_specializations): Set comparing_specializations.
1430 * tree.c (cp_tree_equal): Check it.
1431 * cp-tree.h: Declare it.
1433 * decl.c (decls_match): Check versions later.
1436 * pt.c (build_non_dependent_expr): Don't try to fold
1437 instantiation-dependent expressions.
1438 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1439 [BIND_EXPR]: Treat as dependent.
1441 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1444 * init.c (build_vec_init): Don't append NULL values into new_vec.
1445 (build_zero_init_1): Don't push anything into v if recursive call
1447 (build_value_init_noctor): Don't push anything into v if
1448 build_value_init call returned NULL_TREE.
1451 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1452 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1453 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1454 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1455 (cp_parser_cast_expression): Adjust caller.
1458 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1459 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1460 DECL_LANG_SPECIFIC (t).
1462 2013-02-07 Jason Merrill <jason@redhat.com>
1465 * method.c (do_build_copy_constructor): Don't bother turning
1466 scalars from lvalues to xvalues.
1467 (do_build_copy_assign): Likewise.
1469 2013-02-06 Jason Merrill <jason@redhat.com>
1471 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1473 2013-02-05 Jason Merrill <jason@redhat.com>
1476 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1480 * decl.c (start_preparsed_function): Update restype if we change
1484 * pt.c (fn_type_unification): Discard any access checks from
1485 substituting explicit args.
1487 2013-01-31 Jason Merrill <jason@redhat.com>
1491 * typeck.c (get_member_function_from_ptrfunc): Fix
1492 ptrmemfunc_vbit_in_delta case.
1494 2013-01-29 Jason Merrill <jason@redhat.com>
1497 * class.c (build_ctor_vtbl_group): Give construction vtables
1500 2013-01-25 Jason Merrill <jason@redhat.com>
1503 * pt.c (convert_nontype_argument_function): Handle invalid input.
1504 (convert_nontype_argument): Likewise.
1507 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1508 dynamic type has no virtual functions.
1510 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1513 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1514 on TARGET_EXPR nodes.
1516 2013-01-22 Jason Merrill <jason@redhat.com>
1519 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1521 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1524 * pt.c (argument_pack_element_is_expansion_p)
1525 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1526 (gen_elem_of_pack_expansion_instantiation): New static functions.
1527 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1528 look through the possibly resulting pack expansion as well.
1529 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1530 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1531 Use gen_elem_of_pack_expansion_instantiation to build the
1532 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1533 as gen_elem_of_pack_expansion_instantiation and the change in
1534 tsubst above generalize this particular case.
1535 (arg_from_parm_pack_p): Remove this for it's not used by
1536 tsubst_pack_expansion anymore.
1538 2013-01-21 Jason Merrill <jason@redhat.com>
1541 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1542 template args count.
1544 2013-01-18 Jason Merrill <jason@redhat.com>
1547 * decl2.c (get_local_tls_init_fn): New.
1548 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1549 with aliases for internal variables. Don't use weakrefs if
1550 the variable needs destruction.
1551 (generate_tls_wrapper): Mark the wrapper as const if no
1552 initialization is needed.
1553 (handle_tls_init): Don't require aliases.
1555 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1558 * pt.c (coerce_innermost_template_parms): New static function.
1559 (instantiate_alias_template): Use it here.
1561 2013-01-09 Jason Merrill <jason@redhat.com>
1564 * rtti.c (build_typeid, get_typeid): Add complain parm.
1565 (get_tinfo_decl_dynamic): Likewise.
1566 * cp-tree.h, parser.c, pt.c: Adjust.
1569 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1572 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1575 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1576 call maybe_constant_value for the negative or too big shift
1579 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1582 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1583 of the argument is true.
1585 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1587 * parser.c (cp_parser_initializer_list): Move declaration
1588 of variable non_const to start of lexical block.
1590 2013-01-07 Jason Merrill <jason@redhat.com>
1593 * tree.c (build_aggr_init_expr): Do nothing in a template.
1594 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1595 a FUNCTION_DECL before tsubsting.
1597 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1600 * pt.c (check_instantiated_arg): Allow type template arguments.
1602 2013-01-04 Jason Merrill <jason@redhat.com>
1605 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1606 (grokdeclarator): Use reset_type_linkage.
1607 * name-lookup.c (binding_table_foreach): Handle null table.
1608 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1610 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1612 PR c++/54526 (again)
1613 * parser.c (cp_parser_template_id): Revert core of previous change
1614 (keep adjusted inform message).
1616 2013-01-03 Jason Merrill <jason@redhat.com>
1620 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1624 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1627 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1630 * call.c (type_has_extended_temps): New.
1631 * cp-tree.h: Declare it.
1632 * decl.c (check_initializer): Use build_aggr_init for arrays
1634 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1636 2013-01-02 Jason Merrill <jason@redhat.com>
1639 * call.c (build_new_method_call_1): Don't use build_value_init for
1640 user-provided default constructors.
1642 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1646 * tree.c (build_cplus_array_type): Copy layout information
1647 to main variant if necessary.
1649 Copyright (C) 2013 Free Software Foundation, Inc.
1651 Copying and distribution of this file, with or without modification,
1652 are permitted in any medium without royalty provided the copyright
1653 notice and this notice are preserved.