1 2014-11-26 Jason Merrill <jason@redhat.com>
3 Allow partial specialization of variable templates.
4 * cp-tree.h (TINFO_USED_TEMPLATE_ID): New.
5 * decl.c (duplicate_decls): Copy it.
6 * error.c (dump_decl) [TEMPLATE_ID_EXPR]: Handle variables.
7 * parser.c (cp_parser_decltype_expr): Do call finish_id_expression
9 * pt.c (register_specialization): Remember variable template insts.
10 (instantiate_template_1): Find the matching partial specialization.
11 (check_explicit_specialization): Allow variable partial specialization.
12 (process_partial_specialization): Likewise.
13 (push_template_decl_real): Likewise.
14 (more_specialized_partial_spec): Rename from more_specialized_class.
15 (most_specialized_partial_spec): Rename from most_specialized_class.
16 (get_partial_spec_bindings): Rename from get_class_bindings.
18 2014-11-26 Paolo Carlini <paolo.carlini@oracle.com>
21 * call.c (standard_conversion): Do not require expr to be non-null
22 when NULLPTR_TYPE_P (from) is true.
24 2014-11-26 Jason Merrill <jason@redhat.com>
26 * constexpr.c (cxx_eval_constant_expression) [SAVE_EXPR]: Avoid
29 * constexpr.c (cxx_eval_call_expression): Don't talk about
30 flowing off the end if we're already non-constant.
32 2014-11-26 Ville Voutilainen <ville.voutilainen@gmail.com>
34 Diagnose string constant conversion to char* in c++11 and above
35 as forbidden, not deprecated.
36 * typeck.c (string_conv_p): Do a pedwarn in c++11 and above,
37 change the diagnostic for the Wwrite-strings case for c++11 and above.
39 2014-11-24 Jason Merrill <jason@redhat.com>
41 * pt.c (lookup_template_variable): Always unknown_type_node.
43 2014-11-25 Paolo Carlini <paolo.carlini@oracle.com>
46 * parser.c (cp_parser_label_for_labeled_statement): Check the case
47 with check_for_bare_parameter_packs.
49 2014-11-24 Jonathan Wakely <jwakely@redhat.com>
50 Paolo Carlini <paolo.carlini@oracle.com>
53 * decl.c (initialize_local_var): Add -Winit-self warning for
54 references initialized with themselves.
56 2014-11-24 Jason Merrill <jason@redhat.com>
59 * mangle.c (mangle_decl): If we aren't going to create a symbol
60 alias, don't build the alias DECL either.
62 2014-11-24 Paolo Carlini <paolo.carlini@oracle.com>
65 * cp-tree.h (lang_decl_fn): Remove constructor_attr, destructor_attr.
67 2014-11-21 Jason Merrill <jason@redhat.com>
71 * call.c (set_up_extended_ref_temp): Set TREE_USED on the reference
72 if the temporary has a non-trivial destructor.
73 * decl.c (poplevel): Don't look through references.
76 * name-lookup.c (supplement_binding_1): Override a mangling alias.
77 * mangle.c (maybe_remove_implicit_alias): New.
78 (mangle_decl): Always avoid creating conflicting alias.
82 * mangle.c (decl_mangling_context): Use template_type_parameter_p.
85 * pt.c (uses_template_parms): Handle null argument.
87 2014-11-21 Jakub Jelinek <jakub@redhat.com>
90 * typeck.c (cp_build_array_ref): Adjust
91 convert_vector_to_pointer_for_subscript caller. If it returns true,
92 call non_lvalue_loc on the result.
94 2014-11-20 Jason Merrill <jason@redhat.com>
97 * pt.c (convert_nontype_argument): Call convert_from_reference.
98 (check_instantiated_arg): Don't be confused by reference refs.
99 (unify): Look through reference refs on the arg, too.
100 * mangle.c (write_template_arg): Look through reference refs.
102 * error.c (dump_expr): Avoid printing (*&i) for references.
104 2014-11-20 Ville Voutilainen <ville.voutilainen@gmail.com>
107 * tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.
109 2014-11-20 Trevor Saunders <tsaunders@mozilla.com>
111 * cp-objcp-common.c: Use hash_table instead of htab.
113 2014-11-19 Jason Merrill <jason@redhat.com>
116 * cp-tree.h (struct processing_template_decl_sentinel): New.
117 * pt.c (instantiate_non_dependent_expr_internal): Split out from...
118 (instantiate_non_dependent_expr_sfinae): Here.
119 (convert_nontype_argument): Use them.
120 * constexpr.c (fold_non_dependent_expr): Use them.
123 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
124 complain yet about a reference.
125 [TARGET_EXPR]: Handle TARGET_EXPR with addr == true.
126 [ADDR_EXPR]: Make sure we don't take the address of a CONSTRUCTOR.
127 (cxx_bind_parameters_in_call): In the new scheme addr is always false.
128 * typeck.c (build_address): Don't take the address of a CONSTRUCTOR.
131 * init.c (decl_really_constant_value): Rename from
132 integral_constant_value.
133 (scalar_constant_value): Similar but limited to scalar results.
134 (decl_constant_value_safe): Remove.
135 (constant_value_1): Respect return_aggregate_cst_ok_p.
136 * typeck.c (decay_conversion): Use scalar_constant_value.
137 * call.c (convert_like_real): Likewise.
138 * cvt.c (ocp_convert): No need to check CLASS_TYPE_P.
139 * typeck.c (decay_conversion): Or ARRAY_TYPE.
140 * constexpr.c (struct constexpr_ctx): Add strict field.
141 (cxx_eval_constant_expression) [VAR_DECL]: Use it to select between
142 decl_constant_value and decl_really_constant_value.
143 (cxx_eval_outermost_constant_expr): Add strict parm.
144 (maybe_constant_init): Not strict.
145 (potential_constant_expression_1): Add strict parm.
146 Shorten most internal calls with RECUR macro.
147 * cp-tree.h, pt.c, semantics.c: Adjust.
149 2014-11-19 Jason Merrill <jason@redhat.com>
152 * constexpr.c (cxx_eval_store_expression): Return init, not *valp.
154 2014-11-19 Paolo Carlini <paolo.carlini@oracle.com>
157 * constexpr.c (constexpr_fn_retval): Accept __func__, __FUNCTION__,
158 and __PRETTY_FUNCTION__.
160 2014-11-18 Jason Merrill <jason@redhat.com>
163 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: A load
164 from a variable of empty class type is constant.
166 * constexpr.c (cxx_eval_statement_list): Handle statement-expressions.
167 (potential_constant_expression_1): Handle STMT_EXPR.
169 * constexpr.c (cxx_eval_constant_expression): Give jump_target a
171 (lots): Omit NULL jump_target arguments.
173 * constexpr.c (struct constexpr_ctx): Add quiet field.
174 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Set it.
175 (lots): Replace allow_non_constant parameter with ctx->quiet.
178 * constexpr.c (cxx_eval_binary_expression): Don't assume the
179 expression was already folded.
180 (cxx_eval_unary_expression): Likewise.
182 2014-11-18 Marc Glisse <marc.glisse@inria.fr>
185 * rtti.c (emit_support_tinfos): Handle __float128.
187 2014-11-18 Jason Merrill <jason@redhat.com>
190 * constexpr.c (cxx_eval_increment_expression): Use POINTER_PLUS_EXPR.
193 * constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
194 rather than VOID_TYPE_P.
196 * pt.c (instantiate_template_1): Use tsubst_aggr_type for context.
199 * typeck2.c (store_init_value): Set it.
200 * cp-tree.h (CONSTRUCTOR_MUTABLE_POISON): New.
201 * constexpr.c (cxx_eval_outermost_constant_expr): Check it.
203 2014-11-17 Jason Merrill <jason@redhat.com>
206 * call.c (build_call_a): Don't warn_deprecated_use here.
207 (build_over_call): Or here.
208 * decl2.c (mark_used): Do it here.
209 (is_late_template_attribute): Attribute deprecated is not deferred.
210 (cplus_decl_attributes): Propagate TREE_DEPRECATED out to the template.
211 * parser.c (cp_parser_template_name): Warn about deprecated template.
212 (cp_parser_template_argument): Likewise.
215 * decl.c (cp_finish_decl): Don't try to process a non-dependent
216 constant initializer for a reference.
217 * pt.c (value_dependent_expression_p): A reference is always
219 * call.c (extend_ref_init_temps_1): Also clear TREE_SIDE_EFFECTS
222 Handle C++14 constexpr flow control.
223 * constexpr.c (cxx_eval_loop_expr, cxx_eval_switch_expr): New.
224 (cxx_eval_statement_list): New.
225 (cxx_eval_constant_expression): Handle LABEL_EXPR,
226 CASE_LABEL_EXPR, GOTO_EXPR, LOOP_EXPR, SWITCH_EXPR. Handle jump
227 semantics of RETURN_EXPR.
228 (many functions): Add jump_target parameter.
229 (returns, breaks, continues, switches, label_matches): New.
230 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): New.
231 * cp-gimplify.c (begin_bc_block): Set them.
233 * cp-gimplify.c (genericize_cp_loop): Use LOOP_EXPR.
234 (genericize_for_stmt): Handle null statement-list.
236 * constexpr.c (use_new_call): Always use new call handling.
238 C++14 constexpr support (minus loops and multiple returns)
239 * constexpr.c (use_new_call): New macro.
240 (build_data_member_initialization): Ignore non-mem-inits.
241 (check_constexpr_bind_expr_vars): Remove C++14 checks.
242 (constexpr_fn_retval): Likewise.
243 (check_constexpr_ctor_body): Do nothing in C++14.
244 (massage_constexpr_body): In C++14 only collect mem-inits.
245 (get_function_named_in_call): Handle null CALL_EXPR_FN.
246 (cxx_bind_parameters_in_call): Build bindings in same order as
247 parameters. Don't treat iniviref parms specially in new call mode.
248 (cxx_eval_call_expression): If use_new_call, do constexpr expansion
249 based on DECL_SAVED_TREE rather than the massaged constexpr body.
250 Set up ctx->object from AGGR_INIT_EXPR_SLOT if we don't have one.
251 (is_sub_constant_expr): Don't mess with ctx.ctor here.
252 (cxx_eval_component_reference): A null element means we're mid-
254 (cxx_eval_store_expression, cxx_eval_increment_expression): New.
255 (cxx_eval_constant_expression): Handle RESULT_DECL, DECL_EXPR,
256 MODIFY_EXPR, STATEMENT_LIST, BIND_EXPR, USING_STMT,
257 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
258 POSTDECREMENT_EXPR. Don't look into DECL_INITIAL of variables in
259 constexpr functions. In new-call mode find parms in the values table.
260 (potential_constant_expression_1): Handle null CALL_EXPR_FN.
261 Handle STATEMENT_LIST, MODIFY_EXPR, MODOP_EXPR, IF_STMT,
262 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
263 POSTDECREMENT_EXPR, BIND_EXPR, WITH_CLEANUP_EXPR,
264 CLEANUP_POINT_EXPR, MUST_NOT_THROW_EXPR, TRY_CATCH_EXPR,
265 EH_SPEC_BLOCK, EXPR_STMT, DECL_EXPR, CASE_LABEL_EXPR, BREAK_STMT,
266 CONTINUE_STMT, USING_STMT, IF_STMT, DO_STMT, FOR_STMT, WHILE_STMT,
267 SWITCH_STMT, ASM_EXPR.
268 (cxx_eval_vec_init_1): Call build_aggr_init_expr.
269 (cxx_eval_indirect_ref): Don't return a CONSTRUCTOR when the
270 caller wants an lvalue.
271 (cxx_eval_outermost_constant_expr): Pull object out of AGGR_INIT_EXPR.
272 (maybe_constant_init): Look through INIT_EXPR.
273 (ensure_literal_type_for_constexpr_object): Set
274 cp_function_chain->invalid_constexpr.
275 * cp-tree.h (struct language_function): Add invalid_constexpr bitfield.
276 * decl.c (start_decl): Set cp_function_chain->invalid_constexpr.
277 (check_for_uninitialized_const_var): Likewise.
278 (maybe_save_function_definition): Check it.
279 * parser.c (cp_parser_jump_statement): Set
280 cp_function_chain->invalid_constexpr.
281 (cp_parser_asm_definition): Likewise.
284 * decl.c (build_ptrmemfunc_type): Don't build a different
285 RECORD_TYPE for a qualified PMF.
286 * cp-tree.h (TYPE_PTRMEMFUNC_FN_TYPE): Merge cv-quals.
287 (TYPE_PTRMEMFUNC_FN_TYPE_RAW): New.
288 * decl2.c (cplus_decl_attributes): Use TYPE_PTRMEMFUNC_FN_TYPE_RAW.
289 * tree.c (cp_walk_subtrees): Likewise.
290 (cp_build_qualified_type_real): Remove special PMF handling.
292 2014-11-15 Jason Merrill <jason@redhat.com>
294 * parser.c (cp_parser_omp_declare_reduction_exprs): A block is not
297 * constexpr.c (cxx_eval_builtin_function_call): Use
298 fold_builtin_call_array.
300 * constexpr.c (cx_check_missing_mem_inits): Clarify error message.
302 2014-11-14 Paolo Carlini <paolo.carlini@oracle.com>
304 * semantics.c (end_maybe_infinite_loop): Use fold_non_dependent_expr.
305 * parser.c (cp_parser_omp_clause_collapse): Likewise.
306 (cp_parser_enumerator_definition): Don't call
307 instantiate_non_dependent_expr...
308 * decl.c (build_enumerator): ... call fold_non_dependent_expr here.
309 * typeck2.c (massage_init_elt): Use fold_non_dependent_expr.
310 * constexpr.c (maybe_constant_value): Allow VIEW_CONVERT_EXPR in
311 the final gcc_assert.
313 * constexpr.c (fold_non_dependent_expr): Add.
314 * cp-tree.h (fold_non_dependent_expr): Declare it.
315 * call.c (null_ptr_cst_p): Use it.
316 * pt.c (tsubst_copy_and_build, build_non_dependent_expr): Likewise.
317 * semantics.c (begin_maybe_infinite_loop): Likewise.
318 * typeck.c (cp_build_binary_op): Likewise.
319 * typeck2.c (check_narrowing): Likewise.
321 * pt.c (fold_non_dependent_expr): Rename to
322 instantiate_non_dependent_expr.
323 (fold_non_dependent_expr_sfinae): Rename to
324 instantiate_non_dependent_expr_sfinae.
325 (convert_nontype_argument, build_non_dependent_expr): Adjust.
326 * decl.c (compute_array_index_type): Likewise.
327 * parser.c (cp_parser_parenthesized_expression_list,
328 cp_parser_enumerator_definition, cp_parser_omp_clause_collapse):
330 * semantics.c (end_maybe_infinite_loop, finish_static_assert):
332 * typeck.c (cxx_alignas_expr): Likewise.
333 * typeck2.c (store_init_value, massage_init_elt): Likewise.
334 * call.c: Adjust comments.
336 * constexpr.c: Likewise.
340 2014-11-14 Jonathan Wakely <jwakely@redhat.com>
342 * mangle.c (find_substitution): Look for abi_tag on class templates.
344 2014-11-13 Bernd Schmidt <bernds@codesourcery.com>
345 Thomas Schwinge <thomas@codesourcery.com>
346 Ilya Verbin <ilya.verbin@intel.com>
347 Andrey Turetskiy <andrey.turetskiy@intel.com>
349 * Make-lang.in (c++.install-common): Do not install for the offload
352 2014-11-13 Kai Tietz <ktietz@redhat.com>
354 * cp-tree.h (cp_build_function_call): Remove prototype.
355 (cp_build_addr_expr_strict): Likewise.
356 (build_typed_address): Likewise.
357 * typeck.c (build_typed_address): Removed.
358 (cp_build_addr_expr_strict): Make static.
359 (cp_build_function_call): Likewise.
361 2014-11-12 Paolo Carlini <paolo.carlini@oracle.com>
365 * cp-tree.h (struct cp_decl_specifier_seq): Add decltype_p bool field.
366 * decl.c (grokdeclarator): Use it.
367 * parser.c (cp_parser_simple_type_specifier): Likewise.
368 * pt.c (tsubst, case DECLTYPE_TYPE): Use tf_ignore_bad_quals.
370 2014-11-11 Paolo Carlini <paolo.carlini@oracle.com>
373 * pt.c (tsubst_copy_and_build, case COND_EXPR): Maybe fold to
374 constant the condition.
376 2014-11-10 Andi Kleen <ak@linux.intel.com>
378 * semantics.c (finish_goto_stmt): Call check_no_cilk.
379 (finish_while_stmt_cond): Dito.
380 (finish_do_stmt): Dito.
381 (finish_for_cond): Dito.
382 (finish_switch_cond): Dito.
384 2014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
386 * typeck.c (cp_build_binary_op): Use OPT_Wshift_count_negative and
387 OPT_Wshift_count_overflow in the warnings.
389 2014-11-09 Jason Merrill <jason@redhat.com>
392 * typeck.c (build_reinterpret_cast_1): reinterpret_cast to the
393 same scalar type is an rvalue.
396 * call.c (build_new_op_1): Don't do non-class lookup for =, -> or [].
398 2014-11-07 Jason Merrill <jason@redhat.com>
401 * pt.c (dependent_alias_template_spec_p): New.
402 (dependent_type_p_r): Handle dependent alias template specialization.
403 (template_args_equal): A dependent alias template specializations
404 is not equal to its underlying type as a template argument.
405 * tree.c (strip_typedefs): Don't strip a dependent alias
408 * parser.c (cp_parser_unqualified_id): Handle __func__ here.
409 (cp_parser_primary_expression): Not here.
411 2014-11-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
414 * decl.c (grokdeclarator): Fix __complex meaning __complex double.
416 2014-10-29 Richard Sandiford <richard.sandiford@arm.com>
418 * constexpr.c: Remove redundant enum from machine_mode.
420 2014-10-28 Jason Merrill <jason@redhat.com>
422 * constexpr.c (cxx_eval_outermost_constant_expr): Tweak.
424 2014-10-28 Andrew MacLeod <amacleod@redhat.com>
426 * call.c: Adjust include files.
435 * semantics.c: Ditto.
437 * vtable-class-hierarchy.c: Ditto.
439 2014-10-24 Jason Merrill <jason@redhat.com>
441 Implement N3653 (Member initializers and aggregates) and fix
442 references to 'this' in constexpr constructors.
443 * class.c (check_field_decls): In C++14 an NSDMI does not make the
445 * constexpr.c (struct constexpr_ctx): New.
446 (cxx_bind_parameters_in_call): Handle 'this'.
447 (cxx_eval_call_expression): Create new constexpr_ctx.
448 (cxx_eval_component_reference): Check CONSTRUCTOR_NO_IMPLICIT_ZERO.
449 (initialized_type, init_subob_ctx, verify_ctor_sanity): New.
450 (cxx_eval_bare_aggregate): Use them. Build CONSTRUCTOR early.
451 (cxx_eval_vec_init_1): Likewise.
452 (cxx_eval_constant_expression) [PARM_DECL]: Allow 'this'.
453 [TARGET_EXPR]: Build new constexpr_ctx.
454 [PLACEHOLDER_EXPR]: New.
455 (cxx_eval_outermost_constant_expr): Build new constexpr_ctx. Add
457 (is_sub_constant_expr): Build new constexpr_ctx.
458 (potential_constant_expression_1): Handle PLACEHOLDER_EXPR.
460 * cp-gimplify.c (cp_gimplify_init_expr): Call replace_placeholders.
461 * cp-tree.h (CONSTRUCTOR_NO_IMPLICIT_ZERO): New.
462 * error.c (dump_expr): Handle PLACEHOLDER_EXPR.
463 * init.c (get_nsdmi): Generate PLACEHOLDER_EXPR.
464 * tree.c (lvalue_kind): Handle PLACEHOLDER_EXPR.
465 (build_ctor_subob_ref, replace_placeholders): New.
466 * typeck2.c (store_init_value): Use replace_placeholders.
467 (process_init_constructor_record): Make zero-init before NSDMI
470 2014-10-27 Andrew MacLeod <amacleod@redhat.com>
472 * cp-gimplify.c: Adjust include files.
474 2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
477 * cp-objcp-common.c: Do not include new.
478 (cxx_initialize_diagnostics): Move from here to ...
479 * error.c (cxx_initialize_diagnostics): : ... here. Move
480 diagnostics initialization here from init_error.
481 (cxx_pp): Use a real pointer not a macro.
482 (init_error): Just initialize cxx_pp.
483 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer): Do
484 not set maximum line length.
486 2014-10-23 Jonathan Wakely <jwakely@redhat.com>
489 * decl2.c (delete_sanity): Use OPT_Wdelete_incomplete in warning.
491 2014-10-21 Paolo Carlini <paolo.carlini@oracle.com>
493 * parser.c (cp_parser_unary_expression): Add default arguments.
494 (cp_parser_cast_expression, cp_parser_sizeof_operand,
495 cp_parser_omp_atomic): Adjust.
497 2014-10-20 Jason Merrill <jason@redhat.com>
500 * lambda.c (current_nonlambda_function): New.
501 * semantics.c (finish_this_expr): Use it.
502 * cp-tree.h: Declare it.
504 2014-10-17 Alan Modra <amodra@gmail.com>
507 * decl.c (merge_decls): Don't merge section name, comdat group or
508 tls model to newdecl symtab node, instead merge to olddecl.
509 Override existing olddecl section name. Set tls_model for all
510 thread-local vars, not just OMP thread-private ones. Remove
513 2014-10-16 Andrew MacLeod <amacleod@redhat.com>
515 * cp-tree.h: Adjust include files.
517 2014-10-15 Jason Merrill <jason@redhat.com>
520 * pt.c (lookup_template_variable): Call coerce_template_parms.
522 2014-10-15 Paolo Carlini <paolo.carlini@oracle.com>
524 * semantics.c (is_instantiation_of_constexpr, literal_type_p,
525 ensure_literal_type_for_constexpr_object,
526 constexpr_fundef_hasher::equal, constexpr_fundef_hasher::hash,
527 retrieve_constexpr_fundef, is_valid_constexpr_fn,
528 build_anon_member_initialization, build_data_member_initialization,
529 check_constexpr_bind_expr_vars, check_constexpr_ctor_body_1,
530 check_constexpr_ctor_body, sort_constexpr_mem_initializers,
531 build_constexpr_constructor_member_initializers, constexpr_fn_retval,
532 massage_constexpr_body, cx_check_missing_mem_inits,
533 register_constexpr_fundef, explain_invalid_constexpr_fn,
534 constexpr_call_hasher::hash, constexpr_call_hasher::equal,
535 maybe_initialize_constexpr_call_table, get_function_named_in_call,
536 get_nth_callarg, lookup_parameter_binding,
537 cxx_eval_builtin_function_call, adjust_temp_type,
538 cxx_bind_parameters_in_call, push_cx_call_context,
539 pop_cx_call_context, cx_error_context, cxx_eval_call_expression,
540 reduced_constant_expression_p, verify_constant,
541 cxx_eval_unary_expression, cxx_eval_binary_expression,
542 cxx_eval_conditional_expression, cxx_eval_array_reference,
543 cxx_eval_component_reference, cxx_eval_bit_field_ref,
544 cxx_eval_logical_expression, base_field_constructor_elt,
545 cxx_eval_bare_aggregate, cxx_eval_vec_init_1, cxx_eval_vec_init,
546 cxx_fold_indirect_ref, cxx_eval_indirect_ref, non_const_var_error,
547 cxx_eval_trinary_expression, var_in_constexpr_fn,
548 cxx_eval_constant_expression, cxx_eval_outermost_constant_expr,
549 is_sub_constant_expr, cxx_constant_value, maybe_constant_value,
550 maybe_constant_init, potential_constant_expression_1,
551 potential_constant_expression, potential_rvalue_constant_expression,
552 require_potential_constant_expression,
553 require_potential_rvalue_constant_expression): Moved definitions...
554 * constexpr.c: ... here, new file.
555 * Make-lang.in: Update.
556 * config-lang.in: Likewise.
558 2014-10-14 Jason Merrill <jason@redhat.com>
561 * parser.c (struct saved_token_sentinel): New.
562 (cp_parser_statement): Use it.
563 (cp_parser_start_tentative_firewall): New.
564 (cp_parser_end_tentative_firewall): New.
565 (cp_parser_lambda_expression): Use them.
566 (cp_parser_statement_expr): New.
567 (cp_parser_primary_expression): Use it.
569 2014-10-14 DJ Delorie <dj@redhat.com>
571 * typeck.c (cp_common_type): Check for all __intN types, not just
573 * decl.c (grokdeclarator): Likewise.
574 * rtti.c (emit_support_tinfos): Check for all __intN types, not just
576 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
577 for all __intN types, not just __int128.
578 (cp_parser_simple_type_specifier): Likewise.
579 * mangle.c (integer_type_codes): Remove int128-specific codes.
580 * cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
581 __intN was specified.
582 * lex.c (init_reswords): Reserve all __intN keywords.
584 2014-10-14 Marc Glisse <marc.glisse@inria.fr>
586 * typeck.c (cp_build_unary_op) [TRUTH_NOT_EXPR]: Accept float vectors.
588 2014-10-13 H.J. Lu <hongjiu.lu@intel.com>
590 * mangle.c (mangle_conv_op_name_for_type): Cast elements to
592 (print_template_statistics): Cast size and elements to long.
594 2014-10-12 Trevor Saunders <tsaunders@mozilla.com>
596 * cp-gimplify.c, cp-tree.h, decl.c, mangle.c, name-lookup.c,
597 pt.c, semantics.c, tree.c, typeck2.c: Use hash_table instead of
600 2014-10-10 Jason Merrill <jason@redhat.com>
603 * class.c (build_base_path): Preserve rvalueness.
604 * call.c (convert_like_real) [ck_base]: Let convert_to_base handle &/*.
605 * rtti.c (build_dynamic_cast_1): Call convert_to_reference later.
608 * method.c (defaulted_late_check): Call maybe_instantiate_noexcept.
610 * method.c (implicitly_declare_fn): Handle deleted lambda default
611 ctor and copy assop here.
612 * class.c (check_bases_and_members): Not here.
613 (add_implicitly_declared_members): And don't set
614 CLASSTYPE_LAZY_MOVE_ASSIGN.
616 * semantics.c (finish_id_expression): Check for error_mark_node.
618 2014-10-09 Jason Merrill <jason@redhat.com>
621 * semantics.c (outer_var_p): Non-static.
622 (process_outer_var_ref): Split out from finish_id_expression.
623 * pt.c (tsubst_copy_and_build): Call them.
624 * cp-tree.h: Declare them.
626 2014-10-09 Paolo Carlini <paolo.carlini@oracle.com>
628 * semantics.c (check_constexpr_ctor_body_1): New.
629 (check_constexpr_ctor_body): Use it; add bool parameter.
630 (build_data_member_initialization): Handle BIND_EXPR and
631 USING_STMT in the main conditional.
632 (build_constexpr_constructor_member_initializers): Do not
633 handle BIND_EXPR here.
634 (constexpr_fn_retval): Handle BIND_EXPR in the switch.
635 (massage_constexpr_body): Don't do it here.
636 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
637 Adjust check_constexpr_ctor_body call.
638 (cp_parser_compound_statement): Do not pedwarn for compound-statement
639 in constexpr function in C++14 mode.
640 * cp-tree.h (check_constexpr_ctor_body): Update declaration.
642 2014-10-09 Jason Merrill <jason@redhat.com>
645 * parser.c (cp_parser_class_head): push_template_decl for members
649 * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
650 (iterative_hash_template_arg): Likewise.
653 * cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF.
654 * semantics.c (force_paren_expr): And set it.
655 * typeck.c (check_return_expr): And handle it.
657 2014-10-09 Marc Glisse <marc.glisse@inria.fr>
659 * decl.c (grokdeclarator): constexpr only implies const in C++11.
661 2014-10-08 Jason Merrill <jason@redhat.com>
664 * pt.c (tsubst_pack_expansion): Limit simple expansion to type packs.
667 * tree.c (build_cplus_array_type): Look for a type with no
668 typedef-name or attributes.
670 * call.c (call_copy_ctor): New.
671 (build_over_call): Use it to avoid infinite recursion on invalid code.
673 2014-10-07 Jason Merrill <jason@redhat.com>
675 * tree.c (cp_tree_equal) [TRAIT_EXPR]: Use cp_tree_equal for type2.
677 2014-10-06 Edward Smith-Rowland <3dw4rd@verizon.net>
679 * cp/parser.c: Allow [[deprecated]] for C++11. Issue a pedwarn.
681 2014-10-06 Paolo Carlini <paolo.carlini@oracle.com>
684 * semantics.c (check_constexpr_bind_expr_vars): New.
685 (check_constexpr_ctor_body, massage_constexpr_body): Use it.
686 (build_constexpr_constructor_member_initializers): Handle
687 BIND_EXPR in the main conditional.
689 2014-10-02 Mark Wielaard <mjw@redhat.com>
692 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
693 (cp_function_decl_deleted_p): New prototype.
694 * cp-objcp-common.c (cp_function_deleted_p): New function.
696 2014-10-03 Marc Glisse <marc.glisse@inria.fr>
701 * typeck.c (cp_build_binary_op): save_expr after convert to save
702 redundant operations.
703 [TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR]: Handle vectors.
704 (cp_build_unary_op) [TRUTH_NOT_EXPR]: Likewise.
706 2014-10-03 Jason Merrill <jason@redhat.com>
708 * decl.c (start_decl): Complain about static/thread_local vars
709 in constexpr function.
710 (check_for_uninitialized_const_var): Also uninitialized vars.
711 * parser.c (cp_parser_jump_statement): And gotos.
712 (cp_parser_asm_operand_list): And asm.
713 (cp_parser_try_block): And try.
714 * semantics.c (ensure_literal_type_for_constexpr_object): And
717 * semantics.c (constexpr_fn_retval): Ignore declarations in C++14.
718 (var_in_constexpr_fn): New.
719 (cxx_eval_constant_expression): Look into DECL_INITIAL.
720 (potential_constant_expression_1): Allow constexpr-local vars.
723 * tree.c (strip_typedefs): Handle TREE_LIST.
725 2014-10-03 Paolo Carlini <paolo.carlini@oracle.com>
727 * parser.c (cp_parser_assignment_expression,
728 cp_parser_constant_expression): Add default arguments.
729 (cp_parser_primary_expression,
730 cp_parser_postfix_open_square_expression,
731 cp_parser_parenthesized_expression_list,
732 cp_parser_question_colon_clause,
733 cp_parser_expression, cp_parser_constant_expression,
734 cp_parser_label_for_labeled_statement, cp_parser_static_assert,
735 cp_parser_template_argument, cp_parser_enumerator_definition,
736 cp_parser_member_declaration, cp_parser_constant_initializer,
737 cp_parser_noexcept_specification_opt, cp_parser_throw_expression,
738 cp_parser_std_attribute_spec, cp_parser_objc_message_args,
739 cp_parser_objc_class_ivars, cp_parser_omp_clause_collapse,
740 cp_parser_omp_clause_aligned, cp_parser_omp_clause_safelen,
741 cp_parser_omp_clause_simdlen, cp_parser_omp_clause_dist_schedule,
742 cp_parser_omp_for_incr, cp_parser_omp_for_loop_init,
743 cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear): Adjust.
745 2014-10-02 Paolo Carlini <paolo.carlini@oracle.com>
748 * cp-tree.h (struct saved_scope): Add noexcept_operand.
749 (cp_noexcept_operand): Define.
750 * call.c (build_over_call): Use it.
751 * parser.c (cp_parser_unary_expression, [RID_NOEXCEPT]): Likewise.
752 * pt.c (tsubst_copy_and_build, [NOEXCEPT_EXPR]): Likewise.
754 2014-10-01 Jason Merrill <jason@redhat.com>
757 * method.c (constructible_expr): Handle value-init of non-class.
758 * parser.c (cp_parser_trait_expr): Allow pack expansion.
759 * pt.c (tsubst_copy_and_build): Handle pack expansion.
762 * class.c (type_has_non_user_provided_default_constructor): Rename
763 from type_has_user_provided_default_constructor, reverse sense.
764 (default_init_uninitialized_part, explain_non_literal_class): Adjust.
765 (check_bases_and_members): Set TYPE_HAS_COMPLEX_DFLT.
766 * call.c (build_new_method_call_1): Adjust.
768 * decl.c (grok_special_member_properties): Don't set
769 TYPE_HAS_COMPLEX_DFLT.
770 * init.c (build_value_init_noctor): Don't use
771 type_has_user_provided_default_constructor.
773 2014-09-30 Jason Merrill <jason@redhat.com>
775 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_ASSIGNABLE and
776 CPTK_IS_TRIVIALLY_CONSTRUCTIBLE.
777 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
778 * parser.c (cp_parser_primary_expression): Likewise.
779 (cp_parser_trait_expr): Likewise. Handle variadic trait.
780 * semantics.c (trait_expr_value): Likewise.
781 (finish_trait_expr): Likewise.
782 (check_trait_type): Handle variadic trait. Return bool.
783 * method.c (build_stub_object): Add rvalue reference here.
784 (locate_fn_flags): Not here.
785 (check_nontriv, assignable_expr, constructible_expr): New.
786 (is_trivially_xible): New.
788 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_COPYABLE.
789 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
790 * parser.c (cp_parser_primary_expression): Likewise.
791 (cp_parser_trait_expr): Likewise.
792 * semantics.c (trait_expr_value): Likewise.
793 (finish_trait_expr): Likewise.
795 * method.c (build_stub_object): Use CONVERT_EXPR.
796 * tree.c (build_dummy_object): Likewise.
797 (is_dummy_object): Adjust.
799 * cp-tree.h (cp_trait_kind): Remove CPTK_IS_CONVERTIBLE_TO.
800 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
801 * semantics.c (trait_expr_value): Likewise.
802 (finish_trait_expr): Likewise.
803 * parser.c (cp_parser_primary_expression): Likewise.
804 (cp_parser_trait_expr): Likewise. Remove redundant grokdeclarator.
806 2014-09-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
809 * error.c (print_instantiation_context): Delete.
810 * typeck2.c (build_x_arrow): Record location when pushing
811 template instantiation.
812 * pt.c (push_tinst_level): Make it a wrapper around ...
813 (push_tinst_level_loc): ... this. New function. Make excessive
814 template instantiation depth a fatal error. Record location. Use
816 (instantiate_pending_templates): Make excessive
817 template instantiation depth a fatal error.
818 (problematic_instantiation_changed): Use bool as return type.
819 * cp-tree.h (print_instantiation_context): Delete.
820 (push_tinst_level): Update declaration.
821 (problematic_instantiation_changed): Likewise.
822 (push_tinst_level_loc): New.
824 2014-09-29 Richard Biener <rguenther@suse.de>
826 * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
829 2014-09-26 Jason Merrill <jason@redhat.com>
831 * mangle.c (find_substitution): Use write_abi_tags.
833 2014-09-25 Marek Polacek <polacek@redhat.com>
836 * class.c (warn_hidden): Check for FUNCTION_DECL.
838 2014-09-25 Jakub Jelinek <jakub@redhat.com>
841 * semantics.c (handle_omp_array_sections_1): Call mark_rvalue_use
842 on low_bound and length.
844 2014-09-24 Aldy Hernandez <aldyh@redhat.com>
846 * class.c, decl.c, optimize.c: Rename all instances of
847 DECL_ABSTRACT to DECL_ABSTRACT_P.
849 2014-09-24 Marek Polacek <polacek@redhat.com>
853 * semantics.c (finish_switch_cond): Call unlowered_expr_type.
854 * tree.c (bot_manip): Add default case.
855 * parser.c (cp_parser_primary_expression): Cast the controlling
856 expression of a switch to an int.
857 (cp_parser_unqualified_id): Likewise.
859 2014-09-23 Paolo Carlini <paolo.carlini@oracle.com>
862 * parser.c (cp_parser_skip_to_closing_square_bracket,
863 cp_parser_array_designator_p): New.
864 (cp_parser_initializer_list): Use the latter.
866 2014-09-22 Jason Merrill <jason@redhat.com>
868 * semantics.c (finish_non_static_data_member): In diagnostic, give
869 error at point of use and note at point of declaration.
874 * lambda.c (maybe_resolve_dummy, lambda_expr_this_capture): Handle
877 2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
880 * pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.
882 2014-09-22 Jason Merrill <jason@redhat.com>
884 * decl.c (poplevel): Don't warn about unused vars in template scope.
885 * error.c (dump_decl): Handle variable templates.
887 2014-09-20 Jason Merrill <jason@redhat.com>
890 * decl.c (begin_destructor_body): Only clobber the as-base part of
893 2014-09-19 Jason Merrill <jason@redhat.com>
896 * mangle.c (write_expression): Use unresolved-name mangling for
900 * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
901 after pulling out an element from a CONSTRUCTOR.
903 2014-09-18 Jakub Jelinek <jakub@redhat.com>
906 * semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
907 on type of type dependent expressions, and don't call it if
908 handle_omp_array_sections has kept TREE_LIST because something
910 * pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
911 Use keep_next_level, begin_omp_structured_block and
912 finish_omp_structured_block instead of push_stmt_list and
915 2014-09-18 Paolo Carlini <paolo.carlini@oracle.com>
918 * class.c (finish_struct_1): Do not -Wnon-virtual-dtor warn
919 for final class types.
921 2014-09-15 Jason Merrill <jason@redhat.com>
923 * pt.c (lookup_template_class_1): Splice out abi_tag attribute if
924 necessary. Call inherit_targ_abi_tags here.
925 * class.c (check_bases_and_members): Not here.
926 (inherit_targ_abi_tags): Check CLASS_TYPE_P.
927 * cp-tree.h: Declare inherit_targ_abi_tags.
929 2014-09-15 Ville Voutilainen <ville.voutilainen@gmail.com>
931 Do not diagnose lambda default arguments in c++14 modes.
932 * parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
935 2014-09-15 Jakub Jelinek <jakub@redhat.com>
937 * Make-lang.in (check_g++_parallelize): Change to just an upper bound
940 2014-09-13 Marek Polacek <polacek@redhat.com>
943 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: Set
944 location of a call expression.
946 2014-09-11 Jason Merrill <jason@redhat.com>
949 * decl.c (start_decl): Handle specialization of member variable
951 * pt.c (check_explicit_specialization): Adjust error.
953 2014-09-11 Paolo Carlini <paolo.carlini@oracle.com>
956 * typeck2.c (process_init_constructor_record): Do not warn about
957 missing field initializer if EMPTY_CONSTRUCTOR_P (init).
959 2014-09-11 Jason Merrill <jason@redhat.com>
962 * pt.c (tsubst_pack_expansion): Simplify substitution into T....
963 (tsubst): Don't throw away PACK_EXPANSION_EXTRA_ARGS.
965 2014-09-10 Jason Merrill <jason@redhat.com>
968 * decl.c (grokfndecl): Don't set DECL_COMDAT on static inlines.
969 (duplicate_decls, start_decl): Likewise.
970 * pt.c (check_explicit_specialization): Likewise.
971 (push_template_decl_real): Or static templates.
973 2014-09-08 Jason Merrill <jason@redhat.com>
975 * typeck.c (build_class_member_access_expr): Move
976 -Winvalid-offsetof code...
977 * semantics.c (finish_offsetof): ...here.
978 * parser.c (cp_parser_builtin_offsetof): Remember the location of
980 * pt.c (tsubst_copy_and_build) [OFFSETOF_EXPR]: Preserve it.
983 * pt.c (instantiate_decl): Handle recursive instantiation of
986 2014-09-05 Jason Merrill <jason@redhat.com>
989 * semantics.c (potential_constant_expression_1): Handle un-folded
990 pointer to member constants.
992 2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de>
995 * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
996 newdecl, not olddecl.
998 2014-09-02 Paolo Carlini <paolo.carlini@oracle.com>
1001 * class.c (check_field_decls): A class of literal type cannot have
1002 volatile non-static data members and base classes.
1003 (explain_non_literal_class): Update.
1005 2014-09-02 Jakub Jelinek <jakub@redhat.com>
1006 Balaji V. Iyer <balaji.v.iyer@intel.com>
1007 Igor Zamyatin <igor.zamyatin@intel.com>
1009 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
1011 * parser.c (cp_parser_cilk_for): New function.
1012 (cp_parser_cilk_grainsize): Likewise.
1013 (cp_parser_statement): Added RID_CILK_FOR case.
1014 (cp_parser_omp_for_cond): Added CILK_FOR check.
1015 (cp_parser_omp_for_loop_init): Change function argument to accept
1016 tree_code instead just a bool flag; change the check to use that
1017 tree_code; check for initialization declaration in case of Cilk_for.
1018 (cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
1019 changed call to cp_parser_omp_for_loop_init according new arguments'
1021 (cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
1022 * pt.c (tsubst_expr): Added CILK_FOR case.
1023 * semantics.c: Include convert.h.
1024 (finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
1025 case; added OMP_CLAUSE__CILK_FOR_COUNT_.
1026 (handle_omp_for_class_iterator): New argument lastp and its usage;
1028 (finish_omp_for): Changed call to handle_omp_for_class_iterator
1029 according new arguments' list; in case of Cilk_for save very first
1030 decl and create empty stmt_list block; use block to build correct
1033 2014-08-31 Jason Merrill <jason@redhat.com>
1036 * optimize.c (cdtor_comdat_group): Just look at the
1037 DECL_ASSEMBLER_NAME of the 'tors.
1039 2014-08-27 Paolo Carlini <paolo.carlini@oracle.com>
1042 * semantics.c (cxx_eval_call_expression): Use STRIP_NOPS on the
1043 result of cxx_eval_constant_expression.
1045 2014-08-26 Jason Merrill <jason@redhat.com>
1048 * pt.c (tsubst_decl) [VAR_DECL]: Copy TLS model.
1049 (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
1050 * semantics.c (finish_id_expression): Don't call TLS wrapper in a
1053 2014-08-25 Jason Merrill <jason@redhat.com>
1055 * pt.c (check_explicit_specialization): Don't complain about
1056 non-template variable.
1057 (template_for_substitution): Allow variable templates.
1058 (check_template_variable): Fix logic for member var template.
1059 * decl.c (start_decl): Don't complain about extra template header
1062 * decl.c (start_decl): Look through member variable template.
1063 * pt.c (tsubst_decl) [VAR_DECL]: Handle member variable templates.
1064 * decl2.c (grokfield): Set DECL_CONTEXT earlier on
1067 2014-08-25 Paolo Carlini <paolo.carlini@oracle.com>
1070 * cp-tree.h (TFF_POINTER): Add.
1071 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): Forward the third
1073 * error.c (dump_type_suffix): Actually print the const and noreturn
1074 attribute when appropriate.
1076 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1078 * decl.c (compute_array_index_type, grokdeclarator,
1079 undeduced_auto_decl): Change from cxx1y to cxx14.
1080 *lambda.c(add_capture()): Change error message from C++1y to C++14.
1081 * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
1082 cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
1083 cp_parser_decltype, cp_parser_conversion_type_id,
1084 cp_parser_simple_type_specifier, cp_parser_type_id_1,
1085 cp_parser_template_type_arg, cp_parser_std_attribute,
1086 cp_parser_template_declaration_after_export): Ditto.
1087 * pt.c (tsubst): Ditto.
1088 * semantics.c (force_paren_expr, finish_decltype_type): Ditto.
1089 * tree.c: Change comment.
1090 * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
1091 cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
1093 2014-08-23 Jason Merrill <jason@redhat.com>
1095 Allow non-constexpr variable templates.
1096 * decl2.c (note_variable_template_instantiation): New.
1097 * cp-tree.h: Declare it.
1098 * pt.c (instantiate_decl): Call it.
1099 (push_template_decl_real): Allow non-constexpr variable templates.
1100 * semantics.c (finish_id_expression): Mark the variable template
1101 instantiation as used.
1102 * mangle.c (write_mangled_name): Variable template instantiations
1104 * parser.c (cp_parser_init_declarator): Complain about
1105 non-function implicit templates.
1107 2014-08-22 Marek Polacek <polacek@redhat.com>
1110 * parser.c (cp_parser_binary_expression): Check each LHS if it's
1111 preceded with logical not. Adjust call to
1112 warn_logical_not_parentheses.
1114 2014-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1117 * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
1118 declaration shadows a function declaration, unless the former
1119 declares a function, pointer to function or pointer to member
1120 function, because this is a common and valid case in real-world
1122 * cp-tree.h (TYPE_PTRFN_P,TYPE_REFFN_P,TYPE_PTRMEMFUNC_P):
1123 Improve description.
1125 2014-08-22 Jason Merrill <jason@redhat.com>
1128 * class.c (outermost_open_class): Fix logic.
1129 * decl.c (complete_vars): Fix logic.
1131 2014-08-22 Jason Merrill <jason@redhat.com>
1134 * class.c (outermost_open_class): New.
1135 * cp-tree.h: Declare it.
1136 * decl.c (maybe_register_incomplete_var): Use it.
1137 (complete_vars): Handle any constant variable.
1138 * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
1140 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
1143 * cp-array-notation.c (build_array_notation_ref): Added correct
1144 handling of case with incorrect array.
1146 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1149 * error.c (cp_diagnostic_finalizer): Delete.
1150 (init_error): Do not set diagnostic_finalizer here.
1152 2014-08-19 Marek Polacek <polacek@redhat.com>
1155 * call.c (build_new_op_1): Remember the type of arguments for
1156 a comparison. If either operand of a comparison is a boolean
1157 expression, call maybe_warn_bool_compare.
1159 2014-08-19 Jason Merrill <jason@redhat.com>
1161 PR tree-optimization/62091
1162 * decl2.c (decl_needed_p): Return true for virtual functions when
1167 * decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
1170 2014-08-19 Gerald Pfeifer <gerald@pfeifer.com>
1172 * class.c (contains_empty_class_p): Remove.
1174 2014-08-18 Paolo Carlini <paolo.carlini@oracle.com>
1176 * parser.c (cp_parser_expression): Add default arguments.
1177 (cp_parser_primary_expression, cp_parser_postfix_expression,
1178 cp_parser_array_notation, cp_parser_postfix_open_square_expression,
1179 cp_parser_unary_expression, cp_parser_direct_new_declarator,
1180 cp_parser_question_colon_clause, cp_parser_assignment_operator_opt,
1181 cp_parser_lambda_body, cp_parser_expression_statement,
1182 cp_parser_condition, cp_parser_c_for, cp_parser_range_for,
1183 cp_parser_iteration_statement, cp_parser_jump_statement,
1184 cp_parser_decltype_expr, cp_parser_noexcept_specification_opt,
1185 cp_parser_asm_operand_list, cp_parser_objc_message_receiver,
1186 cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement,
1187 cp_parser_omp_var_list_no_open, cp_parser_omp_clause_num_threads,
1188 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
1189 cp_parser_omp_clause_linear, cp_parser_omp_clause_device,
1190 cp_parser_omp_atomic, cp_parser_omp_for_loop_init,
1191 cp_parser_omp_for_loop, cp_parser_omp_declare_reduction_exprs,
1192 cp_parser_transaction_expression): Adjust.
1194 2014-08-15 Jason Merrill <jason@redhat.com>
1197 * pt.c (lookup_template_class_1): Revert recent change.
1198 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Revert recent change.
1201 * pt.c (instantiate_class_template_1): Ignore lambda on
1202 CLASSTYPE_DECL_LIST.
1203 (push_template_decl_real): A lambda is not primary.
1204 (lookup_template_class_1): Don't look for a lambda partial
1206 * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
1207 currently in a function and the lambda living in a function.
1208 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
1210 2014-08-15 Richard Biener <rguenther@suse.de>
1211 Jason Merrill <jason@redhat.com>
1214 * tree.c (build_min_array_type, set_array_type_canon): Split out...
1215 (build_cplus_array_type): ...from here. Only call build_array_type
1218 2014-08-15 Paolo Carlini <paolo.carlini@oracle.com>
1222 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1226 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1227 cv-qualifiers of function types.
1229 2014-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1231 * call.c (build_conditional_expr_1): Use OPT_Wextra in warning.
1233 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1235 * typeck.c (composite_pointer_type, cxx_sizeof_or_alignof_type,
1236 cp_build_array_ref, cp_build_function_call_vec): When a
1237 pedwarn is suppressed under SFINAE, return error_mark_node.
1239 * typeck.c (cxx_sizeof_or_alignof_type): Fix complain &
1240 tf_warning_or_error, where complain is a bool, glitch.
1242 2014-08-14 Ville Voutilainen <ville.voutilainen@gmail.com>
1245 * decl.c (grokdeclarator): Move the check for friend initializers..
1246 * decl2.c (grokfield) ..here. Postpone early return for friends
1247 until after the initializer check.
1249 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1252 * pt.c (coerce_template_parms): Improve error message vs default
1255 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1257 * parser.c (cp_parser_init_declarator): Remove redundant check of
1258 decl_specifiers->type.
1260 2014-08-13 Jason Merrill <jason@redhat.com>
1262 * call.c (build_x_va_arg): Support passing non-POD through ....
1263 (convert_arg_to_ellipsis): Likewise.
1265 2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
1267 * pt.c (lookup_template_variable): Make dependent variable templates
1270 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1272 * parser.c (cp_parser_elaborated_type_specifier): Handle
1273 specially cp_parser_template_id returning a BASELINK.
1275 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1277 * parser.c (cp_parser_diagnose_invalid_type_name,
1278 cp_parser_make_typename_type): Remove scope parameter.
1279 (cp_parser_parse_and_diagnose_invalid_type_name,
1280 cp_parser_elaborated_type_specifier): Adjust calls.
1282 2014-08-12 Ville Voutilainen <ville.voutilainen@gmail.com>
1284 Reject virt-specifiers on friends and member templates
1285 * friend.c (do_friend): Diagnose virt-specifiers.
1286 * pt.c (push_template_decl_real): Diagnose virt-specifiers.
1288 2014-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1290 * typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
1291 return type to bool; in C++11 for constants give errors, not pedwarns.
1292 * cp-tree.h (check_narrowing): Adjust declaration.
1293 * call.c (convert_like_real): Update calls.
1294 * semantics.c (finish_compound_literal): Likewise.
1296 2014-08-08 Jason Merrill <jason@redhat.com>
1298 * pt.c (lookup_template_class_1): Copy abi_tag.
1300 2014-08-08 Kai Tietz <ktietz@redhat.com>
1302 * semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
1303 that we operate on a true inline.
1305 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1307 * class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
1308 optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
1310 2014-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1313 * decl.c (build_enumerator): Handle class types with conversion
1314 operators via perform_implicit_conversion_flags and
1315 build_expr_type_conversion.
1317 * cvt.c (build_expr_type_conversion): Replace pair of errors
1318 with error + inform.
1320 2014-08-07 Jason Merrill <jason@redhat.com>
1323 * parser.c (c_parse_file): Change sorry to fatal_error.
1326 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
1328 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1330 * cp-tree.h, pt.c: Use hash_map instead of pointer_map.
1332 2014-08-06 Jason Merrill <jason@redhat.com>
1334 * init.c (build_vec_init): Fix constant initialization of
1336 (build_value_init_noctor): Call maybe_constant_init.
1337 * semantics.c (maybe_constant_init): See through EXPR_STMT and
1341 * init.c (build_vec_init): Reorganize earlier change a bit.
1344 * init.c (build_vec_init): Leave atype an ARRAY_TYPE
1345 if we're just returning an INIT_EXPR.
1347 2014-08-06 Jason Merrill <jason@redhat.com>
1348 Braden Obrzut <admin@maniacsvault.net>
1350 * pt.c (check_explicit_specialization): Don't test
1351 DECL_DECLARED_INLINE_P for a variable template.
1353 2014-08-06 Paolo Carlini <paolo.carlini@oracle.com>
1356 * typeck.c (cp_build_binary_op): Extend to more cases the
1359 2014-08-01 Braden Obrzut <admin@maniacsvault.net>
1361 Implement constexpr variable templates
1362 * decl.c (grokvardecl): Handle specializations of variable templates.
1363 (grokdeclarator): Handle variable template id expressions and NULL_TREE
1364 return from grokvardecl.
1365 * decl2.c (check_member_template): Allow declaration of template member
1367 * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for
1369 * pt.c (check_template_variable): Accept variable temploids at
1371 (push_template_decl_real): The current instantiation of a template
1373 (determine_specialization): Accept variable templates.
1374 (check_explicit_specialization): Handle and check for malformed
1375 variable template specializations.
1376 (lookup_template_variable): New.
1377 (tsubst_decl): Handle variable template specializations.
1378 (do_decl_instantiation): Handle template variables.
1379 (instantiate_decl): Handle template variables.
1380 * semantics.c (finish_template_variable): New.
1381 (finish_id_expression): Instantiate variable templates.
1382 * cp-tree.h (variable_template_p): New.
1384 2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1387 * decl.c (check_redeclaration_no_default_args): New.
1388 (duplicate_decls): Use it, handle default arguments
1389 in redeclarations of function templates.
1391 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1393 * optimize.c, semantics.c: Use hash_map instead of pointer_map.
1395 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1397 * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
1398 method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
1399 instead of pointer_set.
1401 2014-08-01 Jason Merrill <jason@redhat.com>
1404 * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
1405 init-list for trailing elements.
1406 * typeck2.c (process_init_constructor_array): Likewise.
1408 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1411 * decl.c (duplicate_decls): Handle static member functions too.
1413 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1415 * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
1418 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1421 * parser.c (cp_parser_array_notation): Added check for array_type.
1423 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1426 * cp-array-notation.c (expand_array_notation_exprs): Handling of
1427 DECL_EXPR improved. Changed handling for INIT_EXPR.
1429 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1431 * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P.
1433 2014-08-01 Jakub Jelinek <jakub@redhat.com>
1435 * cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
1436 -fsanitize=alignment call ubsan_maybe_instrument_reference
1437 for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
1438 for calls to member functions.
1440 2014-07-31 Marc Glisse <marc.glisse@inria.fr>
1443 * typeck.c (maybe_warn_about_returning_address_of_local): Return
1444 whether it is returning the address of a local variable.
1445 (check_return_expr): Return 0 instead of the address of a local
1448 2014-07-30 Jason Merrill <jason@redhat.com>
1452 * pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
1454 2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1457 * pt.c (unify_arity): Add boolean parameter.
1458 (unify_too_few_arguments): Likewise.
1459 (type_unification_real): Diagnose correctly insufficient
1460 arguments in the presence of trailing variadic parameters;
1461 deducing multiple trailing packs as empty is fine.
1463 2014-07-30 Jason Merrill <jason@redhat.com>
1468 * decl2.c (mark_all_virtuals): New variable.
1469 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1470 (cp_write_global_declarations): Set it and give helpful diagnostic
1471 if it introduces errors.
1472 * class.c (finish_struct_1): Check it.
1476 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
1477 (check_explicit_specialization): Clear it on specializations.
1478 * decl.c (duplicate_decls, start_decl): Likewise.
1479 (grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
1480 * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
1481 linkage after setting the appropriate flags.
1482 * tree.c (decl_linkage): Don't check DECL_COMDAT.
1483 * decl2.c (mark_needed): Mark clones.
1484 (import_export_decl): Not here.
1486 2014-07-25 Edward Smith-Rowland <3dw4rd@verizon.net>
1488 Implement N4051 - Allow typename in a template template parameter
1489 * parser.c (cp_parser_type_parameter_key): New funtion;
1490 (cp_parser_token_is_type_parameter_key): Ditto;
1491 (cp_parser_type_parameter): Look for type-parameter-key for all versions
1492 but pedwarn for less than cxx1z.
1494 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1497 * call.c (standard_conversion): Use resolve_nondeduced_context
1498 for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
1500 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1503 * parser.c (cp_parser_tokens_start_cast_expression): Return -1
1506 2014-07-15 Jason Merrill <jason@redhat.com>
1509 * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
1513 * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
1514 * class.c (finish_struct): Reject invalid definition of
1515 std::initializer_list.
1517 2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
1519 * call.c (convert_like_real): Call print_z_candidate and inform only
1520 if permerror returns true.
1522 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
1524 * class.c (build_clone): Do not clear assembler names of
1526 * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
1527 * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
1528 as a special case return sizeof (struct tree_decl_non_common)
1530 (cp_common_init_ts): Do not initialize NAMESPACE_DECL;
1531 initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
1532 * cp/cp-tree.h (tree_template_decl): New structure.
1533 (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
1534 (union cp_lang_tree_node): Add template_decl.
1535 (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
1537 2014-07-14 Jason Merrill <jason@redhat.com>
1541 * pt.c (instantiate_decl): Don't check defer_ok for local class
1544 2014-07-14 Jakub Jelinek <jakub@redhat.com>
1547 * cp-tree.h (LITERAL_ZERO_P): Define.
1548 * parser.c (cp_parser_parenthesized_expression_list): Add
1549 want_literal_zero_p argument, if true, for literal zeros
1550 insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
1551 (cp_parser_postfix_expression): Adjust
1552 cp_parser_parenthesized_expression_list caller, handle
1553 -Wmemset-transposed-args.
1554 (literal_zeros): New variable.
1556 2014-07-13 Jason Merrill <jason@redhat.com>
1559 * semantics.c (is_instantiation_of_constexpr): Return true for
1560 defaulted functions, too.
1561 (explain_invalid_constexpr_fn): Only use
1562 explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P.
1563 * method.c (explain_implicit_non_constexpr): Pass
1564 DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr.
1567 * decl.c (check_initializer): Don't finish_compound_literal
1568 on erroneous constexpr init.
1571 * tree.c (bot_replace): Only replace a dummy 'this' parm.
1574 * decl.c (create_array_type_for_decl): Only check for auto once.
1577 * call.c (build_list_conv): Don't try to build a list of references.
1579 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
1581 PR C++/60209 - Declaration of user-defined literal operator cause error
1582 * parser.c (cp_parser_operator): Fold treatment of strings
1583 and user-defined string literals. Use the full string parser.
1584 (cp_parser_string_literal): Add flag to not look for literal operator.
1586 2014-07-11 Jason Merrill <jason@redhat.com>
1590 * call.c (build_conditional_expr_1): Avoid reading freed memory.
1592 2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
1595 * call.c (build_user_type_conversion_1): Copy LOOKUP_NO_NARROWING
1597 * decl.c (check_initializer): Don't call check_narrowing here,
1598 set LOOKUP_NO_NARROWING.
1599 * typeck2.c (digest_init_r): Likewise.
1601 2014-07-10 Jason Merrill <jason@redhat.com>
1604 * semantics.c (reduced_constant_expression_p): Handle CONSTRUCTOR.
1608 * decl2.c (mark_all_virtuals): New variable.
1609 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1610 (cp_write_global_declarations): Set it and give helpful diagnostic
1611 if it introduces errors.
1612 * class.c (finish_struct_1): Check it.
1613 * decl.c (grokdeclarator): Clear virtualp after 'virtual auto' error.
1615 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1618 * decl.c (grokdeclarator): Adjust error messages about 'explicit'
1619 outside class declaration, in friend declaration, and neither on
1620 constructor nor conversion operator.
1622 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1626 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1627 cv-qualifiers of function types.
1629 2014-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
1630 Paolo Carlini <paolo.carlini@oracle.com>
1633 * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
1636 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
1638 * class.c (check_for_override): Wrap the 'final' and 'override'
1639 keywords in %< and %>.
1641 2014-07-06 Marek Polacek <polacek@redhat.com>
1644 * cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
1645 * decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
1646 * typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
1649 2014-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1651 * pt.c (convert_template_argument): Use inform instead of error in
1654 2014-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1659 * parser.c (cp_parser_userdef_string_literal): Take a tree
1661 (cp_parser_string_literal): Don't hack the token stream.
1663 2014-06-30 Jason Merrill <jason@redhat.com>
1667 * decl2.c (maybe_emit_vtables): Mark all vtable entries if
1669 * init.c (build_vtbl_address): Don't mark destructor.
1670 * class.c (finish_struct_1): Add all classes to keyed_classes
1674 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
1677 * mangle.c (decl_mangling_context): Look through a TEMPLATE_DECL.
1679 * decl.c (build_ptrmemfunc_type): Don't give a PMF RECORD_TYPE
1680 TYPE_BINFO or TYPE_LANG_SPECIFIC.
1681 * cp-tree.h (TYPE_PTRMEMFUNC_FLAG): Use TYPE_LANG_FLAG_2.
1682 (TYPE_PTRMEMFUNC_P): Don't expect TYPE_LANG_SPECIFIC.
1683 * typeck.c (build_ptrmemfunc_access_expr): Don't use lookup_member.
1684 * pt.c (unify): Also check whether the argument is a PMF.
1686 2014-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1689 * parser.c (cp_parser_tokens_start_cast_expression): In C++11
1690 a '[' can also start a primary-expression.
1691 (cp_parser_cast_expression): Parse a cast-expression only tentatively
1692 when cp_parser_tokens_start_cast_expression returns -1.
1694 2014-06-30 Jason Merrill <jason@redhat.com>
1697 * pt.c (unify_one_argument): Type/expression mismatch just causes
1700 * semantics.c (simplify_aggr_init_expr): Remove remnants of
1703 2014-06-30 Marek Polacek <polacek@redhat.com>
1705 * cp-gimplify.c (cp_genericize): Don't instrument returns if the
1706 function has no_sanitize_undefined attribute.
1707 * decl.c (compute_array_index_type): Don't instrument VLAs if the
1708 function has no_sanitize_undefined attribute.
1710 2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
1713 * cp-array-notation.c (expand_sec_reduce_builtin):
1714 Check that bultin argument is correct.
1715 * call.c (build_cxx_call): Check for 0 arguments in builtin call.
1717 2014-06-28 Jonathan Wakely <jwakely@redhat.com>
1721 * typeck.c (check_return_expr): Lookup as an rvalue even when the
1722 types aren't the same.
1724 2014-06-27 Jason Merrill <jason@redhat.com>
1727 * error.c (dump_template_bindings): Don't tsubst in a clone.
1729 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1732 * semantics.c (finish_compound_literal): Revert r204228.
1734 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1736 * parser.c (cp_parser_compound_literal_p): New.
1737 (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it.
1739 2014-06-26 Jason Merrill <jason@redhat.com>
1741 * parser.c (cp_parser_for_init_statement): Change range-for error
1744 N3994 Ranged-based for-loops: The Next Generation
1745 * parser.c (cp_lexer_nth_token_is): New.
1746 (cp_parser_for_init_statement): Allow "for (id : init)".
1748 2014-06-26 Teresa Johnson <tejohnson@google.com>
1750 * class.c (dump_class_hierarchy): Use saved dump files.
1751 (dump_vtable): Ditto.
1754 2014-06-26 Adam Butcher <adam@jessamine.co.uk>
1757 * parser.c (cp_parser_elaborated_type_specifier): Only consider template
1758 parameter lists outside of function parameter scope.
1760 2014-06-25 Paolo Carlini <paolo.carlini@oracle.com>
1764 * typeck2.c (process_init_constructor_record): Do not complain about
1765 uninitialized const members, because within aggregate-initialization,
1766 members without explicit initializers are value-initialized.
1768 2014-06-25 Jakub Jelinek <jakub@redhat.com>
1770 * semantics.c (finish_omp_clauses): Make sure
1771 OMP_CLAUSE_LINEAR_STEP has correct type.
1773 2014-06-24 Jan Hubicka <hubicka@ucw.cz>
1775 * class.c (check_methods, create_vtable_ptr, determine_key_method,
1776 add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by
1777 FUNCTION_DECL check.
1778 * cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
1779 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
1780 (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
1781 (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
1783 2014-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1786 * decl.c (grokdeclarator): Do not early check for operator-function-id
1789 2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
1791 * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
1794 2014-06-24 Jakub Jelinek <jakub@redhat.com>
1796 * parser.c (cp_parser_omp_for_loop): For
1797 #pragma omp parallel for simd move lastprivate clause from parallel
1798 to for rather than simd.
1800 2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
1804 * decl.c (grokparms): Accept a single parameter of type 'void'.
1806 2014-06-20 Jason Merrill <jason@redhat.com>
1809 * call.c (add_function_candidate): Avoid special 'this' handling
1810 if we have a ref-qualifier.
1813 * call.c (build_over_call): Call build_this in template path.
1815 2014-06-19 Jason Merrill <jason@redhat.com>
1818 * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
1820 2014-06-18 Jason Merrill <jason@redhat.com>
1823 * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
1824 ref-qualifier handling.
1827 * pt.c (resolve_overloaded_unification): Preserve
1828 ARGUMENT_PACK_EXPLICIT_ARGS.
1830 2014-06-18 Jakub Jelinek <jakub@redhat.com>
1832 * cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
1834 * cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
1836 2014-06-17 Jason Merrill <jason@redhat.com>
1839 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
1841 2014-06-15 Jason Merrill <jason@redhat.com>
1844 * pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
1847 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
1849 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1851 * decl.c (grokvardecl): Fix pasto in previous patch.
1853 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1855 * decl.c (duplicate_decls): Use set_decl_tls_model.
1856 (grokdeclarator): Likewise.
1857 * semantics.c (finish_id_expression): Check TLS only for
1859 (finish_omp_threadprivate): Use decl_default_tls_model.
1860 * decl2.c (get_guard): Likewise.
1861 * call.c (make_temporary_var_for_ref_to_temp): Likewise.
1863 2014-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1866 * decl.c (grokparms): Improve error message about void parameters.
1867 * error.c (type_to_string): Fix aka cut off code.
1869 2014-06-12 Jason Merrill <jason@redhat.com>
1871 * call.c (convert_arg_to_ellipsis): Use abi_version_crosses.
1872 * cvt.c (type_promotes_to): Likewise.
1873 * mangle.c (write_type, write_expression): Likewise.
1874 (write_name, write_template_arg): Likewise.
1875 (mangle_decl): Make alias based on flag_abi_compat_version.
1876 Emit -Wabi warning here.
1877 (finish_mangling_internal): Not here. Drop warn parm.
1878 (finish_mangling_get_identifier, finish_mangling): Adjust.
1879 (mangle_type_string, mangle_special_for_type): Adjust.
1880 (mangle_ctor_vtbl_for_type, mangle_thunk): Adjust.
1881 (mangle_guard_variable, mangle_tls_init_fn): Adjust.
1882 (mangle_tls_wrapper_fn, mangle_ref_init_variable): Adjust.
1884 * call.c (build_operator_new_call): Remove -fabi-version=1 support.
1885 * class.c (walk_subobject_offsets, include_empty_classes): Likewise.
1886 (layout_nonempty_base_or_field, end_of_class): Likewise.
1887 (layout_empty_base, build_base_field, layout_class_type): Likewise.
1888 (is_empty_class, add_vcall_offset_vtbl_entries_1): Likewise.
1889 (layout_virtual_bases): Likewise.
1890 * decl.c (compute_array_index_type): Likewise.
1891 * mangle.c (write_mangled_name, write_prefix): Likewise.
1892 (write_template_prefix, write_integer_cst, write_expression): Likewise.
1893 (write_template_arg, write_array_type): Likewise.
1894 * method.c (lazily_declare_fn): Likewise.
1895 * rtti.c (get_pseudo_ti_index): Likewise.
1896 * typeck.c (comp_array_types): Likewise.
1898 2014-06-11 Jan Hubicka <hubicka@ucw.cz>
1900 * vtable-class-hierarchy.c: Update handling for section names
1901 that are no longer trees.
1902 * decl.c (duplicate_decls): Likewise.
1904 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1907 * parser.c (cp_parser_init_declarator): Actually pass friend_p
1908 to cp_parser_declarator.
1910 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1913 * parser.c (cp_parser_using_declaration): Handle unscoped enums.
1914 * name-lookup.c (validate_nonmember_using_decl): Adjust error
1917 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1920 * parser.c (cp_parser_declarator): Add bool parameter.
1921 (cp_parser_direct_declarator): Likewise, use it.
1922 (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
1923 (cp_parser_condition, cp_parser_explicit_instantiation,
1924 cp_parser_init_declarator, cp_parser_type_id_1,
1925 cp_parser_parameter_declaration, cp_parser_exception_declaration,
1926 cp_parser_cache_defarg, cp_parser_objc_class_ivars,
1927 cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
1929 * decl.c (grokdeclarator): Fix handling of friend declared in
1930 namespace scope (g++.dg/parse/friend10.C).
1932 2014-06-10 Jan Hubicka <hubicka@ucw.cz>
1934 * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)
1936 * optimize.c (cdtor_comdat_group): Fix handling of aliases.
1937 (maybe_clone_body): Move symbol across comdat groups.
1938 * method.c (use_thunk): Copy implicit section flag.
1940 2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1943 * name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
1945 2014-06-07 Jan Hubicka <hubicka@ucw.cz>
1947 * method.c (use_thunk): Use set_decl_section_name.
1948 * optimize.c (maybe_clone_body): Use set_decl_section_name.
1949 * decl.c (duplicate_decls): Likewise.
1950 * vtable-class-hierarchy.c: Likewise.
1952 2014-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1955 * class.c (check_field_decls): In C++11 mode do not reject
1956 static data members and reference-type members in unions.
1958 2014-06-05 Jason Merrill <jason@redhat.com>
1961 * decl.c (check_initializer): Collapse a TREE_LIST here.
1962 * typeck2.c (store_init_value): Not here.
1964 2014-06-05 Richard Biener <rguenther@suse.de>
1965 Paolo Carlini <paolo.carlini@oracle.com>
1968 * cp-gimplify.c (cp_gimplify_expr, [MODIFY_EXPR]): Rework
1969 handling of empty classes.
1971 2014-06-04 Jason Merrill <jason@redhat.com>
1973 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
1974 for noexcept and thread_local, too.
1977 * decl.c (check_initializer): Maybe clear
1978 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1980 2014-06-05 Richard Biener <rguenther@suse.de>
1983 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
1984 warnings for accessing empty classes.
1986 2014-06-05 Marek Polacek <polacek@redhat.com>
1989 * parser.c (cp_parser_binary_expression): Warn when logical not is
1990 used on the left hand side operand of a comparison.
1992 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1995 * typeck.c (cp_build_modify_expr): Handle array of characters
1996 initialized by a string literal.
1997 * decl.c (check_initializer): Handle parenthesized string literal
1999 * typeck2.c (store_init_value): Remove redundant check.
2001 2014-06-04 Jason Merrill <jason@redhat.com>
2005 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
2006 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
2008 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
2011 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
2014 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2018 * call.c (standard_conversion): Convert nullptr to bool only
2019 in case of direct-initialization.
2020 (convert_like_real): Provide informative error message.
2022 2014-06-03 Marek Polacek <polacek@redhat.com>
2025 * semantics.c (finish_switch_cond): Warn if switch condition has
2028 2014-06-03 Jason Merrill <jason@redhat.com>
2031 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
2032 variable to local_specializations.
2035 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
2037 2014-06-02 Jason Merrill <jason@redhat.com>
2040 * decl.c (reshape_init_class): Handle un-folded
2041 constant-expressions.
2044 * pt.c (pack_deducible_p): Handle canonicalization.
2046 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
2048 * pt.c (tsubst_function_type): Initialize arg_types.
2050 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
2053 * class.c (handle_using_decl): Pass the correct scope to
2054 cp_emit_debug_info_for_using.
2056 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
2060 * search.c (accessible_p): Use current_nonlambda_class_type.
2061 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2063 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
2065 * decl.c: Include builtins.h.
2066 * semantics.c: Likewise.
2068 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
2072 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
2073 * pt.c (tsubst_function_type): Inject the this parameter; do the
2074 substitutions in the order mandated by the DR.
2075 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
2076 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
2077 (static_fn_type): Copy it.
2078 * decl2.c (build_memfn_type, change_return_type,
2079 cp_reconstruct_complex_type): Likewise.
2080 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
2081 * tree.c (strip_typedefs): Likewise.
2082 * typeck.c (merge_types): Likewise.
2084 2014-05-30 Jason Merrill <jason@redhat.com>
2087 * pt.c (instantiate_decl): Check that defer_ok is not set for
2088 local class members.
2091 * pt.c (tsubst_init): Split out from...
2092 (tsubst_expr) [DECL_EXPR]: Here.
2093 (tsubst_copy) [VAR_DECL]: Use it.
2094 * semantics.c (finish_id_expression): Return the decl for static/const.
2096 2014-05-28 Jason Merrill <jason@redhat.com>
2099 * decl.c (cxx_comdat_group): Return a decl.
2100 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
2102 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
2106 * call.c (build_aggr_conv): Ignore passed in flags.
2107 (build_array_conv, build_complex_conv): Likewise.
2109 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2111 * optimize.c (maybe_thunk_body): Use set_comdat_group.
2112 (maybe_clone_body): Likewise.
2113 * decl.c (duplicate_decls): Update code duplicating comdat group;
2114 do not copy symtab pointer; before freeing newdecl remove it
2116 * decl2.c (constrain_visibility): Use set_comdat_group.
2118 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2120 * rtti.c: Include tm_p.h
2121 (emit_tinfo_decl): Force RTTI data to be aligned to required
2124 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2126 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
2127 ignoring other target adjustments.
2129 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
2131 * semantics.c (finish_omp_clauses): Remove duplicated variable
2134 * parser.c (cp_parser_omp_target): Return bool values.
2136 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2139 * lambda.c (add_capture): Enforce that capture by value requires
2141 * typeck2.c (cxx_incomplete_type_inform): Early return if
2142 TYPE_MAIN_DECL is null.
2144 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
2147 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
2149 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2152 * lambda.c (build_capture_proxy, add_capture): Treat normal
2153 captures and init-captures identically.
2155 2014-05-21 Mark Wielaard <mjw@redhat.com>
2158 * cp-lang.c (cxx_enum_underlying_base_type): New function.
2159 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
2161 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2163 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
2164 * cp-array-notation.c (replace_invariant_exprs): Likewise.
2165 (expand_array_notation): Handle VOID_CST.
2166 * error.c (dump_expr): Likewise.
2167 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
2168 (cxx_pretty_printer::expression): Likewise.
2169 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
2170 * decl.c (register_dtor_fn): Likewise.
2171 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
2172 (build_delete, push_base_cleanups): Likewise.
2173 * mangle.c (write_expression): Likewise.
2174 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
2175 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
2176 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
2177 * tree.c (cp_tree_equal): Likewise.
2178 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
2179 instead of void_zero_node.
2180 * typeck.c (check_return_expr): Likewise.
2181 * typeck2.c (build_functional_cast): Likewise.
2183 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
2186 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
2188 (cp_parser_statement): ...here. Make sure only semicolon can go after
2191 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2196 * typeck2.c (digest_nsdmi_init): New.
2197 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
2198 * init.c (get_nsdmi): Likewise.
2199 * cp-tree.h (digest_nsdmi_init): Declare.
2201 2014-05-20 Jason Merrill <jason@redhat.com>
2203 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
2204 up a virtual function in a dummy object.
2206 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2209 * decl.c (duplicate_decls): Replace pair of warning_at with
2210 warning_at + inform.
2211 (maybe_commonize_var): Likewise.
2213 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2216 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
2217 (tsubst_copy_and_build): Perform recursive substitutions in a
2218 deterministic order.
2220 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2223 * typeck2.c (cxx_incomplete_type_inform): New.
2224 (cxx_incomplete_type_diagnostic): Use it.
2225 * decl.c (grokdeclarator): Check the element type of an
2226 incomplete array type; call the above.
2227 * cp-tree.h (cxx_incomplete_type_inform): Declare.
2229 2014-05-19 Jason Merrill <jason@redhat.com>
2232 * pt.c (tsubst_copy): Don't check at_function_scope_p.
2233 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
2235 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
2237 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
2238 * parser.c (cp_parser_enum_specifier): Likewise.
2240 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
2242 * class.c (sorted_fields_type_new): Adjust.
2243 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
2244 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
2245 * cp-tree.h: Remove usage of variable_size gty attribute.
2246 * decl.c (make_label_decl): Adjust.
2247 (check_goto): Likewise.
2248 (start_preparsed_function): Likewise.
2249 (save_function_data): Likewise.
2250 * lex.c (init_reswords): Likewise.
2251 (retrofit_lang_decl): Likewise.
2252 (cxx_dup_lang_specific_decl): Likewise.
2253 (copy_lang_type): Likewise.
2254 (cxx_make_type): Likewise.
2255 * name-lookup.c (binding_entry_make): Likewise.
2256 (binding_table_construct): Likewise.
2257 (binding_table_new): Likewise.
2258 (cxx_binding_make): Likewise.
2259 (pushdecl_maybe_friend_1): Likewise.
2260 (begin_scope): Likewise.
2261 (push_to_top_level): Likewise.
2262 * parser.c (cp_lexer_alloc): Likewise.
2263 (cp_lexer_new_from_tokens): Likewise.
2264 (cp_token_cache_new): Likewise.
2265 (cp_parser_context_new): Likewise.
2266 (cp_parser_new): Likewise.
2267 (cp_parser_nested_name_specifier_opt): Likewise.
2268 (cp_parser_template_id): Likewise.
2269 * pt.c (maybe_process_partial_specialization): Likewise.
2270 (register_specialization): Likewise.
2271 (add_pending_template): Likewise.
2272 (lookup_template_class_1): Likewise.
2273 (push_tinst_level): Likewise.
2274 * semantics.c (register_constexpr_fundef): Likewise.
2275 (cxx_eval_call_expression): Likewise.
2276 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
2278 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
2281 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
2282 when cp_parser_lookup_name sets ambiguous_decls.
2284 2014-05-15 Jason Merrill <jason@redhat.com>
2286 * call.c (print_conversion_rejection): Use loc consistently.
2288 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2290 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
2291 * call.c (convert_like_real, build_new_method_call_1): Use it.
2292 * decl2.c (grokfield): Likewise.
2293 * init.c (perform_member_init, build_aggr_init, expand_default_init,
2294 build_new_1): Likewise.
2295 * mangle.c (write_expression): Likewise.
2296 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
2298 2014-05-14 Jason Merrill <jason@redhat.com>
2302 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
2303 dropped cv-quals as a bad conversion.
2304 (convert_like_real) [ck_ref_bind]: Explain them.
2305 (compare_ics): Check badness before stripping reference
2306 bindings. Handle comparing bad reference bindings.
2307 * typeck.c (comp_cv_qualification): Add overload that just takes
2309 * cp-tree.h: Declare it.
2311 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
2312 (arg_conversion_rejection, bad_arg_conversion_rejection)
2313 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
2314 (add_function_candidate): Pass actual argument, rather than type, to
2315 bad_arg_conversion_rejection.
2316 (print_conversion_rejection): Explain what's wrong with the conversion.
2317 (print_z_candidates): Say "candidate:" before each candidate.
2318 (splice_viable): Be strict if we see a viable or template candidate.
2319 (build_user_type_conversion_1): Pass false to strict parameter.
2320 (perform_overload_resolution, build_conditional_expr_1): Likewise.
2321 (build_new_op_1, build_new_method_call_1): Likewise.
2322 (build_op_call_1): Pass true to strict parameter.
2324 2014-05-13 Jason Merrill <jason@redhat.com>
2326 * call.c (print_error_for_call_failure): Say "no match" rather
2327 than "ambiguous" if there were no strict matches.
2328 (build_new_method_call_1): Likewise.
2331 * semantics.c (is_this_parameter): Allow capture proxies too.
2333 2014-05-12 Jason Merrill <jason@redhat.com>
2335 * call.c (maybe_print_user_conv_context): New.
2336 (convert_like_real): Use it. Print call context for bad
2337 user-defined conversion.
2338 (build_over_call): Print call context for bad 'this' conversion.
2340 * call.c (convert_like_real): Use inform for identifying the
2343 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
2345 * cvt.c (cp_convert_to_pointer): Don't call error_at if
2346 complain & tf_error is false.
2348 * decl.c (make_unbound_class_template): Prefer inform for
2349 "declared here"-type message.
2351 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
2355 * lambda.c (lambda_expr_this_capture): Add new parameter
2356 add_capture_p controlling whether the functions will try to
2357 capture 'this' via the default capture.
2358 (maybe_resolve_dummy): Likewise.
2359 * cp-tree.h: Adjust prototypes.
2360 * call.c, semantics.c: Change callers of these functions.
2361 * call.c (build_new_method_call_1): Use the actual 'this' that
2362 would be potentially captured for the overload resolution, instead
2363 of the dummy object.
2365 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2367 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
2369 (convert_nontype_argument): Adjust calls.
2370 (coerce_template_parameter_pack): Add missing complain & tf_error
2373 2014-05-09 Jason Merrill <jason@redhat.com>
2377 * call.c (build_conditional_expr_1, conditional_conversion): Handle
2378 non-class lvalues and xvalues that differ only in cv-qualifiers.
2382 * call.c (build_user_type_conversion_1): The copy-init temporary
2386 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
2389 * call.c (build_conditional_expr_1): If overload resolution finds
2390 no match, just say "different types".
2393 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
2396 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
2397 if we didn't find a conversion.
2398 Don't accept a bad conversion too early.
2400 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2403 * typeck.c (convert_for_assignment): Provide an inform for pointers
2404 to incomplete class types.
2406 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2409 * pt.c (convert_nontype_argument): Protect all the error calls
2410 with complain & tf_error.
2412 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2415 * pt.c (instantiate_decl): Avoid generating the body of a
2418 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2421 * pt.c (maybe_begin_member_template_processing): Use
2422 uses_template_parms.
2424 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
2425 Mike Stump <mikestump@comcast.net>
2426 Richard Sandiford <rdsandiford@googlemail.com>
2428 * call.c: Include wide-int.h.
2429 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2430 (convert_for_arg_passing): Likewise.
2431 * class.c: Include wide-int.h.
2432 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
2433 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2434 (include_empty_classes): Likewise
2435 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
2436 * cvt.c: Include wide-int.h.
2437 (ignore_overflows): Use wide_int_to_tree.
2438 * decl.c: Include wide-int.h.
2439 (check_array_designated_initializer): Use wide-int interfaces.
2440 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
2441 (finish_enum_value_list): Use signop.
2442 (build_enumerator): Use wide-int interfaces.
2443 * init.c: Include wide-int.h.
2444 (build_new_1): Use wide-int interfaces.
2445 * mangle.c: Include wide-int.h.
2446 (write_integer_cst): Use wide-int interfaces.
2447 (write_array_type): Likewise.
2448 * tree.c: Include wide-int.h.
2449 (cp_tree_equal): Use tree_int_cst_equal.
2450 * typeck2.c: Include wide-int.h.
2451 (process_init_constructor_array): Use wide-int interfaces.
2453 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2456 * decl.c (grokfndecl): Check duplicate_decls return value for
2458 * pt.c (instantiate_decl): A deleted function is defined.
2460 2014-05-02 Jason Merrill <jason@redhat.com>
2462 * decl2.c (vague_linkage_p): Local statics have vague linkage.
2465 * lambda.c (lambda_capture_field_type): Wrap anything dependent
2467 (add_capture): Check for VLA before calling it.
2468 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
2469 just the current one. Make non-static.
2470 * cp-tree.h: Declare it.
2471 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
2472 the operand was static or constant.
2474 2014-05-02 Marek Polacek <polacek@redhat.com>
2476 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
2479 2014-05-01 Marek Polacek <polacek@redhat.com>
2482 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
2483 between label and variable when warning about returning local address.
2485 2014-04-30 Jason Merrill <jason@redhat.com>
2488 * init.c (build_value_init): Don't try to call an array constructor.
2491 * typeck2.c (massage_init_elt): Use maybe_constant_init.
2493 2014-04-30 Marek Polacek <polacek@redhat.com>
2495 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
2496 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
2497 for non-integer types.
2499 2014-04-29 Jason Merrill <jason@redhat.com>
2502 Represent the unevaluated exception specification of an implicitly
2503 declared or deleted function with a simple placeholder, not a list
2505 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
2506 * except.c (unevaluated_noexcept_spec): New.
2507 * class.c (deduce_noexcept_on_destructor): Use it.
2508 * decl.c (check_redeclaration_exception_specification): Call
2509 maybe_instantiate_noexcept.
2510 (duplicate_decls): Call it before merge_types.
2511 (start_preparsed_function): Call maybe_instantiate_noexcept.
2512 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
2513 * init.c (get_nsdmi): Factor out of perform_member_init.
2514 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
2515 (walk_field_subobs): Consider NSDMI for EH spec.
2516 (get_defaulted_eh_spec): New.
2517 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
2518 (defaulted_late_check): Defer EH checking in non-template classes.
2519 (after_nsdmi_defaulted_late_checks): New.
2520 * parser.c (cp_parser_class_specifier_1): Use it.
2521 (unparsed_classes): New macro.
2522 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
2523 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
2524 Remove list-of-functions handling.
2525 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
2526 handling and FN parameter.
2527 * typeck.c (merge_types): Adjust.
2529 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2532 * parser.c (cp_parser_alias_declaration): Check return value of
2535 2014-04-24 Jakub Jelinek <jakub@redhat.com>
2537 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
2538 atomic-clause, allow comma in between atomic-clause and
2541 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
2544 * rtti.c (emit_support_tinfos): Do not iterate on
2545 registered_builtin_types (partial revert).
2547 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
2550 * semantics.c (apply_deduced_return_type): Complete non-void type
2551 before estimating whether the type is aggregate.
2553 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
2556 * rtti.c (emit_support_tinfo_1): New function, extracted from
2557 emit_support_tinfos.
2558 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
2560 2014-04-22 Jakub Jelinek <jakub@redhat.com>
2563 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
2564 fails, don't set OM_PARALLEL_COMBINED and return NULL.
2566 2014-04-18 Jason Merrill <jason@redhat.com>
2569 * call.c (reference_binding): Recurse on user-defined conversion.
2572 * call.c (standard_conversion): Don't try to apply restrict to void.
2574 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
2576 * decl.c (reshape_init_r): Handle a single element of vector type.
2578 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2581 * decl2.c (cplus_decl_attributes): Handle
2582 pointer-to-member-function declarations.
2584 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2587 * call.c (build_user_type_coversion): Use build_dummy_object
2588 to create the placeholder object for a constructor method call.
2589 (build_special_member_call): Likewise.
2590 (build_over_call): Check for the placeholder object with
2592 (build_new_method_call_1): Likewise. Don't attempt to resolve
2593 a dummy object for a constructor method call.
2595 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
2598 * friend.c (add_friend, make_friend_class): Move repeated friend
2599 warning under Wredundant_decls.
2601 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
2603 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
2604 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2605 (do_class_using_decl): Likewise.
2606 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
2608 2014-04-15 Jakub Jelinek <jakub@redhat.com>
2611 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
2613 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2615 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
2617 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2619 * pt.c (mark_template_parm): Use template_parm_level_and_index.
2621 2014-04-11 Jason Merrill <jason@redhat.com>
2623 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
2625 (cp_lexer_get_preprocessor_token): Always clear it.
2626 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
2630 * decl.c (reshape_init_r): Handle a single element of class type.
2633 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
2634 built-in operator new.
2636 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2639 * name-lookup.c (parse_using_directive): Return early if the
2640 attribs argument is error_mark_node; use get_attribute_name.
2642 2014-04-11 Jason Merrill <jason@redhat.com>
2646 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
2647 * call.c (struct z_candidate): Add flags field.
2648 (add_candidate): Add flags parm.
2649 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
2650 (add_template_candidate_real): Pass it.
2651 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
2652 * tree.c (build_aggr_init_expr): Copy it.
2653 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
2655 2014-04-10 Richard Biener <rguenther@suse.de>
2656 Jakub Jelinek <jakub@redhat.com>
2659 * error.c (dump_decl) <case FUNCTION_DECL>: If
2660 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
2661 recurse on DECL_ABSTRACT_ORIGIN instead of printing
2664 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
2666 * pt.c (check_template_variable): Check for the return of pedwarn
2667 before emitting a note.
2668 * parser.c (cp_parser_lambda_introducer): Likewise.
2670 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2673 * pt.c (process_template_parm): For an invalid non-type parameter
2674 only set TREE_TYPE to error_mark_node.
2675 (push_inline_template_parms_recursive, comp_template_parms,
2676 redeclare_class_template, coerce_template_template_parm,
2677 coerce_template_template_parms, unify): Use error_operand_p.
2679 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
2681 * class.c (check_bases_and_members): Warn about non-virtual dtors
2682 in public bases only. Check warn_ecpp before complaining about
2683 non-polymorphic bases.
2685 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2687 * decl.c (duplicate_decls): Check for the return of warning_at
2688 before emitting a note.
2689 (warn_misplaced_attr_for_class_type): Likewise.
2690 (check_tag_decl): Likewise.
2692 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
2695 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
2697 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
2700 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
2701 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
2702 instantiating a variable-sized type.
2705 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
2707 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2709 * class.c (find_abi_tags_r): Check for the return of warning
2710 before emitting a note.
2711 (one_inherited_ctor): Likewise.
2713 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2715 * decl.c (duplicate_decls): Check for the return of permerror
2716 before emitting a note.
2718 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
2720 * class.c (accessible_nvdtor_p): New.
2721 (check_bases): Don't check base destructor here ...
2722 (check_bases_and_members): ... check them here. Trigger on
2723 Wnon-virtual-dtor flag.
2724 (finish_struct_1): Use accessible_nvdtor_p.
2726 2014-04-01 Jason Merrill <jason@redhat.com>
2728 * pt.c (process_partial_specialization): Say "not deducible"
2729 rather than "not used". Use inform.
2732 * pt.c (coerce_template_parms): Check that the pack expansion
2733 pattern works with the first matching parameter.
2735 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
2737 * init.c (perform_member_init): Homogenize uninitialized
2740 2014-04-01 Jason Merrill <jason@redhat.com>
2743 * call.c (build_array_conv): Call complete_type.
2746 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
2747 (picflag_from_initializer): Return it.
2748 (process_init_constructor): Handle it.
2751 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
2752 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
2753 * pt.c (get_template_info): Handle NAMESPACE_DECL.
2754 (most_general_template): Handle more kinds of template.
2755 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
2756 instantiations and specializations.
2758 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
2761 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
2762 COMPONENT_REFs and ARRAY_REFs sooner.
2764 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
2767 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
2768 usage in non-functions with pushed scope.
2770 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
2773 * name-lookup.h (cp_binding_level): New transient field defining_class_p
2774 to indicate whether a scope is in the process of defining a class.
2775 * semantics.c (begin_class_definition): Set defining_class_p.
2776 * name-lookup.c (leave_scope): Reset defining_class_p.
2777 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
2778 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
2779 unwinding to class-defining scope to handle the erroneous definition of
2780 a generic function of an arbitrarily nested class within an enclosing
2783 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
2786 * method.c (walk_field_subobs): Improve the diagnostic
2787 locations for both REFERENCE_TYPEs and non-static const members.
2788 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
2789 instead of %qD to be consistent with the c++11 diagnostic.
2791 2014-03-25 Jason Merrill <jason@redhat.com>
2795 * class.c (build_vtbl_initializer): Handle abstract dtors here.
2796 * search.c (get_pure_virtuals): Not here.
2799 * parser.c (cp_parser_lambda_expression): Don't parse the body of
2800 a lambda in unevaluated context.
2803 * decl.c (create_array_type_for_decl): Complain about array of auto.
2805 2014-03-25 Jakub Jelinek <jakub@redhat.com>
2808 * semantics.c (potential_constant_expression_1): Handle
2811 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
2814 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
2815 introducing an implicit function template parameter within an explicit
2818 2014-03-22 Jason Merrill <jason@redhat.com>
2821 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
2824 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2827 * name-lookup.c (push_class_level_binding_1): Check identifier_p
2828 on the name argument.
2830 2014-03-20 Jakub Jelinek <jakub@redhat.com>
2833 * init.c (build_zero_init_1): Ignore fields with error_mark_node
2836 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2839 * call.c (build_new_method_call_1): Handle pure virtuals called by
2842 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
2845 * parser.c (cp_parser_member_declaration): Don't allow
2846 finish_fully_implicit_template to consider friend declarations to be
2847 class member templates.
2848 (synthesize_implicit_template_parm): Handling winding back through class
2849 scope to the class being defined in order to inject a template argument
2853 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
2854 function scope as per cp_parser_skip_to_end_of_statement.
2856 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2859 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
2861 2014-03-14 Jason Merrill <jason@redhat.com>
2865 * search.c (get_pure_virtuals): Handle abstract dtor here.
2866 (dfs_get_pure_virtuals): Not here.
2869 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
2870 abstract class as pure.
2872 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2875 * pt.c (maybe_process_partial_specialization): Check return value
2876 of check_specialization_namespace.
2878 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2881 * semantics.c (finish_static_assert): Call cxx_constant_value only
2882 if require_potential_rvalue_constant_expression returns true.
2884 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
2887 * method.c (get_inherited_ctor): New.
2888 * cp-tree.h (get_inherited_ctor): Declare it.
2889 * semantics.c (is_valid_constexpr_fn): Use it.
2891 2014-03-10 Jason Merrill <jason@redhat.com>
2894 * call.c (convert_default_arg): Remove special handling for
2898 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
2899 when deciding whether to call push_template_decl for a member class.
2900 * pt.c (push_template_decl_real): Return after wrong levels error.
2902 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
2905 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
2906 lambda, remove the lambda's own template argument list prior to fetching
2910 * parser.c (cp_parser_parameter_declaration_clause): Move generic
2911 function template unwinding on error into a more general location, ...
2912 (cp_parser_skip_to_end_of_statement): ... here.
2914 2014-03-07 Jason Merrill <jason@redhat.com>
2916 * Make-lang.in (check_g++_parallelize): Split dg.exp.
2918 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
2919 we're in a trailing return type.
2921 * typeck.c (comp_template_parms_position): 'auto' and
2922 'decltype(auto)' are different from real template parms.
2924 * parser.c (cp_parser_using_declaration): Consume the semicolon
2925 after bare parameter pack error.
2927 * cp-tree.h (REF_PARENTHESIZED_P): New.
2928 * semantics.c (force_paren_expr): Set it.
2929 * pt.c (do_auto_deduction): Check it.
2930 (tsubst) [COMPONENT_REF]: Copy it.
2931 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
2933 * decl.c (create_array_type_for_decl): Only warn about invalid
2934 C++1y VLA if flag_iso or warn_vla>0.
2935 (grokdeclarator): Likewise.
2936 * pt.c (tsubst): Likewise.
2937 * semantics.c (finish_decltype_type): Likewise.
2938 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
2939 (cp_build_addr_expr_1): Likewise.
2940 * init.c (build_new_1): Improve diagnostics.
2942 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2945 * decl.c (check_initializer): Return NULL_TREE after error;
2946 consistently use inform.
2948 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2950 * decl.c (check_initializer): Remove dead code.
2952 2014-03-06 Marek Polacek <polacek@redhat.com>
2955 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
2956 of checking tree code.
2958 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2960 * parser.c (cp_lexer_set_source_position): New.
2961 (cp_parser_mem_initializer): Use it.
2962 (cp_parser_postfix_open_square_expression): Likewise.
2963 (cp_parser_parenthesized_expression_list): Likewise.
2964 (cp_parser_new_initializer): Likewise.
2965 (cp_parser_jump_statement): Likewise.
2966 (cp_parser_initializer): Likewise.
2967 (cp_parser_functional_cast): Likewise.
2969 2014-03-05 Jason Merrill <jason@redhat.com>
2972 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
2973 dependent expression.
2976 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
2977 if re-parsing might succeed.
2978 * semantics.c (finish_id_expression): Use of a parameter outside
2979 the function body is a parse error.
2981 * parser.c (cp_parser_mem_initializer): Set input_location
2982 properly for init-list warning.
2983 (cp_parser_postfix_open_square_expression): Likewise.
2984 (cp_parser_parenthesized_expression_list): Likewise.
2985 (cp_parser_new_initializer): Likewise.
2986 (cp_parser_jump_statement): Likewise.
2987 (cp_parser_initializer): Likewise.
2988 (cp_parser_functional_cast): Likewise.
2990 2014-03-04 Jason Merrill <jason@redhat.com>
2993 * typeck2.c (process_init_constructor_record): Set
2994 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
2998 * parser.c (cp_parser_direct_declarator): Set declarator to
2999 cp_error_declarator on invalid qualified-id.
3001 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
3004 * parser.c (cp_parser_using_declaration): Early return when
3005 cp_parser_nested_name_specifier errors out.
3007 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
3010 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
3011 function scope on parse error in function parameter list.
3013 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
3015 * method.c (implicitly_declare_fn): Remove redundant
3016 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
3017 * semantics.c (is_instantiation_of_constexpr): Likewise.
3018 * error.c (dump_function_decl): Likewise.
3020 2014-03-01 Jason Merrill <jason@redhat.com>
3023 * semantics.c (begin_maybe_infinite_loop): Use
3024 fold_non_dependent_expr_sfinae.
3026 2014-02-28 Jason Merrill <jason@redhat.com>
3029 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
3031 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
3034 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
3035 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
3036 * lambda.c (maybe_add_lambda_conv_op): Likewise.
3038 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
3041 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
3044 2014-02-27 Jason Merrill <jason@redhat.com>
3048 * decl2.c (tentative_decl_linkage): Don't mess with functions that
3049 are not yet defined.
3051 2014-02-26 Jason Merrill <jason@redhat.com>
3055 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
3056 * init.c (build_vtbl_address): Do it here.
3062 * pt.c (struct warning_sentinel): New.
3063 (tsubst_copy_and_build): Use it instead of
3064 c_inhibit_evaluation_warnings.
3065 * typeck.c (maybe_warn_about_useless_cast): Remove
3066 c_inhibit_evaluation_warnings check.
3069 * pt.c (get_template_parm_index): New.
3070 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
3071 (process_template_parm): Allow bare packs in template template
3072 parm template parms.
3073 (coerce_template_parameter_pack): Handle fixed template template
3074 parm packs and fixed packs not at the end of the parm list.
3075 (coerce_template_parms): Handle template parm packs not at the end
3077 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
3080 * pt.c (unify): Ignore alias templates when deducing a template
3086 * call.c (reference_binding): Recurse on user-defined conversion.
3087 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3089 2014-02-25 Jason Merrill <jason@redhat.com>
3092 * call.c (reference_binding): Recurse on user-defined conversion.
3093 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3095 * call.c (print_conversion_rejection): Handle n_arg of -2.
3096 (build_user_type_conversion_1): Pass it.
3099 * decl2.c (no_linkage_error): Handle C++98 semantics.
3100 (reset_type_linkage): Move from decl.c.
3101 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
3102 (bt_reset_linkage_2, reset_decl_linkage): New.
3103 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
3104 (cp_write_global_declarations): Move condition into no_linkage_error.
3105 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
3106 * semantics.c (expand_or_defer_fn_1): Factor out
3107 tentative_decl_linkage.
3108 * cp-tree.h: Adjust.
3110 * decl2.c (finish_static_data_member_decl): Diagnose static data
3111 member in unnamed class.
3112 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
3115 * class.c (clone_function_decl): Call note_vague_linkage_fn for
3116 defaulted virtual dtor.
3120 * pt.c (get_underlying_template): Fix equivalence calculation.
3122 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
3125 * parser.c (function_being_declared_is_template_p): Return false when
3126 processing a template parameter list.
3127 (cp_parser_parameter_declaration_clause): Don't set
3128 auto_is_implicit_function_template_parm_p when processing a
3129 template parameter list.
3131 * parser.c (synthesize_implicit_template_parm): Inject new template
3132 argument list appropriately when a generic member function
3133 of a class template is declared out-of-line.
3136 * parser.c (cp_parser_direct_declarator): Don't save and
3137 restore num_template_parameter_lists around call to
3138 cp_parser_parameter_declaration_list.
3139 (function_being_declared_is_template_p): New predicate.
3140 (cp_parser_parameter_declaration_list): Use
3141 function_being_declared_is_template_p as predicate for
3142 inspecting current function template parameter list length
3143 rather than num_template_parameter_lists.
3145 2014-02-24 Jason Merrill <jason@redhat.com>
3148 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
3149 DECL_EXPR initialize a non-class iterator.
3152 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
3154 2014-02-21 Jason Merrill <jason@redhat.com>
3157 * parser.c (cp_parser_type_name): Always check dependency.
3158 (cp_parser_type_specifier_seq): Call
3159 cp_parser_parse_and_diagnose_invalid_type_name.
3162 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
3165 * parser.c (cp_parser_default_argument): Clear
3166 current_class_ptr/current_class_ref like tsubst_default_argument.
3169 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
3170 than current_binding_level.
3173 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
3176 * parser.c (cp_parser_enum_specifier): Call
3177 check_for_bare_parameter_packs.
3180 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
3184 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
3185 of the partial instantiation, not the most general template.
3186 (maybe_process_partial_specialization): Reassign everything on
3190 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
3191 (check_explicit_specialization): Don't clone.
3194 * pt.c (coerce_template_parms): Bail if argument packing fails.
3197 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
3198 Don't get confused by a CONSTRUCTOR that already has a type.
3201 * call.c (build_array_conv): Don't crash on VLA.
3204 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
3207 * lambda.c (maybe_resolve_dummy): Don't try to capture this
3208 in declaration context.
3212 * pt.c (unify): Only unify if deducible. Handle 0-length list.
3215 * parser.c (cp_parser_direct_declarator): Don't wrap a
3216 type-dependent expression in a NOP_EXPR.
3219 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
3224 * parser.c (cp_parser_template_argument): Restore dereference.
3225 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
3226 (process_partial_specialization): Handle deref.
3229 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
3233 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
3234 implicit_template_scope upon leaving an out-of-line generic member
3235 function definition.
3237 2014-02-20 Kai Tietz <ktietz@redhat.com>
3240 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
3241 valued type argument as error_mark_node.
3244 * semantics.c (finish_fname): Handle error_mark_node.
3246 2014-02-19 Jason Merrill <jason@redhat.com>
3249 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
3250 spec from template context.
3252 2014-02-19 Jakub Jelinek <jakub@redhat.com>
3255 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
3256 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
3259 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
3261 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3264 * semantics.c (ensure_literal_type_for_constexpr_object): Use
3267 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3270 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
3271 During error recovery allow_non_constant may be false.
3273 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
3276 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
3277 scope whenever a template parameter list has been started, independent
3278 of whether the function call operator was well-formed or not.
3281 * parser.c (cp_parser_member_declaration): Pop fully implicit template
3282 scope for generic friend declarations as well as for non-friends.
3284 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
3287 * method.c (implicitly_declare_fn): A constructor of a class with
3288 virtual base classes isn't constexpr (7.1.5p4).
3290 2014-02-05 Jan Hubicka <hubicka@ucw.cz
3292 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
3294 2014-02-05 Jakub Jelinek <jakub@redhat.com>
3297 * parser.c (cp_parser_omp_declare_reduction): Save and free
3300 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
3304 * tree.c (handle_init_priority_attribute): Call default_conversion on
3305 the attribute argument.
3307 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
3310 * method.c (synthesized_method_walk): If vbases is non-null but
3311 is_empty is true, likewise don't worry about the virtual bases.
3313 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
3316 * typeck2.c (process_init_constructor_record): Just skip unnamed
3319 2014-01-31 Jason Merrill <jason@redhat.com>
3322 * pt.c (mark_decl_instantiated): Call mark_needed.
3325 * decl2.c (handle_tls_init): Handle null init fn.
3328 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
3330 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
3333 * class.c (build_vfield_ref): Early return error_mark_node if
3334 TYPE_VFIELD (type) is null.
3335 (build_base_path): Check return value of build_vfield_ref.
3337 2014-01-31 Jason Merrill <jason@redhat.com>
3340 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
3341 [ck_list]: Check for error_mark_node.
3342 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
3345 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
3346 during partial ordering.
3348 2014-01-31 Marek Polacek <polacek@redhat.com>
3351 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
3353 2014-01-30 Jason Merrill <jason@redhat.com>
3356 * cp-tree.h (struct saved_scope): Add x_local_specializations.
3357 (local_specializations): New macro.
3358 * pt.c (local_specializations): Remove variable.
3360 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
3363 * parser.c (make_string_pack): Use double_int::from_buffer.
3365 2014-01-30 Marek Polacek <polacek@redhat.com>
3368 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
3370 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
3371 with input_location.
3372 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
3375 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3378 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
3380 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3383 * pt.c (lookup_template_class_1): Check start_enum return value
3384 for error_mark_node.
3386 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3388 * decl.c (duplicate_decls, typename_hash, typename_compare):
3389 Use TYPE_IDENTIFIER.
3390 * error.c (dump_type): Likewise.
3391 * mangle.c (dump_substitution_candidates): Likewise.
3393 2014-01-30 Jason Merrill <jason@redhat.com>
3396 * decl2.c (attributes_naming_typedef_ok): New.
3397 * cp-tree.h: Declare it.
3398 * decl.c (grokdeclarator): Check it.
3399 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
3401 2014-01-29 Jason Merrill <jason@redhat.com>
3404 * call.c (add_builtin_candidate): Catch dependent types.
3407 * pt.c (expand_template_argument_pack): Correct
3408 non_default_args_count calculation.
3411 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
3414 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
3415 have a friend template in a class template.
3416 * pt.c (tsubst_friend_function): Look through it.
3417 (push_template_decl_real): A friend member template is
3420 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3423 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
3426 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3429 * pt.c (instantiate_template_1): Check for error_mark_node the second
3432 2014-01-29 Jason Merrill <jason@redhat.com>
3435 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
3436 cdtor_returns_this case.
3439 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
3441 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3444 * semantics.c (finish_omp_reduction_clause): Check type for
3447 2014-01-28 Jason Merrill <jason@redhat.com>
3450 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
3451 (tsubst_copy): Use it if lookup fails.
3454 * pt.c (tsubst_function_type): Make sure we keep the same function
3458 * semantics.c (build_anon_member_initialization): Stop walking
3459 when we run out of COMPONENT_REFs.
3462 * decl.c (lookup_and_check_tag): Ignore template parameters if
3463 scope == ts_current.
3464 * pt.c (check_template_shadow): Don't complain about the injected
3467 * decl.c (duplicate_decls): Tweak.
3470 * mangle.c (write_unqualified_name): Handle operator auto.
3472 2014-01-27 Jason Merrill <jason@redhat.com>
3476 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
3477 list-initialization. A conversion to rvalue ref that involves
3478 an lvalue-rvalue conversion is bad.
3479 (convert_like_real): Give helpful error message.
3482 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
3485 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
3489 * pt.c (template_parm_to_arg): Call convert_from_reference.
3490 (tsubst_template_arg): Don't strip reference refs.
3493 * call.c (build_aggr_conv): Reject value-initialization of reference.
3497 * call.c (convert_like_real): Give helpful error about excess braces
3498 for ck_rvalue of scalar type.
3501 * call.c (reference_binding): Only elide braces if the single
3502 element is reference-related.
3505 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
3509 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
3513 * decl.c (compute_array_index_type): Don't call
3514 maybe_constant_value for a non-integral expression.
3516 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
3518 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
3520 * cp-gimplify.c (cp_genericize): Likewise.
3521 * decl.c (grokfndecl): Likewise.
3522 * parser.c (cp_parser_postfix_expression): Likewise.
3523 (cp_parser_postfix_open_square_expression): Likewise.
3524 (cp_parser_direct_declarator): Likewise.
3525 (is_cilkplus_vector_p): Likewise.
3526 (cp_parser_omp_clause_name): Likewise.
3527 (cp_parser_omp_all_clauses): Likewise.
3528 * pt.c (apply_late_template_attributes): Likewise.
3529 * typeck.c (cp_build_array_ref): Likewise.
3530 (cp_build_compound_expr): Likewise.
3531 (check_return_expr): Likewise.
3533 2014-01-24 Jason Merrill <jason@redhat.com>
3536 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
3541 * typeck2.c (process_init_constructor_array): Don't create
3544 2014-01-24 Jakub Jelinek <jakub@redhat.com>
3546 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
3547 handling for RANGE_ARRAY case.
3549 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
3552 * name-lookup.c (push_using_directive): Use timevar_cond_start.
3554 2014-01-23 Marek Polacek <polacek@redhat.com>
3557 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
3559 2014-01-23 Marek Polacek <polacek@redhat.com>
3562 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
3565 2014-01-23 Jason Merrill <jason@redhat.com>
3568 * cp-tree.h (struct language_function): Add infinite_loop and
3570 (current_function_infinite_loop): New.
3571 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
3572 (break_maybe_infinite_loop): New.
3573 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
3574 (finish_do_stmt, finish_for_cond, finish_for_stmt)
3575 (begin_range_for_stmt): Use them.
3576 * decl.c (finish_function): Don't warn about missing return
3577 if current_function_infinite_loop.
3578 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
3579 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
3581 * call.c (build_op_delete_call): Use make_tree_vector and
3582 release_tree_vector.
3584 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3587 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
3588 nested_name_specifier.
3590 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
3592 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
3593 see if there is an attribute after function decl. If so, then
3595 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
3596 enabled function late parsing.
3597 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
3598 attribute for a SIMD-enabled function.
3599 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
3600 the function is used by SIMD-enabled function (indicated by NULL
3601 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
3602 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
3603 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
3604 vectorlength clause in SIMD-enabled function and #pragma SIMD's
3605 vectorlength clause. Added a new bool parameter to differentiate
3607 (cp_parser_cilk_simd_fn_vector_attrs): New function.
3608 (is_cilkplus_vector_p): Likewise.
3609 (cp_parser_late_parsing_elem_fn_info): Likewise.
3610 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
3611 and "vectorlength" clauses when Cilk Plus is enabled.
3612 (cp_parser_omp_clause_linear): Added a new parameter of type bool
3613 and emit a sorry message when step size is a parameter.
3614 * parser.h (cp_parser::cilk_simd_fn_info): New field.
3615 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
3617 * pt.c (apply_late_template_attributes): Likewise.
3619 2014-01-23 Jakub Jelinek <jakub@redhat.com>
3622 * semantics.c (finish_omp_reduction_clause): Reject
3623 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
3625 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
3628 * parser.c (cp_parser_class_head): Push the class before parsing
3629 the base-clause, pop after it.
3631 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
3633 * decl2.c (cpp_check): Revert prototype change.
3635 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3639 * init.c (build_value_init_noctor): Don't pass error_mark_node to
3642 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3645 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
3646 only when errorcount == 0.
3648 2014-01-17 Marek Polacek <polacek@redhat.com>
3651 * cvt.c (ocp_convert): Don't segfault on non-existing
3652 ENUM_UNDERLYING_TYPE.
3654 2014-01-16 Jason Merrill <jason@redhat.com>
3657 * tree.c (bot_manip): Update the location of builtin_LINE and
3660 2014-01-14 Jason Merrill <jason@redhat.com>
3663 * typeck2.c (massage_init_elt): New.
3664 (process_init_constructor_record)
3665 (process_init_constructor_union): Use it.
3666 (process_init_constructor_array): Use it. Use RANGE_EXPR.
3667 (split_nonconstant_init_1): Handle it.
3668 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
3670 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
3673 * parser.c (cp_parser_postfix_expression): Added a new if-statement
3674 and replaced an existing if-statement with else-if statement.
3675 Changed an existing error message wording to match the one from the C
3678 2014-01-08 Jason Merrill <jason@redhat.com>
3681 * class.c (abi_tag_data): Add tags field.
3682 (check_abi_tags): Initialize it.
3683 (find_abi_tags_r): Support collecting missing tags.
3684 (mark_type_abi_tags): Don't look at template args.
3685 (inherit_targ_abi_tags): New.
3686 (check_bases_and_members): Use it.
3687 * cp-tree.h (ABI_TAG_IMPLICIT): New.
3688 * mangle.c (write_abi_tags): Check it.
3690 2014-01-07 Jason Merrill <jason@redhat.com>
3693 * pt.c (num_innermost_template_parms): New.
3694 (get_underlying_template): Use it.
3697 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
3699 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3701 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
3702 the letter of 20.11.6 about Base and Derived naming the same
3703 class type modulo cv-qualifiers.
3705 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
3708 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
3709 function as unimplemented for generic lambdas with varargs.
3712 * parser.c (cp_parser_template_parameter): Early out with
3713 error_mark_node if parameter declaration was not parsed.
3716 * parser.c (cp_parser_lambda_expression): Save/reset/restore
3717 auto_is_implicit_function_template_parm_p around lambda body.
3720 * parser.c (cp_parser_init_declarator): Undo fully implicit
3721 template parameter list when declarator is not a function.
3723 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
3726 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
3728 2014-01-03 Tobias Burnus <burnus@net-b.de>
3731 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
3733 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3737 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
3738 as include_std to perform_koenig_lookup.
3739 (cp_parser_postfix_expression): Adjust.
3740 * pt.c (tsubst_copy_and_build): Likewise.
3741 * semantics.c (perform_koenig_lookup): Remove bool parameter.
3742 (omp_reduction_lookup): Adjust.
3743 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
3744 (lookup_arg_dependent): Likewise.
3745 (lookup_function_nonclass): Adjust.
3746 * name-lookup.h: Adjust declaration.
3747 * cp-tree.h: Likewise.
3749 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3752 * parser.c (cp_parser_userdef_numeric_literal): Mention
3753 -fext-numeric-literals in the message.
3755 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3758 * call.c (build_conditional_expr_1): Check the return value of
3761 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3763 * call.c (convert_like_real): Check complain.
3765 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3768 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
3771 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3773 Update copyright years
3775 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3777 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
3778 the standard form for the copyright notice.
3780 Copyright (C) 2014 Free Software Foundation, Inc.
3782 Copying and distribution of this file, with or without modification,
3783 are permitted in any medium without royalty provided the copyright
3784 notice and this notice are preserved.