1 2013-04-24 Jason Merrill <jason@redhat.com>
3 N3648: Allow braced and parenthesized initializers.
4 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
5 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
6 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
7 (add_capture): Collapse a parenthesized initializer into a single
9 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
11 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
14 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
15 * semantics.c (finish_qualified_id_expr): Likewise.
16 (finish_id_expression): Update.
17 * typeck.c (cp_build_addr_expr_1): Likewise.
18 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
19 * cp-tree.h: Update declarations.
21 2013-04-22 Jason Merrill <jason@redhat.com>
24 * parser.c (cp_parser_unqualified_id): Handle ~auto.
25 (cp_parser_pseudo_destructor_name): Likewise.
26 (cp_parser_postfix_dot_deref_expression): Adjust.
27 (cp_lexer_nth_token_is_keyword): New.
28 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
29 * typeck.c (lookup_destructor): Handle ~auto.
31 * pt.c (fn_type_unification): Push tinst level around
32 type_unification_real if we aren't explaining.
33 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
34 * error.c (dump_function_decl): Respect it.
35 (subst_to_string): Pass it.
38 * rtti.c (get_typeid): Diagnose qualified function type.
39 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
41 * error.c (dump_aggr_type): Fix lambda detection.
42 (dump_simple_decl): Pretty-print capture field.
45 * cvt.c (build_expr_type_conversion): Two conversions that return
46 the same type aren't necessarily ambiguous.
49 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
50 pedwarn unconditional except in C++1y mode.
52 * semantics.c (potential_constant_expression_1): Don't crash on
56 * semantics.c (finish_id_expression): Reject capture of anonymous
60 * decl2.c (check_default_args): Check for pack expansion.
62 * mangle.c (write_type): Mangle decltype(auto).
64 2013-04-19 Jason Merrill <jason@redhat.com>
66 N3638 changes to return type deduction
67 * decl.c (undeduced_auto_decl): New.
68 (require_deduced_type): New.
69 (fndecl_declared_return_type): New.
70 (decls_match): Use it.
71 (duplicate_decls): Don't check for auto return.
72 (grokdeclarator): Reject virtual auto.
73 * class.c (resolve_address_of_overloaded_function): Handle
74 auto function templates.
75 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
76 * cp-tree.h: Declare new fns.
77 * error.c (dump_function_decl): Use fndecl_declared_return_type.
78 * search.c (check_final_overrider): Likewise.
79 * pt.c (make_decltype_auto): New.
80 (do_auto_deduction): Require plain decltype(auto).
84 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
85 template specializations.
87 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
89 Implement n3599 - Literal operator templates for strings.
90 * parser.c (make_string_pack (tree value)): New function.
91 (cp_parser_userdef_string_literal (cp_token *)): Use it
92 to construct calls to character string literal operator templates.
93 (cp_parser_template_declaration_after_export): Check for new string
94 literal operator template parameter form.
96 2013-04-15 Jason Merrill <jason@redhat.com>
98 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
101 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
102 rather than a destructor name, it isn't an unqualified-name.
103 (tsubst_copy_and_build): Pass down decltype_flag to operator
107 * semantics.c (insert_capture_proxy): Just use index 1 in the
110 2013-04-12 Jakub Jelinek <jakub@redhat.com>
112 * error.c (cp_print_error_function,
113 print_instantiation_partial_context_line,
114 maybe_print_constexpr_context): Colorize locus strings.
116 2013-04-11 Jason Merrill <jason@redhat.com>
119 * parser.c (complain_flags): New.
120 (cp_parser_postfix_expression): Use it.
121 (cp_parser_unary_expression): Likewise.
122 (cp_parser_binary_expression): Likewise.
123 (cp_parser_assignment_expression): Likewise.
124 (cp_parser_expression): Likewise.
125 (cp_parser_postfix_open_square_expression): Take decltype_p.
126 (cp_parser_builtin_offsetof): Adjust.
127 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
128 * decl2.c (grok_array_decl): Add decltype_p parm.
129 * cp-tree.h: Adjust prototype.
130 * semantics.c (finish_unary_op_expr): Add complain parm.
132 2013-04-11 Jakub Jelinek <jakub@redhat.com>
135 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
136 calling maybe_constant_value for C++98.
138 2013-04-11 Jason Merrill <jason@redhat.com>
141 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
142 Strip references before checking WILDCARD_TYPE_P.
144 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
146 * call.c (build_conditional_expr_1, build_over_call): Protect
147 error calls with complain & tf_error.
148 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
149 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
150 build_ptrmemfunc): Likewise.
151 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
153 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
154 (convert_to_reference): Adjust.
156 2013-04-11 Jason Merrill <jason@redhat.com>
158 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
159 local variables, look them up instead.
160 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
161 proxies and substitution in unevaluated context.
162 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
163 before the iterators.
166 * pt.c (uses_deducible_template_parms): New.
167 (deducible_array_bound, deducible_expression): New.
168 (deducible_template_args): New.
169 (unify_one_argument): Call uses_deducible_template_parms.
171 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
174 * typeck2.c (build_m_component_ref): Protect error calls with
175 (complain & tf_error).
177 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
180 * parser.c (cp_parser_enum_specifier): Check for empty
181 anonymous enums and anonymous scoped enums.
183 2013-04-10 Jakub Jelinek <jakub@redhat.com>
186 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
187 first before calling maybe_constant_value for warn_for_div_by_zero
188 or invalid shift count warning purposes.
190 2013-04-09 Jason Merrill <jason@redhat.com>
193 * rtti.c (build_typeid): Check the address of the argument
194 rather than looking for an INDIRECT_REF.
196 2013-04-04 Jason Merrill <jason@redhat.com>
200 * typeck2.c (abstract_virtuals_error_sfinae): Disable
203 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
206 * decl.c (validate_constexpr_redeclaration): Allow an explicit
207 specialization to be different wrt the constexpr specifier.
209 2013-04-06 Jason Merrill <jason@redhat.com>
211 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
214 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
216 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
217 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
219 2013-04-03 Jason Merrill <jason@redhat.com>
221 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
222 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
223 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
225 * mangle.c (write_type): When writing a function type with
226 function-cv-quals, don't add the unqualified type as a
227 substitution candidate.
229 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
232 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
235 2013-04-03 Jakub Jelinek <jakub@redhat.com>
238 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
239 from args to new_args.
240 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
241 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
243 2013-04-02 Jason Merrill <jason@redhat.com>
246 * mangle.c (write_function_type): Mangle ref-qualifier.
247 (write_nested_name): Likewise.
248 (canonicalize_for_substitution): Preserve ref-qualifier.
249 (write_type): Likewise.
252 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
254 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
256 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
257 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
258 (for_each_template_parm_r): Use TYPE_TI_ARGS.
260 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
262 * cp-tree.h (TAGGED_TYPE_P): Remove.
263 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
264 (TYPE_ANONYMOUS_P): Adjust.
265 * call.c (build_new_op_1): Likewise.
266 * class.c (find_abi_tags_r): Likewise.
267 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
268 type_is_deprecated): Likewise.
269 * decl2.c (grokfield, min_vis_r): Likewise.
270 * pt.c (get_template_info): Likewise.
271 * tree.c (handle_abi_tag_attribute): Likewise.
273 2013-04-01 Jason Merrill <jason@redhat.com>
275 * semantics.c (maybe_constant_value): Check
276 instantiation_dependent_expression_p.
277 * pt.c (build_non_dependent_expr): Don't check it here.
280 * init.c (build_new): Don't try to process an array initializer
281 at template definition time.
284 * typeck.c (finish_class_member_access_expr): Handle enum scope.
287 * parser.c (cp_parser_range_for): Don't try to do auto deduction
288 in a template if the type of the range is incomplete.
290 * call.c (add_function_candidate): Take the address of 'this' here.
291 (build_over_call): And here.
292 (build_new_method_call_1, build_op_call_1): Not here.
293 (build_user_type_conversion_1): Or here.
294 (add_candidates): Adjust.
296 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
297 * class.c (same_signature_p): Use type_memfn_quals.
298 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
299 FUNCTION_OR_METHOD_TYPE_CHECK.
300 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
301 * pt.c (unify): Use static_fn_type.
303 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
304 Jason Merrill <jason@redhat.com>
306 Implement N2439 (ref-qualifiers for 'this')
307 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
308 (FUNCTION_RVALUE_QUALIFIED): New.
309 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
310 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
311 (cp_ref_qualifier): New enum.
312 (cp_declarator): Add ref_qualifier.
313 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
314 (cp_parser_direct_declarator): Use it.
315 (make_call_declarator): Adjust.
316 (cp_parser_lambda_declarator_opt): Adjust.
317 * call.c (add_function_candidate): Handle ref-qualifier overload
318 resolution semantics.
319 (standard_conversion): Adjust.
320 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
321 * decl.c (grokdeclarator): Handle ref-qualifiers.
322 (grokfndecl): Check for invalid ref-qualifiers.
323 (static_fn_type, revert_static_member_fn): Adjust.
324 * decl2.c (build_memfn_type): Handle ref-qualifiers.
325 (check_classfn): Check them.
326 (cp_reconstruct_complex_type): Retain them.
327 * error.c (dump_ref_qualifier): New.
328 (dump_type_suffix, dump_function_decl): Use it.
329 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
330 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
331 (unify): Retain them.
332 * tree.c (cp_check_qualified_type): New.
333 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
334 (build_ref_qualified_type): New.
335 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
336 (cp_build_type_attribute_variant): Keep ref-qualifier.
337 * typeck.c (merge_types): Keep ref-qualifier.
338 (structural_comptypes): Compare ref-qualifier.
339 (type_memfn_rqual): New.
340 (apply_memfn_quals): Take ref-qual argument.
341 * typeck2.c (build_m_component_ref): Check ref-qualifier.
343 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
345 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
346 (DECL_FUNCTION_TEMPLATE_P): Adjust.
348 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
349 pp_cxx_qualified_id): Use get_containing_scope.
350 * parser.c (cp_parser_class_head): Likewise.
351 * pt.c (push_template_decl_real): Likewise.
353 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
354 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
356 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
358 * decl2.c (collect_candidates_for_java_method_aliases): Use
360 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
361 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
362 * decl.c (duplicate_decls): Likewise.
363 * parser.c (cp_parser_template_declaration_after_export): Likewise,
364 also DECL_DECLARES_TYPE_P.
365 * pt.c (instantiate_class_template_1): Likewise.
366 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
367 (lookup_field_r): Likewise.
368 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
369 (lookup_fnfields_slot_nolazy): Likewise.
370 * semantics.c (finish_member_declaration): Likewise.
371 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
373 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
375 * pt.c (template_parms_to_args): Fix typo in comment.
377 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
379 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
381 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
383 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
384 (build_op_call_1): Likewise.
385 (build_over_call): Likewise.
386 (compare_ics): Likewise.
387 * class.c (build_base_path): Likewise.
388 (resolve_address_of_overloaded_function): Likewise.
389 * cp-tree.h: Likewise.
390 * cvt.c (cp_convert_to_pointer): Likewise.
391 (convert_to_reference): Likewise.
392 (ocp_convert): Likewise.
393 (convert_force): Likewise, tidy.
394 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
395 (pp_cxx_ptr_operator): Likewise.
396 * decl.c (duplicate_decls): Likewise.
397 (start_decl): Likewise.
398 (grok_op_properties): Likewise.
399 (start_preparsed_function): Likewise.
400 (store_parm_decls): Likewise.
401 (finish_function): Likewise.
402 * decl2.c (delete_sanity): Likewise.
403 (acceptable_java_type): Likewise.
404 (grokbitfield): Likewise.
405 (cp_reconstruct_complex_type): Likewise.
406 * error.c (dump_type_prefix): Likewise.
407 (dump_expr): Likewise.
408 * except.c (push_eh_cleanup): Likewise.
409 (complete_ptr_ref_or_void_ptr_p): Likewise.
410 (can_convert_eh): Likewise.
411 * init.c (build_new_1): Likewise.
412 (build_delete): Likewise.
413 (build_vec_delete): Likewise.
414 * mangle.c (write_type): Likewise.
415 * parser.c (lookup_literal_operator): Likewise.
416 * pt.c (convert_nontype_argument_function): Likewise.
417 (convert_nontype_argument): Likewise.
420 (dependent_type_p_r): Likewise.
421 * rtti.c (build_headof): Likewise.
422 (build_typeid): Likewise.
423 (build_dynamic_cast_1): Likewise.
424 (target_incomplete_p): Likewise.
425 (typeinfo_in_lib_p): Likewise.
426 * semantics.c (finish_omp_for): Likewise.
427 (cxx_eval_call_expression): Likewise.
428 (maybe_resolve_dummy): Likewise.
429 * tree.c (build_target_expr): Likewise.
430 (cp_build_qualified_type_real): Likewise.
431 * typeck.c (composite_pointer_type_r): Likewise.
432 (composite_pointer_type): Likewise.
433 (comp_except_types): Likewise.
434 (cxx_sizeof_nowarn): Likewise.
435 (string_conv_p): Likewise.
436 (cp_build_array_ref): Likewise.
437 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
438 (pointer_diff): Likewise.
439 (cp_build_addr_expr_1): Likewise.
440 (cp_build_unary_op): Likewise.
441 (build_static_cast_1): Likewise.
442 (cp_build_c_cast): Likewise.
443 (comp_ptr_ttypes_real): Likewise.
444 (ptr_reasonably_similar): Likewise.
445 (comp_ptr_ttypes_const): Likewise.
446 (casts_away_constness): Likewise.
447 (check_literal_operator_args): Likewise.
448 * typeck2.c (build_x_arrow): Likewise.
449 (add_exception_specifier): Likewise.
451 2013-03-29 Jason Merrill <jason@redhat.com>
454 * cp-tree.h (AUTO_IS_DECLTYPE): New.
455 * parser.c (cp_parser_decltype): Handle decltype(auto).
456 (cp_parser_type_id_1): Allow auto without a late-specified
458 (cp_parser_primary_expression): Use the return value of
459 finish_parenthesized_expr.
460 (cp_parser_transaction_expression): Likewise.
461 * semantics.c (force_paren_expr): New.
462 (finish_parenthesized_expr): Use it.
463 * call.c (build_conditional_expr_1): Likewise.
464 * pt.c (do_auto_deduction): Handle decltype(auto).
465 (tsubst_copy): Handle PAREN_EXPR.
466 (tsubst_copy_and_build): Likewise.
467 * error.c (dump_expr): Handle PAREN_EXPR.
468 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
469 * mangle.c (write_expression): Ignore PAREN_EXPR.
471 * parser.c (cp_parser_decltype_expr): Split out...
472 (cp_parser_decltype): ...from here.
476 * pt.c (unify_pack_expansion): Fix indexing.
478 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
480 * call.c (build_java_interface_fn_ref): Likewise.
481 (make_temporary_var_for_ref_to_temp): Likewise.
482 * class.c (check_field_decls): Likewise.
483 (layout_class_type): Likewise.
484 (finish_struct_1): Likewise.
485 (fixed_type_or_null): Likewise.
486 (get_vtbl_decl_for_binfo): Likewise.
487 * cp-gimplify.c (omp_var_to_track): Likewise.
488 (cp_genericize_r): Likewise.
489 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
490 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
491 (DECL_DISCRIMINATOR_P): Likewise.
492 * decl.c (poplevel): Likewise.
493 (decls_match): Likewise.
494 (duplicate_decls): Likewise.
495 (decl_jump_unsafe): Likewise.
496 (start_decl): Likewise.
497 (check_for_uninitialized_const_var): Likewise.
498 (make_rtl_for_nonlocal_decl): Likewise.
499 (cp_finish_decl): Likewise.
500 (expand_static_init): Likewise.
501 (local_variable_p): Likewise.
502 (maybe_register_incomplete_var): Likewise.
503 * decl2.c (grokfield): Likewise.
504 (comdat_linkage): Likewise.
505 (determine_visibility): Likewise.
506 (import_export_decl): Likewise.
507 (prune_vars_needing_no_initialization): Likewise.
508 (decl_maybe_constant_var_p): Likewise.
509 * error.c (dump_simple_decl): Likewise.
510 (dump_template_decl): Likewise.
511 (cp_printer): Likewise.
512 * except.c (build_throw): Likewise.
513 * init.c (build_vtbl_address): Likewise.
514 (member_init_ok_or_else): Likewise.
515 (build_aggr_init): Likewise.
516 (expand_aggr_init_1): Likewise.
517 (build_offset_ref): Likewise.
518 (constant_value_1): Likewise.
519 * mangle.c (write_mangled_name): Likewise.
520 (write_prefix): Likewise.
521 * name-lookup.c (supplement_binding_1): Likewise.
522 (add_decl_to_level): Likewise.
523 (pushdecl_maybe_friend_1): Likewise.
524 (check_for_out_of_scope_variable): Likewise.
525 (validate_nonmember_using_decl): Likewise.
526 (lookup_name_innermost_nonclass_level_1): Likewise.
527 (lookup_arg_dependent_1): Likewise.
528 * parser.c (cp_parser_lambda_introducer): Likewise.
529 (cp_parser_template_argument): Likewise.
530 (cp_parser_single_declaration): Likewise.
531 * pt.c (convert_nontype_argument): Likewise.
532 (instantiate_class_template_1): Likewise.
533 (tsubst_decl): Likewise.
534 (tsubst_expr): Likewise.
535 (do_decl_instantiation): Likewise.
536 (do_type_instantiation): Likewise.
537 (regenerate_decl_from_template): Likewise.
538 (always_instantiate_p): Likewise.
539 (instantiate_decl): Likewise.
540 (type_dependent_expression_p): Likewise.
541 (build_non_dependent_expr): Likewise.
542 * repo.c (repo_emit_p): Likewise.
543 * rtti.c (build_dynamic_cast_1): Likewise.
544 * search.c (shared_member_p): Likewise.
545 * semantics.c (outer_var_p): Likewise.
546 (finish_id_expression): Likewise.
547 (finish_omp_clauses): Likewise.
548 (finish_decltype_type): Likewise.
549 (ensure_literal_type_for_constexpr_object): Likewise.
550 * tree.c (lvalue_kind): Likewise.
551 (bot_replace): Likewise.
552 (cp_tree_equal): Likewise.
553 (handle_init_priority_attribute): Likewise.
554 (decl_storage_duration): Likewise.
555 * typeck.c (cxx_sizeof_expr): Likewise.
556 (cxx_alignof_expr): Likewise.
557 (decay_conversion): Likewise.
558 (build_class_member_access_expr): Likewise.
559 (cp_build_array_ref): Likewise.
560 (cxx_mark_addressable): Likewise.
561 (maybe_warn_about_returning_address_of_local): Likewise.
562 (check_return_expr): Likewise.
563 * typeck2.c (cxx_readonly_error): Likewise.
564 (abstract_virtuals_error_sfinae): Likewise.
565 (cxx_incomplete_type_diagnostic): Likewise.
567 2013-03-28 Lawrence Crowl <crowl@google.com>
570 (CXX_PARSER_H): Add header dependence.
572 (extern debug (cp_binding_level &)): New.
573 (extern debug (cp_binding_level *)): New.
575 (debug (cp_binding_level &)): New.
576 (debug (cp_binding_level *)): New.
578 (debug (cp_parser &)): New.
579 (debug (cp_parser *)): New.
580 (debug (cp_token &)): New.
581 (debug (cp_token *)): New.
582 (debug (vec<cp_token, va_gc> &)): New.
583 (debug (vec<cp_token, va_gc> *)): New.
584 * parser.c: Add header dependence.
585 (extern debug (cp_parser &)): New.
586 (extern debug (cp_parser *)): New.
587 (extern debug (cp_token &)): New.
588 (extern debug (cp_token *)): New.
589 (extern debug (vec<cp_token, va_gc> &)): New.
590 (extern debug (vec<cp_token, va_gc> *)): New.
592 2013-03-28 Jason Merrill <jason@redhat.com>
596 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
597 the type if tf_decltype is set.
598 * pt.c (fn_type_unification): Add decltype_p parm.
599 (get_bindings): Adjust.
601 * class.c (resolve_address_of_overloaded_function): Adjust.
602 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
605 * parser.c (cp_parser_sizeof_pack): Split out from...
606 (cp_parser_sizeof_operand): ...here. Require (id).
609 * semantics.c (finish_this_expr): 'this' is an rvalue.
610 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
613 * semantics.c (finish_member_declaration): Don't push closure
616 * name-lookup.c (pushdecl_maybe_friend_1): Use
617 nonlambda_method_basetype and current_nonlambda_class_type.
620 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
621 conversion from integer to pointer.
622 (cxx_eval_constant_expression): Likewise.
623 (cxx_eval_indirect_ref): Use the folded operand if we still think
624 this might be constant.
626 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
627 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
630 * call.c (convert_like_real): Change series of two permerrors
631 to permerror + inform (and likewise for two errors).
632 (build_new_method_call_1): Likewise.
633 * typeck.c (convert_for_initialization): Change additional
634 warning or error to inform.
636 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
638 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
639 (first_aggr_init_expr): Likewise.
640 (more_aggr_init_expr_args_p): Likewise.
641 (type_of_this_parm): Likewise.
642 (class_of_this_parm): Likewise.
643 * name-lookup.h (get_global_value_if_present): Likewise.
644 (is_typename_at_global_scope): Likewise.
646 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
648 * call.c (joust): Don't call inform for a permerror returning false.
649 * parser.c (cp_parser_check_class_key): Likewise.
650 * pt.c (tsubst_copy_and_build): Likewise.
652 2013-03-27 Jason Merrill <jason@redhat.com>
655 * semantics.c (finish_qualified_id_expr): Return early
658 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
660 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
661 * cvt.c (convert_to_void): Likewise.
662 * error.c (dump_expr): Likewise.
663 * mangle.c (write_expression): Likewise.
664 * parser.c (cp_parser_template_argument): Likewise.
665 * pt.c (convert_nontype_argument): Likewise.
666 (tsubst_copy_and_build): Likewise.
667 * rtti.c (build_typeid): Likewise.
668 * semantics.c (finish_call_expr): Likewise.
669 (finish_decltype_type): Likewise.
670 (build_data_member_initialization): Likewise.
671 * tree.c (is_dummy_object): Likewise.
672 * typeck.c (decay_conversion): Likewise.
673 (build_class_member_access_expr): Likewise.
674 (cp_build_addr_expr_1): Likewise.
675 (unary_complex_lvalue): Likewise.
676 (check_return_expr): Likewise.
677 * typeck2.c (cxx_readonly_error): Likewise.
679 2013-03-26 Jason Merrill <jason@redhat.com>
682 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
683 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
684 * cp-tree.h: Adjust prototype.
687 * typeck2.c (build_m_component_ref): Handle prvalue object.
689 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
691 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
692 * decl.c (duplicate_decls): Likewise.
693 (cp_finish_decl): Likewise.
694 (check_class_member_definition_namespace): Likewise.
695 * decl2.c (grokfield): Likewise.
696 (decl_needed_p): Likewise.
697 (import_export_decl): Likewise.
698 (mark_used): Likewise.
699 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
700 * pt.c (push_access_scope): Likewise.
701 (instantiate_decl): Likewise.
702 * ptree.c (cxx_print_decl): Likewise.
703 * repo.c (repo_emit_p): Likewise.
704 * semantics.c (note_decl_for_pch): Likewise.
705 * tree.c (decl_linkage): Likewise.
707 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
710 * decl.c (check_array_designated_initializer): Handle CONST_DECL
713 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
715 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
718 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
720 2013-03-25 Jason Merrill <jason@redhat.com>
723 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
724 class is derived from the type of the object.
727 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
730 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
733 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
734 DECL_TEMPLATE_INSTANTIATION.
736 2013-03-22 Jason Merrill <jason@redhat.com>
739 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
742 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
744 * cp-tree.h (identifier_p): New.
745 * call.c: Throughout, call identifier_p insstead of direct
746 comparaison of TREE_CODE against IDENTIFIER_NODE.
750 * mangle.c: Likewise.
751 * name-lookup.c: Likewise.
752 * parser.c: Likewise.
754 * search.c: Likewise.
755 * semantics.c: Likewise.
757 * typeck.c: Likewise.
758 * typeck2.c: Likewise.
760 2013-03-21 Jakub Jelinek <jakub@redhat.com>
763 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
764 * call.c (build_temp): Likewise.
765 * method.c (synthesize_method): Likewise.
766 * typeck.c (convert_for_initialization): Likewise.
768 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
770 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
772 2013-03-21 Richard Biener <rguenther@suse.de>
774 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
775 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
777 2013-03-20 Jason Merrill <jason@redhat.com>
780 * parser.c (cp_parser_late_return_type_opt): Save and restore
781 current_class_ptr/ref.
784 * expr.c (cplus_expand_constant): Do nothing if the class is
786 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
787 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
788 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
789 (complete_vars): Likewise.
791 * name-lookup.c (get_anonymous_namespace_name): Never use
792 get_file_function_name.
794 * pt.c (retrieve_specialization): Handle null tmpl argument.
798 * pt.c (tsubst_decl): Check return value of register_specialization.
799 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
802 2013-03-17 Jason Merrill <jason@redhat.com>
806 * parser.c (cp_parser_direct_declarator): Bail if we see a
807 qualified-id not at namespace scope.
811 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
814 2013-03-16 Jason Merrill <jason@redhat.com>
816 * decl.c (grokdeclarator): Assert that we won't see a pointer to
820 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
821 (MAYBE_CLASS_TYPE_P): ...here.
822 * semantics.c (lambda_capture_field_type): Only build a
823 magic decltype for wildcard types.
824 (lambda_proxy_type): Likewise.
825 (finish_non_static_data_member): Get the quals from
829 * parser.c (cp_parser_template_argument): Don't
830 fold_non_dependent_expr.
832 * parser.c (cp_parser_lambda_declarator_opt): Use
833 cp_parser_trailing_type_id.
836 * parser.c (cp_parser_template_id): Don't forget access checks.
839 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
843 * name-lookup.h (tag_scope): Add ts_lambda.
844 * semantics.c (begin_lambda_type): Use it.
845 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
846 * pt.c (check_default_tmpl_args): Ignore lambdas.
847 (push_template_decl_real): Handle lambdas.
848 * tree.c (no_linkage_check): Adjust lambda check.
851 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
854 * parser.c (cp_parser_direct_declarator): Fix late return
855 for out-of-class defn of member function.
858 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
859 parms to avoid duplicate -Wshadow warnings.
861 * search.c (lookup_base): Handle NULL_TREE.
864 * semantics.c (potential_constant_expression_1): Use of 'this' in
865 a non-constexpr function makes the expression not potentially
870 * cp-tree.h (tsubst_flags): Add tf_decltype.
871 * call.c (build_cxx_call): Don't build a temporary if it's set.
872 (build_over_call): Make sure it's only passed to build_cxx_call.
873 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
874 (cp_parser_unary_expression): Likewise.
875 (cp_parser_cast_expression): Likewise.
876 (cp_parser_binary_expression): Likewise.
877 (cp_parser_assignment_expression): Likewise.
878 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
879 (cp_parser_expression): Add decltype_p. Force a
880 temporary for a call on the LHS of a comma.
881 (cp_parser_decltype): Pass true to decltype_p parms.
882 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
883 (tsubst_copy_and_build): Pass tf_decltype down only for
884 CALL_EXPR and the RHS of COMPOUND_EXPR.
885 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
887 * cp-tree.h (abstract_class_use): New enum.
888 * typeck2.c (pending_abstract_type): Add use field.
889 (abstract_virtuals_error_sfinae): Add overloads taking
890 abstract_class_use instead of tree.
891 * typeck.c (build_static_cast_1): Call it.
892 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
893 * pt.c: Adjust calls.
894 * decl.c (cp_finish_decl): Don't handle functions specially.
895 (grokdeclarator): Always check return type.
896 * init.c (build_new_1): Adjust call.
900 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
901 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
904 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
905 (tsubst_arg_types): Likewise.
909 * call.c (convert_like_real): Check for explicit constructors
910 even for value-initialization.
913 * pt.c (convert_nontype_argument): Handle invalid pointer.
915 * parser.c (cp_parser_lambda_expression): Use nreverse.
919 * pt.c (instantiate_class_template_1): Instantiate lambda capture
921 (tsubst_copy_and_build): Not here.
924 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
927 * parser.c (parsing_nsdmi): New.
928 * semantics.c (outer_automatic_var_p): Check it.
929 (finish_id_expression): Likewise.
930 * cp-tree.h: Declare it.
933 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
935 * parser.c (lookup_literal_operator): Correct parm/arg naming
939 * pt.c (fold_non_dependent_expr_sfinae): Check
940 instantiation_dependent_expression_p.
943 * class.c (resolve_address_of_overloaded_function): Accept a
944 reference to function for target_type.
945 (instantiate_type): Likewise.
946 * pt.c (convert_nontype_argument): Pass it to
947 convert_nontype_argument_function.
949 2013-03-16 Jakub Jelinek <jakub@redhat.com>
951 * tree.c (cp_tree_equal): Fix a pasto.
954 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
955 pass op1 through maybe_constant_value first.
957 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
960 * semantics.c (cxx_eval_array_reference): Check for negative index.
962 2013-03-14 Jason Merrill <jason@redhat.com>
965 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
968 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
969 dso_handle parm on targets without __cxa_atexit.
971 2013-03-11 Jason Merrill <jason@redhat.com>
974 * typeck.c (check_return_expr): Disallow returning init list here.
975 * semantics.c (apply_deduced_return_type): Not here.
977 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
980 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
981 * error.c (dump_expr): Likewise.
983 2013-03-08 Jason Merrill <jason@redhat.com>
986 * class.c (modify_all_vtables): Mangle the vtable name before
989 * semantics.c (lambda_expr_this_capture): In unevaluated context,
990 just return the nearest 'this'.
995 * tree.c (maybe_dummy_object): Don't capture 'this'.
996 * semantics.c (maybe_resolve_dummy): New.
997 (finish_non_static_data_member): Use it.
998 (finish_qualified_id_expr): Don't test is_dummy_object.
999 * cp-tree.h: Declare maybe_resolve_dummy.
1000 * call.c (build_new_method_call_1): Use it.
1003 * semantics.c (apply_deduced_return_type): Don't allow returning
1004 std::initializer_list.
1006 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1009 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1010 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1011 * decl.c (check_elaborated_type_specifier): Tidy.
1013 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1016 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1018 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1020 * parser.c (cp_parser_braced_list): For {} initialize
1021 *non_constant_p to false.
1023 2013-03-04 Jason Merrill <jason@redhat.com>
1027 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1028 and non-class scopes.
1030 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1032 * decl.c (grokdeclarator): Remove dead code.
1034 2013-02-28 Jason Merrill <jason@redhat.com>
1037 * semantics.c (potential_constant_expression_1): Use
1038 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1041 * call.c (build_over_call): Avoid virtual lookup in a template.
1043 2013-02-27 Jason Merrill <jason@redhat.com>
1047 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1048 of the base name for inheriting ctors.
1049 (push_class_level_binding_1): Remove inheriting ctor handling.
1050 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1051 * class.c (add_implicitly_declared_members): Adjust.
1053 2013-02-26 David Binderman <dcb314@hotmail.com>
1056 * decl.c (grokdeclarator): Tidy publicp assignment.
1058 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1061 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1062 (build_transaction_expr): Same.
1064 2013-02-25 Jason Merrill <jason@redhat.com>
1067 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1068 we know what args we're looking at.
1071 * semantics.c (potential_constant_expression_1): In C++98, a cast
1072 to non-integral type can't be a constant expression.
1074 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1077 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1080 2013-02-22 Jason Merrill <jason@redhat.com>
1083 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1084 if we got the wrong number of template parms.
1087 * pt.c (fn_type_unification): Use explicit args in template
1088 instantiation context.
1091 * call.c (can_convert_arg): Discard access checks.
1094 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1097 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1100 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1101 * cvt.c (ocp_convert): Use the latter.
1102 (cp_convert_to_pointer): Likewise.
1103 * decl.c (check_default_argument): Likewise.
1104 * typeck.c (cp_build_binary_op): Likewise.
1105 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1107 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1108 Paolo Carlini <paolo.carlini@oracle.com>
1111 * decl2.c (grokbitfield): Allow scoped enumeration types.
1113 2013-02-15 Jason Merrill <jason@redhat.com>
1116 * semantics.c (finish_id_expression): Also return the identifier
1117 for an outer local static.
1120 * class.c (check_bases_and_members): Deduce noexcept after
1124 * semantics.c (finish_id_expression): In a template, return
1125 the identifier for a constant variable.
1127 2013-02-14 Jason Merrill <jason@redhat.com>
1130 * semantics.c (build_anon_member_initialization): New.
1131 (build_data_member_initialization): Use it.
1134 * decl.c (cp_finish_decl): Force instantiation of an
1135 auto static data member.
1138 * pt.c (unify): A pack expansion that is not the last template
1139 argument makes the entire template argument list non-deduced.
1142 * name-lookup.c (do_class_using_decl): Handle typedefs with
1143 inheriting constructors.
1144 (push_class_level_binding_1): Allow inheriting from template
1145 template parameter, too.
1146 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1149 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1150 default argument scope.
1151 * mangle.c (write_name): Likewise.
1154 * error.c (find_typenames_r): Don't walk into a pack expansion.
1156 2013-02-13 Jason Merrill <jason@redhat.com>
1159 * parser.c (cp_parser_member_declaration): Check the declarator
1160 form when detecting a function declaration via typedef.
1163 * pt.c (maybe_process_partial_specialization): A lambda
1164 isn't what's being specialized.
1167 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1171 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1174 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1175 non-zero offsets, too.
1178 * decl.c (build_enumerator): Always convert the value to a
1179 fixed underlying type.
1182 * pt.c (tsubst_copy_and_build): Don't forget any new
1183 captures that arose from use of dependent names.
1185 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1188 * semantics.c (finish_asm_stmt): If input constraints allow
1189 neither register nor memory, try maybe_constant_value to get
1190 a constant if possible.
1192 2013-02-12 Jason Merrill <jason@redhat.com>
1195 * method.c (add_one_base_init): Handle base constructor
1196 taking rvalue reference parm.
1199 * semantics.c (sort_constexpr_mem_initializers): Handle
1202 2013-02-09 Jason Merrill <jason@redhat.com>
1205 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1206 maybe_instantiate_noexcept.
1209 * pt.c (eq_specializations): Set comparing_specializations.
1210 * tree.c (cp_tree_equal): Check it.
1211 * cp-tree.h: Declare it.
1213 * decl.c (decls_match): Check versions later.
1216 * pt.c (build_non_dependent_expr): Don't try to fold
1217 instantiation-dependent expressions.
1218 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1219 [BIND_EXPR]: Treat as dependent.
1221 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1224 * init.c (build_vec_init): Don't append NULL values into new_vec.
1225 (build_zero_init_1): Don't push anything into v if recursive call
1227 (build_value_init_noctor): Don't push anything into v if
1228 build_value_init call returned NULL_TREE.
1231 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1232 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1233 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1234 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1235 (cp_parser_cast_expression): Adjust caller.
1238 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1239 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1240 DECL_LANG_SPECIFIC (t).
1242 2013-02-07 Jason Merrill <jason@redhat.com>
1245 * method.c (do_build_copy_constructor): Don't bother turning
1246 scalars from lvalues to xvalues.
1247 (do_build_copy_assign): Likewise.
1249 2013-02-06 Jason Merrill <jason@redhat.com>
1251 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1253 2013-02-05 Jason Merrill <jason@redhat.com>
1256 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1260 * decl.c (start_preparsed_function): Update restype if we change
1264 * pt.c (fn_type_unification): Discard any access checks from
1265 substituting explicit args.
1267 2013-01-31 Jason Merrill <jason@redhat.com>
1271 * typeck.c (get_member_function_from_ptrfunc): Fix
1272 ptrmemfunc_vbit_in_delta case.
1274 2013-01-29 Jason Merrill <jason@redhat.com>
1277 * class.c (build_ctor_vtbl_group): Give construction vtables
1280 2013-01-25 Jason Merrill <jason@redhat.com>
1283 * pt.c (convert_nontype_argument_function): Handle invalid input.
1284 (convert_nontype_argument): Likewise.
1287 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1288 dynamic type has no virtual functions.
1290 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1293 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1294 on TARGET_EXPR nodes.
1296 2013-01-22 Jason Merrill <jason@redhat.com>
1299 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1301 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1304 * pt.c (argument_pack_element_is_expansion_p)
1305 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1306 (gen_elem_of_pack_expansion_instantiation): New static functions.
1307 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1308 look through the possibly resulting pack expansion as well.
1309 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1310 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1311 Use gen_elem_of_pack_expansion_instantiation to build the
1312 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1313 as gen_elem_of_pack_expansion_instantiation and the change in
1314 tsubst above generalize this particular case.
1315 (arg_from_parm_pack_p): Remove this for it's not used by
1316 tsubst_pack_expansion anymore.
1318 2013-01-21 Jason Merrill <jason@redhat.com>
1321 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1322 template args count.
1324 2013-01-18 Jason Merrill <jason@redhat.com>
1327 * decl2.c (get_local_tls_init_fn): New.
1328 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1329 with aliases for internal variables. Don't use weakrefs if
1330 the variable needs destruction.
1331 (generate_tls_wrapper): Mark the wrapper as const if no
1332 initialization is needed.
1333 (handle_tls_init): Don't require aliases.
1335 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1338 * pt.c (coerce_innermost_template_parms): New static function.
1339 (instantiate_alias_template): Use it here.
1341 2013-01-09 Jason Merrill <jason@redhat.com>
1344 * rtti.c (build_typeid, get_typeid): Add complain parm.
1345 (get_tinfo_decl_dynamic): Likewise.
1346 * cp-tree.h, parser.c, pt.c: Adjust.
1349 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1352 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1355 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1356 call maybe_constant_value for the negative or too big shift
1359 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1362 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1363 of the argument is true.
1365 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1367 * parser.c (cp_parser_initializer_list): Move declaration
1368 of variable non_const to start of lexical block.
1370 2013-01-07 Jason Merrill <jason@redhat.com>
1373 * tree.c (build_aggr_init_expr): Do nothing in a template.
1374 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1375 a FUNCTION_DECL before tsubsting.
1377 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1380 * pt.c (check_instantiated_arg): Allow type template arguments.
1382 2013-01-04 Jason Merrill <jason@redhat.com>
1385 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1386 (grokdeclarator): Use reset_type_linkage.
1387 * name-lookup.c (binding_table_foreach): Handle null table.
1388 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1390 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1392 PR c++/54526 (again)
1393 * parser.c (cp_parser_template_id): Revert core of previous change
1394 (keep adjusted inform message).
1396 2013-01-03 Jason Merrill <jason@redhat.com>
1400 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1404 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1407 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1410 * call.c (type_has_extended_temps): New.
1411 * cp-tree.h: Declare it.
1412 * decl.c (check_initializer): Use build_aggr_init for arrays
1414 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1416 2013-01-02 Jason Merrill <jason@redhat.com>
1419 * call.c (build_new_method_call_1): Don't use build_value_init for
1420 user-provided default constructors.
1422 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1426 * tree.c (build_cplus_array_type): Copy layout information
1427 to main variant if necessary.
1429 Copyright (C) 2013 Free Software Foundation, Inc.
1431 Copying and distribution of this file, with or without modification,
1432 are permitted in any medium without royalty provided the copyright
1433 notice and this notice are preserved.