1 2014-11-21 Jason Merrill <jason@redhat.com>
4 * mangle.c (decl_mangling_context): Use template_type_parameter_p.
7 * pt.c (uses_template_parms): Handle null argument.
9 2014-11-21 Jakub Jelinek <jakub@redhat.com>
12 * typeck.c (cp_build_array_ref): Adjust
13 convert_vector_to_pointer_for_subscript caller. If it returns true,
14 call non_lvalue_loc on the result.
16 2014-11-20 Jason Merrill <jason@redhat.com>
19 * pt.c (convert_nontype_argument): Call convert_from_reference.
20 (check_instantiated_arg): Don't be confused by reference refs.
21 (unify): Look through reference refs on the arg, too.
22 * mangle.c (write_template_arg): Look through reference refs.
24 * error.c (dump_expr): Avoid printing (*&i) for references.
26 2014-11-20 Ville Voutilainen <ville.voutilainen@gmail.com>
29 * tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.
31 2014-11-20 Trevor Saunders <tsaunders@mozilla.com>
33 * cp-objcp-common.c: Use hash_table instead of htab.
35 2014-11-19 Jason Merrill <jason@redhat.com>
38 * cp-tree.h (struct processing_template_decl_sentinel): New.
39 * pt.c (instantiate_non_dependent_expr_internal): Split out from...
40 (instantiate_non_dependent_expr_sfinae): Here.
41 (convert_nontype_argument): Use them.
42 * constexpr.c (fold_non_dependent_expr): Use them.
45 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
46 complain yet about a reference.
47 [TARGET_EXPR]: Handle TARGET_EXPR with addr == true.
48 [ADDR_EXPR]: Make sure we don't take the address of a CONSTRUCTOR.
49 (cxx_bind_parameters_in_call): In the new scheme addr is always false.
50 * typeck.c (build_address): Don't take the address of a CONSTRUCTOR.
53 * init.c (decl_really_constant_value): Rename from
54 integral_constant_value.
55 (scalar_constant_value): Similar but limited to scalar results.
56 (decl_constant_value_safe): Remove.
57 (constant_value_1): Respect return_aggregate_cst_ok_p.
58 * typeck.c (decay_conversion): Use scalar_constant_value.
59 * call.c (convert_like_real): Likewise.
60 * cvt.c (ocp_convert): No need to check CLASS_TYPE_P.
61 * typeck.c (decay_conversion): Or ARRAY_TYPE.
62 * constexpr.c (struct constexpr_ctx): Add strict field.
63 (cxx_eval_constant_expression) [VAR_DECL]: Use it to select between
64 decl_constant_value and decl_really_constant_value.
65 (cxx_eval_outermost_constant_expr): Add strict parm.
66 (maybe_constant_init): Not strict.
67 (potential_constant_expression_1): Add strict parm.
68 Shorten most internal calls with RECUR macro.
69 * cp-tree.h, pt.c, semantics.c: Adjust.
71 2014-11-19 Jason Merrill <jason@redhat.com>
74 * constexpr.c (cxx_eval_store_expression): Return init, not *valp.
76 2014-11-19 Paolo Carlini <paolo.carlini@oracle.com>
79 * constexpr.c (constexpr_fn_retval): Accept __func__, __FUNCTION__,
80 and __PRETTY_FUNCTION__.
82 2014-11-18 Jason Merrill <jason@redhat.com>
85 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: A load
86 from a variable of empty class type is constant.
88 * constexpr.c (cxx_eval_statement_list): Handle statement-expressions.
89 (potential_constant_expression_1): Handle STMT_EXPR.
91 * constexpr.c (cxx_eval_constant_expression): Give jump_target a
93 (lots): Omit NULL jump_target arguments.
95 * constexpr.c (struct constexpr_ctx): Add quiet field.
96 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Set it.
97 (lots): Replace allow_non_constant parameter with ctx->quiet.
100 * constexpr.c (cxx_eval_binary_expression): Don't assume the
101 expression was already folded.
102 (cxx_eval_unary_expression): Likewise.
104 2014-11-18 Marc Glisse <marc.glisse@inria.fr>
107 * rtti.c (emit_support_tinfos): Handle __float128.
109 2014-11-18 Jason Merrill <jason@redhat.com>
112 * constexpr.c (cxx_eval_increment_expression): Use POINTER_PLUS_EXPR.
115 * constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
116 rather than VOID_TYPE_P.
118 * pt.c (instantiate_template_1): Use tsubst_aggr_type for context.
121 * typeck2.c (store_init_value): Set it.
122 * cp-tree.h (CONSTRUCTOR_MUTABLE_POISON): New.
123 * constexpr.c (cxx_eval_outermost_constant_expr): Check it.
125 2014-11-17 Jason Merrill <jason@redhat.com>
128 * call.c (build_call_a): Don't warn_deprecated_use here.
129 (build_over_call): Or here.
130 * decl2.c (mark_used): Do it here.
131 (is_late_template_attribute): Attribute deprecated is not deferred.
132 (cplus_decl_attributes): Propagate TREE_DEPRECATED out to the template.
133 * parser.c (cp_parser_template_name): Warn about deprecated template.
134 (cp_parser_template_argument): Likewise.
137 * decl.c (cp_finish_decl): Don't try to process a non-dependent
138 constant initializer for a reference.
139 * pt.c (value_dependent_expression_p): A reference is always
141 * call.c (extend_ref_init_temps_1): Also clear TREE_SIDE_EFFECTS
144 Handle C++14 constexpr flow control.
145 * constexpr.c (cxx_eval_loop_expr, cxx_eval_switch_expr): New.
146 (cxx_eval_statement_list): New.
147 (cxx_eval_constant_expression): Handle LABEL_EXPR,
148 CASE_LABEL_EXPR, GOTO_EXPR, LOOP_EXPR, SWITCH_EXPR. Handle jump
149 semantics of RETURN_EXPR.
150 (many functions): Add jump_target parameter.
151 (returns, breaks, continues, switches, label_matches): New.
152 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): New.
153 * cp-gimplify.c (begin_bc_block): Set them.
155 * cp-gimplify.c (genericize_cp_loop): Use LOOP_EXPR.
156 (genericize_for_stmt): Handle null statement-list.
158 * constexpr.c (use_new_call): Always use new call handling.
160 C++14 constexpr support (minus loops and multiple returns)
161 * constexpr.c (use_new_call): New macro.
162 (build_data_member_initialization): Ignore non-mem-inits.
163 (check_constexpr_bind_expr_vars): Remove C++14 checks.
164 (constexpr_fn_retval): Likewise.
165 (check_constexpr_ctor_body): Do nothing in C++14.
166 (massage_constexpr_body): In C++14 only collect mem-inits.
167 (get_function_named_in_call): Handle null CALL_EXPR_FN.
168 (cxx_bind_parameters_in_call): Build bindings in same order as
169 parameters. Don't treat iniviref parms specially in new call mode.
170 (cxx_eval_call_expression): If use_new_call, do constexpr expansion
171 based on DECL_SAVED_TREE rather than the massaged constexpr body.
172 Set up ctx->object from AGGR_INIT_EXPR_SLOT if we don't have one.
173 (is_sub_constant_expr): Don't mess with ctx.ctor here.
174 (cxx_eval_component_reference): A null element means we're mid-
176 (cxx_eval_store_expression, cxx_eval_increment_expression): New.
177 (cxx_eval_constant_expression): Handle RESULT_DECL, DECL_EXPR,
178 MODIFY_EXPR, STATEMENT_LIST, BIND_EXPR, USING_STMT,
179 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
180 POSTDECREMENT_EXPR. Don't look into DECL_INITIAL of variables in
181 constexpr functions. In new-call mode find parms in the values table.
182 (potential_constant_expression_1): Handle null CALL_EXPR_FN.
183 Handle STATEMENT_LIST, MODIFY_EXPR, MODOP_EXPR, IF_STMT,
184 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
185 POSTDECREMENT_EXPR, BIND_EXPR, WITH_CLEANUP_EXPR,
186 CLEANUP_POINT_EXPR, MUST_NOT_THROW_EXPR, TRY_CATCH_EXPR,
187 EH_SPEC_BLOCK, EXPR_STMT, DECL_EXPR, CASE_LABEL_EXPR, BREAK_STMT,
188 CONTINUE_STMT, USING_STMT, IF_STMT, DO_STMT, FOR_STMT, WHILE_STMT,
189 SWITCH_STMT, ASM_EXPR.
190 (cxx_eval_vec_init_1): Call build_aggr_init_expr.
191 (cxx_eval_indirect_ref): Don't return a CONSTRUCTOR when the
192 caller wants an lvalue.
193 (cxx_eval_outermost_constant_expr): Pull object out of AGGR_INIT_EXPR.
194 (maybe_constant_init): Look through INIT_EXPR.
195 (ensure_literal_type_for_constexpr_object): Set
196 cp_function_chain->invalid_constexpr.
197 * cp-tree.h (struct language_function): Add invalid_constexpr bitfield.
198 * decl.c (start_decl): Set cp_function_chain->invalid_constexpr.
199 (check_for_uninitialized_const_var): Likewise.
200 (maybe_save_function_definition): Check it.
201 * parser.c (cp_parser_jump_statement): Set
202 cp_function_chain->invalid_constexpr.
203 (cp_parser_asm_definition): Likewise.
206 * decl.c (build_ptrmemfunc_type): Don't build a different
207 RECORD_TYPE for a qualified PMF.
208 * cp-tree.h (TYPE_PTRMEMFUNC_FN_TYPE): Merge cv-quals.
209 (TYPE_PTRMEMFUNC_FN_TYPE_RAW): New.
210 * decl2.c (cplus_decl_attributes): Use TYPE_PTRMEMFUNC_FN_TYPE_RAW.
211 * tree.c (cp_walk_subtrees): Likewise.
212 (cp_build_qualified_type_real): Remove special PMF handling.
214 2014-11-15 Jason Merrill <jason@redhat.com>
216 * parser.c (cp_parser_omp_declare_reduction_exprs): A block is not
219 * constexpr.c (cxx_eval_builtin_function_call): Use
220 fold_builtin_call_array.
222 * constexpr.c (cx_check_missing_mem_inits): Clarify error message.
224 2014-11-14 Paolo Carlini <paolo.carlini@oracle.com>
226 * semantics.c (end_maybe_infinite_loop): Use fold_non_dependent_expr.
227 * parser.c (cp_parser_omp_clause_collapse): Likewise.
228 (cp_parser_enumerator_definition): Don't call
229 instantiate_non_dependent_expr...
230 * decl.c (build_enumerator): ... call fold_non_dependent_expr here.
231 * typeck2.c (massage_init_elt): Use fold_non_dependent_expr.
232 * constexpr.c (maybe_constant_value): Allow VIEW_CONVERT_EXPR in
233 the final gcc_assert.
235 * constexpr.c (fold_non_dependent_expr): Add.
236 * cp-tree.h (fold_non_dependent_expr): Declare it.
237 * call.c (null_ptr_cst_p): Use it.
238 * pt.c (tsubst_copy_and_build, build_non_dependent_expr): Likewise.
239 * semantics.c (begin_maybe_infinite_loop): Likewise.
240 * typeck.c (cp_build_binary_op): Likewise.
241 * typeck2.c (check_narrowing): Likewise.
243 * pt.c (fold_non_dependent_expr): Rename to
244 instantiate_non_dependent_expr.
245 (fold_non_dependent_expr_sfinae): Rename to
246 instantiate_non_dependent_expr_sfinae.
247 (convert_nontype_argument, build_non_dependent_expr): Adjust.
248 * decl.c (compute_array_index_type): Likewise.
249 * parser.c (cp_parser_parenthesized_expression_list,
250 cp_parser_enumerator_definition, cp_parser_omp_clause_collapse):
252 * semantics.c (end_maybe_infinite_loop, finish_static_assert):
254 * typeck.c (cxx_alignas_expr): Likewise.
255 * typeck2.c (store_init_value, massage_init_elt): Likewise.
256 * call.c: Adjust comments.
258 * constexpr.c: Likewise.
262 2014-11-14 Jonathan Wakely <jwakely@redhat.com>
264 * mangle.c (find_substitution): Look for abi_tag on class templates.
266 2014-11-13 Bernd Schmidt <bernds@codesourcery.com>
267 Thomas Schwinge <thomas@codesourcery.com>
268 Ilya Verbin <ilya.verbin@intel.com>
269 Andrey Turetskiy <andrey.turetskiy@intel.com>
271 * Make-lang.in (c++.install-common): Do not install for the offload
274 2014-11-13 Kai Tietz <ktietz@redhat.com>
276 * cp-tree.h (cp_build_function_call): Remove prototype.
277 (cp_build_addr_expr_strict): Likewise.
278 (build_typed_address): Likewise.
279 * typeck.c (build_typed_address): Removed.
280 (cp_build_addr_expr_strict): Make static.
281 (cp_build_function_call): Likewise.
283 2014-11-12 Paolo Carlini <paolo.carlini@oracle.com>
287 * cp-tree.h (struct cp_decl_specifier_seq): Add decltype_p bool field.
288 * decl.c (grokdeclarator): Use it.
289 * parser.c (cp_parser_simple_type_specifier): Likewise.
290 * pt.c (tsubst, case DECLTYPE_TYPE): Use tf_ignore_bad_quals.
292 2014-11-11 Paolo Carlini <paolo.carlini@oracle.com>
295 * pt.c (tsubst_copy_and_build, case COND_EXPR): Maybe fold to
296 constant the condition.
298 2014-11-10 Andi Kleen <ak@linux.intel.com>
300 * semantics.c (finish_goto_stmt): Call check_no_cilk.
301 (finish_while_stmt_cond): Dito.
302 (finish_do_stmt): Dito.
303 (finish_for_cond): Dito.
304 (finish_switch_cond): Dito.
306 2014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
308 * typeck.c (cp_build_binary_op): Use OPT_Wshift_count_negative and
309 OPT_Wshift_count_overflow in the warnings.
311 2014-11-09 Jason Merrill <jason@redhat.com>
314 * typeck.c (build_reinterpret_cast_1): reinterpret_cast to the
315 same scalar type is an rvalue.
318 * call.c (build_new_op_1): Don't do non-class lookup for =, -> or [].
320 2014-11-07 Jason Merrill <jason@redhat.com>
323 * pt.c (dependent_alias_template_spec_p): New.
324 (dependent_type_p_r): Handle dependent alias template specialization.
325 (template_args_equal): A dependent alias template specializations
326 is not equal to its underlying type as a template argument.
327 * tree.c (strip_typedefs): Don't strip a dependent alias
330 * parser.c (cp_parser_unqualified_id): Handle __func__ here.
331 (cp_parser_primary_expression): Not here.
333 2014-11-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
336 * decl.c (grokdeclarator): Fix __complex meaning __complex double.
338 2014-10-29 Richard Sandiford <richard.sandiford@arm.com>
340 * constexpr.c: Remove redundant enum from machine_mode.
342 2014-10-28 Jason Merrill <jason@redhat.com>
344 * constexpr.c (cxx_eval_outermost_constant_expr): Tweak.
346 2014-10-28 Andrew MacLeod <amacleod@redhat.com>
348 * call.c: Adjust include files.
357 * semantics.c: Ditto.
359 * vtable-class-hierarchy.c: Ditto.
361 2014-10-24 Jason Merrill <jason@redhat.com>
363 Implement N3653 (Member initializers and aggregates) and fix
364 references to 'this' in constexpr constructors.
365 * class.c (check_field_decls): In C++14 an NSDMI does not make the
367 * constexpr.c (struct constexpr_ctx): New.
368 (cxx_bind_parameters_in_call): Handle 'this'.
369 (cxx_eval_call_expression): Create new constexpr_ctx.
370 (cxx_eval_component_reference): Check CONSTRUCTOR_NO_IMPLICIT_ZERO.
371 (initialized_type, init_subob_ctx, verify_ctor_sanity): New.
372 (cxx_eval_bare_aggregate): Use them. Build CONSTRUCTOR early.
373 (cxx_eval_vec_init_1): Likewise.
374 (cxx_eval_constant_expression) [PARM_DECL]: Allow 'this'.
375 [TARGET_EXPR]: Build new constexpr_ctx.
376 [PLACEHOLDER_EXPR]: New.
377 (cxx_eval_outermost_constant_expr): Build new constexpr_ctx. Add
379 (is_sub_constant_expr): Build new constexpr_ctx.
380 (potential_constant_expression_1): Handle PLACEHOLDER_EXPR.
382 * cp-gimplify.c (cp_gimplify_init_expr): Call replace_placeholders.
383 * cp-tree.h (CONSTRUCTOR_NO_IMPLICIT_ZERO): New.
384 * error.c (dump_expr): Handle PLACEHOLDER_EXPR.
385 * init.c (get_nsdmi): Generate PLACEHOLDER_EXPR.
386 * tree.c (lvalue_kind): Handle PLACEHOLDER_EXPR.
387 (build_ctor_subob_ref, replace_placeholders): New.
388 * typeck2.c (store_init_value): Use replace_placeholders.
389 (process_init_constructor_record): Make zero-init before NSDMI
392 2014-10-27 Andrew MacLeod <amacleod@redhat.com>
394 * cp-gimplify.c: Adjust include files.
396 2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
399 * cp-objcp-common.c: Do not include new.
400 (cxx_initialize_diagnostics): Move from here to ...
401 * error.c (cxx_initialize_diagnostics): : ... here. Move
402 diagnostics initialization here from init_error.
403 (cxx_pp): Use a real pointer not a macro.
404 (init_error): Just initialize cxx_pp.
405 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer): Do
406 not set maximum line length.
408 2014-10-23 Jonathan Wakely <jwakely@redhat.com>
411 * decl2.c (delete_sanity): Use OPT_Wdelete_incomplete in warning.
413 2014-10-21 Paolo Carlini <paolo.carlini@oracle.com>
415 * parser.c (cp_parser_unary_expression): Add default arguments.
416 (cp_parser_cast_expression, cp_parser_sizeof_operand,
417 cp_parser_omp_atomic): Adjust.
419 2014-10-20 Jason Merrill <jason@redhat.com>
422 * lambda.c (current_nonlambda_function): New.
423 * semantics.c (finish_this_expr): Use it.
424 * cp-tree.h: Declare it.
426 2014-10-17 Alan Modra <amodra@gmail.com>
429 * decl.c (merge_decls): Don't merge section name, comdat group or
430 tls model to newdecl symtab node, instead merge to olddecl.
431 Override existing olddecl section name. Set tls_model for all
432 thread-local vars, not just OMP thread-private ones. Remove
435 2014-10-16 Andrew MacLeod <amacleod@redhat.com>
437 * cp-tree.h: Adjust include files.
439 2014-10-15 Jason Merrill <jason@redhat.com>
442 * pt.c (lookup_template_variable): Call coerce_template_parms.
444 2014-10-15 Paolo Carlini <paolo.carlini@oracle.com>
446 * semantics.c (is_instantiation_of_constexpr, literal_type_p,
447 ensure_literal_type_for_constexpr_object,
448 constexpr_fundef_hasher::equal, constexpr_fundef_hasher::hash,
449 retrieve_constexpr_fundef, is_valid_constexpr_fn,
450 build_anon_member_initialization, build_data_member_initialization,
451 check_constexpr_bind_expr_vars, check_constexpr_ctor_body_1,
452 check_constexpr_ctor_body, sort_constexpr_mem_initializers,
453 build_constexpr_constructor_member_initializers, constexpr_fn_retval,
454 massage_constexpr_body, cx_check_missing_mem_inits,
455 register_constexpr_fundef, explain_invalid_constexpr_fn,
456 constexpr_call_hasher::hash, constexpr_call_hasher::equal,
457 maybe_initialize_constexpr_call_table, get_function_named_in_call,
458 get_nth_callarg, lookup_parameter_binding,
459 cxx_eval_builtin_function_call, adjust_temp_type,
460 cxx_bind_parameters_in_call, push_cx_call_context,
461 pop_cx_call_context, cx_error_context, cxx_eval_call_expression,
462 reduced_constant_expression_p, verify_constant,
463 cxx_eval_unary_expression, cxx_eval_binary_expression,
464 cxx_eval_conditional_expression, cxx_eval_array_reference,
465 cxx_eval_component_reference, cxx_eval_bit_field_ref,
466 cxx_eval_logical_expression, base_field_constructor_elt,
467 cxx_eval_bare_aggregate, cxx_eval_vec_init_1, cxx_eval_vec_init,
468 cxx_fold_indirect_ref, cxx_eval_indirect_ref, non_const_var_error,
469 cxx_eval_trinary_expression, var_in_constexpr_fn,
470 cxx_eval_constant_expression, cxx_eval_outermost_constant_expr,
471 is_sub_constant_expr, cxx_constant_value, maybe_constant_value,
472 maybe_constant_init, potential_constant_expression_1,
473 potential_constant_expression, potential_rvalue_constant_expression,
474 require_potential_constant_expression,
475 require_potential_rvalue_constant_expression): Moved definitions...
476 * constexpr.c: ... here, new file.
477 * Make-lang.in: Update.
478 * config-lang.in: Likewise.
480 2014-10-14 Jason Merrill <jason@redhat.com>
483 * parser.c (struct saved_token_sentinel): New.
484 (cp_parser_statement): Use it.
485 (cp_parser_start_tentative_firewall): New.
486 (cp_parser_end_tentative_firewall): New.
487 (cp_parser_lambda_expression): Use them.
488 (cp_parser_statement_expr): New.
489 (cp_parser_primary_expression): Use it.
491 2014-10-14 DJ Delorie <dj@redhat.com>
493 * typeck.c (cp_common_type): Check for all __intN types, not just
495 * decl.c (grokdeclarator): Likewise.
496 * rtti.c (emit_support_tinfos): Check for all __intN types, not just
498 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
499 for all __intN types, not just __int128.
500 (cp_parser_simple_type_specifier): Likewise.
501 * mangle.c (integer_type_codes): Remove int128-specific codes.
502 * cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
503 __intN was specified.
504 * lex.c (init_reswords): Reserve all __intN keywords.
506 2014-10-14 Marc Glisse <marc.glisse@inria.fr>
508 * typeck.c (cp_build_unary_op) [TRUTH_NOT_EXPR]: Accept float vectors.
510 2014-10-13 H.J. Lu <hongjiu.lu@intel.com>
512 * mangle.c (mangle_conv_op_name_for_type): Cast elements to
514 (print_template_statistics): Cast size and elements to long.
516 2014-10-12 Trevor Saunders <tsaunders@mozilla.com>
518 * cp-gimplify.c, cp-tree.h, decl.c, mangle.c, name-lookup.c,
519 pt.c, semantics.c, tree.c, typeck2.c: Use hash_table instead of
522 2014-10-10 Jason Merrill <jason@redhat.com>
525 * class.c (build_base_path): Preserve rvalueness.
526 * call.c (convert_like_real) [ck_base]: Let convert_to_base handle &/*.
527 * rtti.c (build_dynamic_cast_1): Call convert_to_reference later.
530 * method.c (defaulted_late_check): Call maybe_instantiate_noexcept.
532 * method.c (implicitly_declare_fn): Handle deleted lambda default
533 ctor and copy assop here.
534 * class.c (check_bases_and_members): Not here.
535 (add_implicitly_declared_members): And don't set
536 CLASSTYPE_LAZY_MOVE_ASSIGN.
538 * semantics.c (finish_id_expression): Check for error_mark_node.
540 2014-10-09 Jason Merrill <jason@redhat.com>
543 * semantics.c (outer_var_p): Non-static.
544 (process_outer_var_ref): Split out from finish_id_expression.
545 * pt.c (tsubst_copy_and_build): Call them.
546 * cp-tree.h: Declare them.
548 2014-10-09 Paolo Carlini <paolo.carlini@oracle.com>
550 * semantics.c (check_constexpr_ctor_body_1): New.
551 (check_constexpr_ctor_body): Use it; add bool parameter.
552 (build_data_member_initialization): Handle BIND_EXPR and
553 USING_STMT in the main conditional.
554 (build_constexpr_constructor_member_initializers): Do not
555 handle BIND_EXPR here.
556 (constexpr_fn_retval): Handle BIND_EXPR in the switch.
557 (massage_constexpr_body): Don't do it here.
558 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
559 Adjust check_constexpr_ctor_body call.
560 (cp_parser_compound_statement): Do not pedwarn for compound-statement
561 in constexpr function in C++14 mode.
562 * cp-tree.h (check_constexpr_ctor_body): Update declaration.
564 2014-10-09 Jason Merrill <jason@redhat.com>
567 * parser.c (cp_parser_class_head): push_template_decl for members
571 * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
572 (iterative_hash_template_arg): Likewise.
575 * cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF.
576 * semantics.c (force_paren_expr): And set it.
577 * typeck.c (check_return_expr): And handle it.
579 2014-10-09 Marc Glisse <marc.glisse@inria.fr>
581 * decl.c (grokdeclarator): constexpr only implies const in C++11.
583 2014-10-08 Jason Merrill <jason@redhat.com>
586 * pt.c (tsubst_pack_expansion): Limit simple expansion to type packs.
589 * tree.c (build_cplus_array_type): Look for a type with no
590 typedef-name or attributes.
592 * call.c (call_copy_ctor): New.
593 (build_over_call): Use it to avoid infinite recursion on invalid code.
595 2014-10-07 Jason Merrill <jason@redhat.com>
597 * tree.c (cp_tree_equal) [TRAIT_EXPR]: Use cp_tree_equal for type2.
599 2014-10-06 Edward Smith-Rowland <3dw4rd@verizon.net>
601 * cp/parser.c: Allow [[deprecated]] for C++11. Issue a pedwarn.
603 2014-10-06 Paolo Carlini <paolo.carlini@oracle.com>
606 * semantics.c (check_constexpr_bind_expr_vars): New.
607 (check_constexpr_ctor_body, massage_constexpr_body): Use it.
608 (build_constexpr_constructor_member_initializers): Handle
609 BIND_EXPR in the main conditional.
611 2014-10-02 Mark Wielaard <mjw@redhat.com>
614 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
615 (cp_function_decl_deleted_p): New prototype.
616 * cp-objcp-common.c (cp_function_deleted_p): New function.
618 2014-10-03 Marc Glisse <marc.glisse@inria.fr>
623 * typeck.c (cp_build_binary_op): save_expr after convert to save
624 redundant operations.
625 [TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR]: Handle vectors.
626 (cp_build_unary_op) [TRUTH_NOT_EXPR]: Likewise.
628 2014-10-03 Jason Merrill <jason@redhat.com>
630 * decl.c (start_decl): Complain about static/thread_local vars
631 in constexpr function.
632 (check_for_uninitialized_const_var): Also uninitialized vars.
633 * parser.c (cp_parser_jump_statement): And gotos.
634 (cp_parser_asm_operand_list): And asm.
635 (cp_parser_try_block): And try.
636 * semantics.c (ensure_literal_type_for_constexpr_object): And
639 * semantics.c (constexpr_fn_retval): Ignore declarations in C++14.
640 (var_in_constexpr_fn): New.
641 (cxx_eval_constant_expression): Look into DECL_INITIAL.
642 (potential_constant_expression_1): Allow constexpr-local vars.
645 * tree.c (strip_typedefs): Handle TREE_LIST.
647 2014-10-03 Paolo Carlini <paolo.carlini@oracle.com>
649 * parser.c (cp_parser_assignment_expression,
650 cp_parser_constant_expression): Add default arguments.
651 (cp_parser_primary_expression,
652 cp_parser_postfix_open_square_expression,
653 cp_parser_parenthesized_expression_list,
654 cp_parser_question_colon_clause,
655 cp_parser_expression, cp_parser_constant_expression,
656 cp_parser_label_for_labeled_statement, cp_parser_static_assert,
657 cp_parser_template_argument, cp_parser_enumerator_definition,
658 cp_parser_member_declaration, cp_parser_constant_initializer,
659 cp_parser_noexcept_specification_opt, cp_parser_throw_expression,
660 cp_parser_std_attribute_spec, cp_parser_objc_message_args,
661 cp_parser_objc_class_ivars, cp_parser_omp_clause_collapse,
662 cp_parser_omp_clause_aligned, cp_parser_omp_clause_safelen,
663 cp_parser_omp_clause_simdlen, cp_parser_omp_clause_dist_schedule,
664 cp_parser_omp_for_incr, cp_parser_omp_for_loop_init,
665 cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear): Adjust.
667 2014-10-02 Paolo Carlini <paolo.carlini@oracle.com>
670 * cp-tree.h (struct saved_scope): Add noexcept_operand.
671 (cp_noexcept_operand): Define.
672 * call.c (build_over_call): Use it.
673 * parser.c (cp_parser_unary_expression, [RID_NOEXCEPT]): Likewise.
674 * pt.c (tsubst_copy_and_build, [NOEXCEPT_EXPR]): Likewise.
676 2014-10-01 Jason Merrill <jason@redhat.com>
679 * method.c (constructible_expr): Handle value-init of non-class.
680 * parser.c (cp_parser_trait_expr): Allow pack expansion.
681 * pt.c (tsubst_copy_and_build): Handle pack expansion.
684 * class.c (type_has_non_user_provided_default_constructor): Rename
685 from type_has_user_provided_default_constructor, reverse sense.
686 (default_init_uninitialized_part, explain_non_literal_class): Adjust.
687 (check_bases_and_members): Set TYPE_HAS_COMPLEX_DFLT.
688 * call.c (build_new_method_call_1): Adjust.
690 * decl.c (grok_special_member_properties): Don't set
691 TYPE_HAS_COMPLEX_DFLT.
692 * init.c (build_value_init_noctor): Don't use
693 type_has_user_provided_default_constructor.
695 2014-09-30 Jason Merrill <jason@redhat.com>
697 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_ASSIGNABLE and
698 CPTK_IS_TRIVIALLY_CONSTRUCTIBLE.
699 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
700 * parser.c (cp_parser_primary_expression): Likewise.
701 (cp_parser_trait_expr): Likewise. Handle variadic trait.
702 * semantics.c (trait_expr_value): Likewise.
703 (finish_trait_expr): Likewise.
704 (check_trait_type): Handle variadic trait. Return bool.
705 * method.c (build_stub_object): Add rvalue reference here.
706 (locate_fn_flags): Not here.
707 (check_nontriv, assignable_expr, constructible_expr): New.
708 (is_trivially_xible): New.
710 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_COPYABLE.
711 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
712 * parser.c (cp_parser_primary_expression): Likewise.
713 (cp_parser_trait_expr): Likewise.
714 * semantics.c (trait_expr_value): Likewise.
715 (finish_trait_expr): Likewise.
717 * method.c (build_stub_object): Use CONVERT_EXPR.
718 * tree.c (build_dummy_object): Likewise.
719 (is_dummy_object): Adjust.
721 * cp-tree.h (cp_trait_kind): Remove CPTK_IS_CONVERTIBLE_TO.
722 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
723 * semantics.c (trait_expr_value): Likewise.
724 (finish_trait_expr): Likewise.
725 * parser.c (cp_parser_primary_expression): Likewise.
726 (cp_parser_trait_expr): Likewise. Remove redundant grokdeclarator.
728 2014-09-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
731 * error.c (print_instantiation_context): Delete.
732 * typeck2.c (build_x_arrow): Record location when pushing
733 template instantiation.
734 * pt.c (push_tinst_level): Make it a wrapper around ...
735 (push_tinst_level_loc): ... this. New function. Make excessive
736 template instantiation depth a fatal error. Record location. Use
738 (instantiate_pending_templates): Make excessive
739 template instantiation depth a fatal error.
740 (problematic_instantiation_changed): Use bool as return type.
741 * cp-tree.h (print_instantiation_context): Delete.
742 (push_tinst_level): Update declaration.
743 (problematic_instantiation_changed): Likewise.
744 (push_tinst_level_loc): New.
746 2014-09-29 Richard Biener <rguenther@suse.de>
748 * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
751 2014-09-26 Jason Merrill <jason@redhat.com>
753 * mangle.c (find_substitution): Use write_abi_tags.
755 2014-09-25 Marek Polacek <polacek@redhat.com>
758 * class.c (warn_hidden): Check for FUNCTION_DECL.
760 2014-09-25 Jakub Jelinek <jakub@redhat.com>
763 * semantics.c (handle_omp_array_sections_1): Call mark_rvalue_use
764 on low_bound and length.
766 2014-09-24 Aldy Hernandez <aldyh@redhat.com>
768 * class.c, decl.c, optimize.c: Rename all instances of
769 DECL_ABSTRACT to DECL_ABSTRACT_P.
771 2014-09-24 Marek Polacek <polacek@redhat.com>
775 * semantics.c (finish_switch_cond): Call unlowered_expr_type.
776 * tree.c (bot_manip): Add default case.
777 * parser.c (cp_parser_primary_expression): Cast the controlling
778 expression of a switch to an int.
779 (cp_parser_unqualified_id): Likewise.
781 2014-09-23 Paolo Carlini <paolo.carlini@oracle.com>
784 * parser.c (cp_parser_skip_to_closing_square_bracket,
785 cp_parser_array_designator_p): New.
786 (cp_parser_initializer_list): Use the latter.
788 2014-09-22 Jason Merrill <jason@redhat.com>
790 * semantics.c (finish_non_static_data_member): In diagnostic, give
791 error at point of use and note at point of declaration.
796 * lambda.c (maybe_resolve_dummy, lambda_expr_this_capture): Handle
799 2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
802 * pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.
804 2014-09-22 Jason Merrill <jason@redhat.com>
806 * decl.c (poplevel): Don't warn about unused vars in template scope.
807 * error.c (dump_decl): Handle variable templates.
809 2014-09-20 Jason Merrill <jason@redhat.com>
812 * decl.c (begin_destructor_body): Only clobber the as-base part of
815 2014-09-19 Jason Merrill <jason@redhat.com>
818 * mangle.c (write_expression): Use unresolved-name mangling for
822 * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
823 after pulling out an element from a CONSTRUCTOR.
825 2014-09-18 Jakub Jelinek <jakub@redhat.com>
828 * semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
829 on type of type dependent expressions, and don't call it if
830 handle_omp_array_sections has kept TREE_LIST because something
832 * pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
833 Use keep_next_level, begin_omp_structured_block and
834 finish_omp_structured_block instead of push_stmt_list and
837 2014-09-18 Paolo Carlini <paolo.carlini@oracle.com>
840 * class.c (finish_struct_1): Do not -Wnon-virtual-dtor warn
841 for final class types.
843 2014-09-15 Jason Merrill <jason@redhat.com>
845 * pt.c (lookup_template_class_1): Splice out abi_tag attribute if
846 necessary. Call inherit_targ_abi_tags here.
847 * class.c (check_bases_and_members): Not here.
848 (inherit_targ_abi_tags): Check CLASS_TYPE_P.
849 * cp-tree.h: Declare inherit_targ_abi_tags.
851 2014-09-15 Ville Voutilainen <ville.voutilainen@gmail.com>
853 Do not diagnose lambda default arguments in c++14 modes.
854 * parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
857 2014-09-15 Jakub Jelinek <jakub@redhat.com>
859 * Make-lang.in (check_g++_parallelize): Change to just an upper bound
862 2014-09-13 Marek Polacek <polacek@redhat.com>
865 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: Set
866 location of a call expression.
868 2014-09-11 Jason Merrill <jason@redhat.com>
871 * decl.c (start_decl): Handle specialization of member variable
873 * pt.c (check_explicit_specialization): Adjust error.
875 2014-09-11 Paolo Carlini <paolo.carlini@oracle.com>
878 * typeck2.c (process_init_constructor_record): Do not warn about
879 missing field initializer if EMPTY_CONSTRUCTOR_P (init).
881 2014-09-11 Jason Merrill <jason@redhat.com>
884 * pt.c (tsubst_pack_expansion): Simplify substitution into T....
885 (tsubst): Don't throw away PACK_EXPANSION_EXTRA_ARGS.
887 2014-09-10 Jason Merrill <jason@redhat.com>
890 * decl.c (grokfndecl): Don't set DECL_COMDAT on static inlines.
891 (duplicate_decls, start_decl): Likewise.
892 * pt.c (check_explicit_specialization): Likewise.
893 (push_template_decl_real): Or static templates.
895 2014-09-08 Jason Merrill <jason@redhat.com>
897 * typeck.c (build_class_member_access_expr): Move
898 -Winvalid-offsetof code...
899 * semantics.c (finish_offsetof): ...here.
900 * parser.c (cp_parser_builtin_offsetof): Remember the location of
902 * pt.c (tsubst_copy_and_build) [OFFSETOF_EXPR]: Preserve it.
905 * pt.c (instantiate_decl): Handle recursive instantiation of
908 2014-09-05 Jason Merrill <jason@redhat.com>
911 * semantics.c (potential_constant_expression_1): Handle un-folded
912 pointer to member constants.
914 2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de>
917 * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
918 newdecl, not olddecl.
920 2014-09-02 Paolo Carlini <paolo.carlini@oracle.com>
923 * class.c (check_field_decls): A class of literal type cannot have
924 volatile non-static data members and base classes.
925 (explain_non_literal_class): Update.
927 2014-09-02 Jakub Jelinek <jakub@redhat.com>
928 Balaji V. Iyer <balaji.v.iyer@intel.com>
929 Igor Zamyatin <igor.zamyatin@intel.com>
931 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
933 * parser.c (cp_parser_cilk_for): New function.
934 (cp_parser_cilk_grainsize): Likewise.
935 (cp_parser_statement): Added RID_CILK_FOR case.
936 (cp_parser_omp_for_cond): Added CILK_FOR check.
937 (cp_parser_omp_for_loop_init): Change function argument to accept
938 tree_code instead just a bool flag; change the check to use that
939 tree_code; check for initialization declaration in case of Cilk_for.
940 (cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
941 changed call to cp_parser_omp_for_loop_init according new arguments'
943 (cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
944 * pt.c (tsubst_expr): Added CILK_FOR case.
945 * semantics.c: Include convert.h.
946 (finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
947 case; added OMP_CLAUSE__CILK_FOR_COUNT_.
948 (handle_omp_for_class_iterator): New argument lastp and its usage;
950 (finish_omp_for): Changed call to handle_omp_for_class_iterator
951 according new arguments' list; in case of Cilk_for save very first
952 decl and create empty stmt_list block; use block to build correct
955 2014-08-31 Jason Merrill <jason@redhat.com>
958 * optimize.c (cdtor_comdat_group): Just look at the
959 DECL_ASSEMBLER_NAME of the 'tors.
961 2014-08-27 Paolo Carlini <paolo.carlini@oracle.com>
964 * semantics.c (cxx_eval_call_expression): Use STRIP_NOPS on the
965 result of cxx_eval_constant_expression.
967 2014-08-26 Jason Merrill <jason@redhat.com>
970 * pt.c (tsubst_decl) [VAR_DECL]: Copy TLS model.
971 (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
972 * semantics.c (finish_id_expression): Don't call TLS wrapper in a
975 2014-08-25 Jason Merrill <jason@redhat.com>
977 * pt.c (check_explicit_specialization): Don't complain about
978 non-template variable.
979 (template_for_substitution): Allow variable templates.
980 (check_template_variable): Fix logic for member var template.
981 * decl.c (start_decl): Don't complain about extra template header
984 * decl.c (start_decl): Look through member variable template.
985 * pt.c (tsubst_decl) [VAR_DECL]: Handle member variable templates.
986 * decl2.c (grokfield): Set DECL_CONTEXT earlier on
989 2014-08-25 Paolo Carlini <paolo.carlini@oracle.com>
992 * cp-tree.h (TFF_POINTER): Add.
993 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): Forward the third
995 * error.c (dump_type_suffix): Actually print the const and noreturn
996 attribute when appropriate.
998 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1000 * decl.c (compute_array_index_type, grokdeclarator,
1001 undeduced_auto_decl): Change from cxx1y to cxx14.
1002 *lambda.c(add_capture()): Change error message from C++1y to C++14.
1003 * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
1004 cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
1005 cp_parser_decltype, cp_parser_conversion_type_id,
1006 cp_parser_simple_type_specifier, cp_parser_type_id_1,
1007 cp_parser_template_type_arg, cp_parser_std_attribute,
1008 cp_parser_template_declaration_after_export): Ditto.
1009 * pt.c (tsubst): Ditto.
1010 * semantics.c (force_paren_expr, finish_decltype_type): Ditto.
1011 * tree.c: Change comment.
1012 * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
1013 cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
1015 2014-08-23 Jason Merrill <jason@redhat.com>
1017 Allow non-constexpr variable templates.
1018 * decl2.c (note_variable_template_instantiation): New.
1019 * cp-tree.h: Declare it.
1020 * pt.c (instantiate_decl): Call it.
1021 (push_template_decl_real): Allow non-constexpr variable templates.
1022 * semantics.c (finish_id_expression): Mark the variable template
1023 instantiation as used.
1024 * mangle.c (write_mangled_name): Variable template instantiations
1026 * parser.c (cp_parser_init_declarator): Complain about
1027 non-function implicit templates.
1029 2014-08-22 Marek Polacek <polacek@redhat.com>
1032 * parser.c (cp_parser_binary_expression): Check each LHS if it's
1033 preceded with logical not. Adjust call to
1034 warn_logical_not_parentheses.
1036 2014-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1039 * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
1040 declaration shadows a function declaration, unless the former
1041 declares a function, pointer to function or pointer to member
1042 function, because this is a common and valid case in real-world
1044 * cp-tree.h (TYPE_PTRFN_P,TYPE_REFFN_P,TYPE_PTRMEMFUNC_P):
1045 Improve description.
1047 2014-08-22 Jason Merrill <jason@redhat.com>
1050 * class.c (outermost_open_class): Fix logic.
1051 * decl.c (complete_vars): Fix logic.
1053 2014-08-22 Jason Merrill <jason@redhat.com>
1056 * class.c (outermost_open_class): New.
1057 * cp-tree.h: Declare it.
1058 * decl.c (maybe_register_incomplete_var): Use it.
1059 (complete_vars): Handle any constant variable.
1060 * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
1062 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
1065 * cp-array-notation.c (build_array_notation_ref): Added correct
1066 handling of case with incorrect array.
1068 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1071 * error.c (cp_diagnostic_finalizer): Delete.
1072 (init_error): Do not set diagnostic_finalizer here.
1074 2014-08-19 Marek Polacek <polacek@redhat.com>
1077 * call.c (build_new_op_1): Remember the type of arguments for
1078 a comparison. If either operand of a comparison is a boolean
1079 expression, call maybe_warn_bool_compare.
1081 2014-08-19 Jason Merrill <jason@redhat.com>
1083 PR tree-optimization/62091
1084 * decl2.c (decl_needed_p): Return true for virtual functions when
1089 * decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
1092 2014-08-19 Gerald Pfeifer <gerald@pfeifer.com>
1094 * class.c (contains_empty_class_p): Remove.
1096 2014-08-18 Paolo Carlini <paolo.carlini@oracle.com>
1098 * parser.c (cp_parser_expression): Add default arguments.
1099 (cp_parser_primary_expression, cp_parser_postfix_expression,
1100 cp_parser_array_notation, cp_parser_postfix_open_square_expression,
1101 cp_parser_unary_expression, cp_parser_direct_new_declarator,
1102 cp_parser_question_colon_clause, cp_parser_assignment_operator_opt,
1103 cp_parser_lambda_body, cp_parser_expression_statement,
1104 cp_parser_condition, cp_parser_c_for, cp_parser_range_for,
1105 cp_parser_iteration_statement, cp_parser_jump_statement,
1106 cp_parser_decltype_expr, cp_parser_noexcept_specification_opt,
1107 cp_parser_asm_operand_list, cp_parser_objc_message_receiver,
1108 cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement,
1109 cp_parser_omp_var_list_no_open, cp_parser_omp_clause_num_threads,
1110 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
1111 cp_parser_omp_clause_linear, cp_parser_omp_clause_device,
1112 cp_parser_omp_atomic, cp_parser_omp_for_loop_init,
1113 cp_parser_omp_for_loop, cp_parser_omp_declare_reduction_exprs,
1114 cp_parser_transaction_expression): Adjust.
1116 2014-08-15 Jason Merrill <jason@redhat.com>
1119 * pt.c (lookup_template_class_1): Revert recent change.
1120 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Revert recent change.
1123 * pt.c (instantiate_class_template_1): Ignore lambda on
1124 CLASSTYPE_DECL_LIST.
1125 (push_template_decl_real): A lambda is not primary.
1126 (lookup_template_class_1): Don't look for a lambda partial
1128 * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
1129 currently in a function and the lambda living in a function.
1130 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
1132 2014-08-15 Richard Biener <rguenther@suse.de>
1133 Jason Merrill <jason@redhat.com>
1136 * tree.c (build_min_array_type, set_array_type_canon): Split out...
1137 (build_cplus_array_type): ...from here. Only call build_array_type
1140 2014-08-15 Paolo Carlini <paolo.carlini@oracle.com>
1144 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1148 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1149 cv-qualifiers of function types.
1151 2014-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1153 * call.c (build_conditional_expr_1): Use OPT_Wextra in warning.
1155 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1157 * typeck.c (composite_pointer_type, cxx_sizeof_or_alignof_type,
1158 cp_build_array_ref, cp_build_function_call_vec): When a
1159 pedwarn is suppressed under SFINAE, return error_mark_node.
1161 * typeck.c (cxx_sizeof_or_alignof_type): Fix complain &
1162 tf_warning_or_error, where complain is a bool, glitch.
1164 2014-08-14 Ville Voutilainen <ville.voutilainen@gmail.com>
1167 * decl.c (grokdeclarator): Move the check for friend initializers..
1168 * decl2.c (grokfield) ..here. Postpone early return for friends
1169 until after the initializer check.
1171 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1174 * pt.c (coerce_template_parms): Improve error message vs default
1177 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1179 * parser.c (cp_parser_init_declarator): Remove redundant check of
1180 decl_specifiers->type.
1182 2014-08-13 Jason Merrill <jason@redhat.com>
1184 * call.c (build_x_va_arg): Support passing non-POD through ....
1185 (convert_arg_to_ellipsis): Likewise.
1187 2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
1189 * pt.c (lookup_template_variable): Make dependent variable templates
1192 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1194 * parser.c (cp_parser_elaborated_type_specifier): Handle
1195 specially cp_parser_template_id returning a BASELINK.
1197 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1199 * parser.c (cp_parser_diagnose_invalid_type_name,
1200 cp_parser_make_typename_type): Remove scope parameter.
1201 (cp_parser_parse_and_diagnose_invalid_type_name,
1202 cp_parser_elaborated_type_specifier): Adjust calls.
1204 2014-08-12 Ville Voutilainen <ville.voutilainen@gmail.com>
1206 Reject virt-specifiers on friends and member templates
1207 * friend.c (do_friend): Diagnose virt-specifiers.
1208 * pt.c (push_template_decl_real): Diagnose virt-specifiers.
1210 2014-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1212 * typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
1213 return type to bool; in C++11 for constants give errors, not pedwarns.
1214 * cp-tree.h (check_narrowing): Adjust declaration.
1215 * call.c (convert_like_real): Update calls.
1216 * semantics.c (finish_compound_literal): Likewise.
1218 2014-08-08 Jason Merrill <jason@redhat.com>
1220 * pt.c (lookup_template_class_1): Copy abi_tag.
1222 2014-08-08 Kai Tietz <ktietz@redhat.com>
1224 * semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
1225 that we operate on a true inline.
1227 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1229 * class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
1230 optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
1232 2014-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1235 * decl.c (build_enumerator): Handle class types with conversion
1236 operators via perform_implicit_conversion_flags and
1237 build_expr_type_conversion.
1239 * cvt.c (build_expr_type_conversion): Replace pair of errors
1240 with error + inform.
1242 2014-08-07 Jason Merrill <jason@redhat.com>
1245 * parser.c (c_parse_file): Change sorry to fatal_error.
1248 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
1250 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1252 * cp-tree.h, pt.c: Use hash_map instead of pointer_map.
1254 2014-08-06 Jason Merrill <jason@redhat.com>
1256 * init.c (build_vec_init): Fix constant initialization of
1258 (build_value_init_noctor): Call maybe_constant_init.
1259 * semantics.c (maybe_constant_init): See through EXPR_STMT and
1263 * init.c (build_vec_init): Reorganize earlier change a bit.
1266 * init.c (build_vec_init): Leave atype an ARRAY_TYPE
1267 if we're just returning an INIT_EXPR.
1269 2014-08-06 Jason Merrill <jason@redhat.com>
1270 Braden Obrzut <admin@maniacsvault.net>
1272 * pt.c (check_explicit_specialization): Don't test
1273 DECL_DECLARED_INLINE_P for a variable template.
1275 2014-08-06 Paolo Carlini <paolo.carlini@oracle.com>
1278 * typeck.c (cp_build_binary_op): Extend to more cases the
1281 2014-08-01 Braden Obrzut <admin@maniacsvault.net>
1283 Implement constexpr variable templates
1284 * decl.c (grokvardecl): Handle specializations of variable templates.
1285 (grokdeclarator): Handle variable template id expressions and NULL_TREE
1286 return from grokvardecl.
1287 * decl2.c (check_member_template): Allow declaration of template member
1289 * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for
1291 * pt.c (check_template_variable): Accept variable temploids at
1293 (push_template_decl_real): The current instantiation of a template
1295 (determine_specialization): Accept variable templates.
1296 (check_explicit_specialization): Handle and check for malformed
1297 variable template specializations.
1298 (lookup_template_variable): New.
1299 (tsubst_decl): Handle variable template specializations.
1300 (do_decl_instantiation): Handle template variables.
1301 (instantiate_decl): Handle template variables.
1302 * semantics.c (finish_template_variable): New.
1303 (finish_id_expression): Instantiate variable templates.
1304 * cp-tree.h (variable_template_p): New.
1306 2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1309 * decl.c (check_redeclaration_no_default_args): New.
1310 (duplicate_decls): Use it, handle default arguments
1311 in redeclarations of function templates.
1313 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1315 * optimize.c, semantics.c: Use hash_map instead of pointer_map.
1317 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1319 * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
1320 method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
1321 instead of pointer_set.
1323 2014-08-01 Jason Merrill <jason@redhat.com>
1326 * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
1327 init-list for trailing elements.
1328 * typeck2.c (process_init_constructor_array): Likewise.
1330 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1333 * decl.c (duplicate_decls): Handle static member functions too.
1335 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1337 * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
1340 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1343 * parser.c (cp_parser_array_notation): Added check for array_type.
1345 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1348 * cp-array-notation.c (expand_array_notation_exprs): Handling of
1349 DECL_EXPR improved. Changed handling for INIT_EXPR.
1351 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1353 * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P.
1355 2014-08-01 Jakub Jelinek <jakub@redhat.com>
1357 * cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
1358 -fsanitize=alignment call ubsan_maybe_instrument_reference
1359 for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
1360 for calls to member functions.
1362 2014-07-31 Marc Glisse <marc.glisse@inria.fr>
1365 * typeck.c (maybe_warn_about_returning_address_of_local): Return
1366 whether it is returning the address of a local variable.
1367 (check_return_expr): Return 0 instead of the address of a local
1370 2014-07-30 Jason Merrill <jason@redhat.com>
1374 * pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
1376 2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1379 * pt.c (unify_arity): Add boolean parameter.
1380 (unify_too_few_arguments): Likewise.
1381 (type_unification_real): Diagnose correctly insufficient
1382 arguments in the presence of trailing variadic parameters;
1383 deducing multiple trailing packs as empty is fine.
1385 2014-07-30 Jason Merrill <jason@redhat.com>
1390 * decl2.c (mark_all_virtuals): New variable.
1391 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1392 (cp_write_global_declarations): Set it and give helpful diagnostic
1393 if it introduces errors.
1394 * class.c (finish_struct_1): Check it.
1398 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
1399 (check_explicit_specialization): Clear it on specializations.
1400 * decl.c (duplicate_decls, start_decl): Likewise.
1401 (grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
1402 * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
1403 linkage after setting the appropriate flags.
1404 * tree.c (decl_linkage): Don't check DECL_COMDAT.
1405 * decl2.c (mark_needed): Mark clones.
1406 (import_export_decl): Not here.
1408 2014-07-25 Edward Smith-Rowland <3dw4rd@verizon.net>
1410 Implement N4051 - Allow typename in a template template parameter
1411 * parser.c (cp_parser_type_parameter_key): New funtion;
1412 (cp_parser_token_is_type_parameter_key): Ditto;
1413 (cp_parser_type_parameter): Look for type-parameter-key for all versions
1414 but pedwarn for less than cxx1z.
1416 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1419 * call.c (standard_conversion): Use resolve_nondeduced_context
1420 for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
1422 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1425 * parser.c (cp_parser_tokens_start_cast_expression): Return -1
1428 2014-07-15 Jason Merrill <jason@redhat.com>
1431 * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
1435 * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
1436 * class.c (finish_struct): Reject invalid definition of
1437 std::initializer_list.
1439 2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
1441 * call.c (convert_like_real): Call print_z_candidate and inform only
1442 if permerror returns true.
1444 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
1446 * class.c (build_clone): Do not clear assembler names of
1448 * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
1449 * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
1450 as a special case return sizeof (struct tree_decl_non_common)
1452 (cp_common_init_ts): Do not initialize NAMESPACE_DECL;
1453 initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
1454 * cp/cp-tree.h (tree_template_decl): New structure.
1455 (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
1456 (union cp_lang_tree_node): Add template_decl.
1457 (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
1459 2014-07-14 Jason Merrill <jason@redhat.com>
1463 * pt.c (instantiate_decl): Don't check defer_ok for local class
1466 2014-07-14 Jakub Jelinek <jakub@redhat.com>
1469 * cp-tree.h (LITERAL_ZERO_P): Define.
1470 * parser.c (cp_parser_parenthesized_expression_list): Add
1471 want_literal_zero_p argument, if true, for literal zeros
1472 insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
1473 (cp_parser_postfix_expression): Adjust
1474 cp_parser_parenthesized_expression_list caller, handle
1475 -Wmemset-transposed-args.
1476 (literal_zeros): New variable.
1478 2014-07-13 Jason Merrill <jason@redhat.com>
1481 * semantics.c (is_instantiation_of_constexpr): Return true for
1482 defaulted functions, too.
1483 (explain_invalid_constexpr_fn): Only use
1484 explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P.
1485 * method.c (explain_implicit_non_constexpr): Pass
1486 DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr.
1489 * decl.c (check_initializer): Don't finish_compound_literal
1490 on erroneous constexpr init.
1493 * tree.c (bot_replace): Only replace a dummy 'this' parm.
1496 * decl.c (create_array_type_for_decl): Only check for auto once.
1499 * call.c (build_list_conv): Don't try to build a list of references.
1501 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
1503 PR C++/60209 - Declaration of user-defined literal operator cause error
1504 * parser.c (cp_parser_operator): Fold treatment of strings
1505 and user-defined string literals. Use the full string parser.
1506 (cp_parser_string_literal): Add flag to not look for literal operator.
1508 2014-07-11 Jason Merrill <jason@redhat.com>
1512 * call.c (build_conditional_expr_1): Avoid reading freed memory.
1514 2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
1517 * call.c (build_user_type_conversion_1): Copy LOOKUP_NO_NARROWING
1519 * decl.c (check_initializer): Don't call check_narrowing here,
1520 set LOOKUP_NO_NARROWING.
1521 * typeck2.c (digest_init_r): Likewise.
1523 2014-07-10 Jason Merrill <jason@redhat.com>
1526 * semantics.c (reduced_constant_expression_p): Handle CONSTRUCTOR.
1530 * decl2.c (mark_all_virtuals): New variable.
1531 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1532 (cp_write_global_declarations): Set it and give helpful diagnostic
1533 if it introduces errors.
1534 * class.c (finish_struct_1): Check it.
1535 * decl.c (grokdeclarator): Clear virtualp after 'virtual auto' error.
1537 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1540 * decl.c (grokdeclarator): Adjust error messages about 'explicit'
1541 outside class declaration, in friend declaration, and neither on
1542 constructor nor conversion operator.
1544 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1548 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1549 cv-qualifiers of function types.
1551 2014-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
1552 Paolo Carlini <paolo.carlini@oracle.com>
1555 * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
1558 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
1560 * class.c (check_for_override): Wrap the 'final' and 'override'
1561 keywords in %< and %>.
1563 2014-07-06 Marek Polacek <polacek@redhat.com>
1566 * cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
1567 * decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
1568 * typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
1571 2014-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1573 * pt.c (convert_template_argument): Use inform instead of error in
1576 2014-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1581 * parser.c (cp_parser_userdef_string_literal): Take a tree
1583 (cp_parser_string_literal): Don't hack the token stream.
1585 2014-06-30 Jason Merrill <jason@redhat.com>
1589 * decl2.c (maybe_emit_vtables): Mark all vtable entries if
1591 * init.c (build_vtbl_address): Don't mark destructor.
1592 * class.c (finish_struct_1): Add all classes to keyed_classes
1596 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
1599 * mangle.c (decl_mangling_context): Look through a TEMPLATE_DECL.
1601 * decl.c (build_ptrmemfunc_type): Don't give a PMF RECORD_TYPE
1602 TYPE_BINFO or TYPE_LANG_SPECIFIC.
1603 * cp-tree.h (TYPE_PTRMEMFUNC_FLAG): Use TYPE_LANG_FLAG_2.
1604 (TYPE_PTRMEMFUNC_P): Don't expect TYPE_LANG_SPECIFIC.
1605 * typeck.c (build_ptrmemfunc_access_expr): Don't use lookup_member.
1606 * pt.c (unify): Also check whether the argument is a PMF.
1608 2014-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1611 * parser.c (cp_parser_tokens_start_cast_expression): In C++11
1612 a '[' can also start a primary-expression.
1613 (cp_parser_cast_expression): Parse a cast-expression only tentatively
1614 when cp_parser_tokens_start_cast_expression returns -1.
1616 2014-06-30 Jason Merrill <jason@redhat.com>
1619 * pt.c (unify_one_argument): Type/expression mismatch just causes
1622 * semantics.c (simplify_aggr_init_expr): Remove remnants of
1625 2014-06-30 Marek Polacek <polacek@redhat.com>
1627 * cp-gimplify.c (cp_genericize): Don't instrument returns if the
1628 function has no_sanitize_undefined attribute.
1629 * decl.c (compute_array_index_type): Don't instrument VLAs if the
1630 function has no_sanitize_undefined attribute.
1632 2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
1635 * cp-array-notation.c (expand_sec_reduce_builtin):
1636 Check that bultin argument is correct.
1637 * call.c (build_cxx_call): Check for 0 arguments in builtin call.
1639 2014-06-28 Jonathan Wakely <jwakely@redhat.com>
1643 * typeck.c (check_return_expr): Lookup as an rvalue even when the
1644 types aren't the same.
1646 2014-06-27 Jason Merrill <jason@redhat.com>
1649 * error.c (dump_template_bindings): Don't tsubst in a clone.
1651 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1654 * semantics.c (finish_compound_literal): Revert r204228.
1656 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1658 * parser.c (cp_parser_compound_literal_p): New.
1659 (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it.
1661 2014-06-26 Jason Merrill <jason@redhat.com>
1663 * parser.c (cp_parser_for_init_statement): Change range-for error
1666 N3994 Ranged-based for-loops: The Next Generation
1667 * parser.c (cp_lexer_nth_token_is): New.
1668 (cp_parser_for_init_statement): Allow "for (id : init)".
1670 2014-06-26 Teresa Johnson <tejohnson@google.com>
1672 * class.c (dump_class_hierarchy): Use saved dump files.
1673 (dump_vtable): Ditto.
1676 2014-06-26 Adam Butcher <adam@jessamine.co.uk>
1679 * parser.c (cp_parser_elaborated_type_specifier): Only consider template
1680 parameter lists outside of function parameter scope.
1682 2014-06-25 Paolo Carlini <paolo.carlini@oracle.com>
1686 * typeck2.c (process_init_constructor_record): Do not complain about
1687 uninitialized const members, because within aggregate-initialization,
1688 members without explicit initializers are value-initialized.
1690 2014-06-25 Jakub Jelinek <jakub@redhat.com>
1692 * semantics.c (finish_omp_clauses): Make sure
1693 OMP_CLAUSE_LINEAR_STEP has correct type.
1695 2014-06-24 Jan Hubicka <hubicka@ucw.cz>
1697 * class.c (check_methods, create_vtable_ptr, determine_key_method,
1698 add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by
1699 FUNCTION_DECL check.
1700 * cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
1701 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
1702 (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
1703 (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
1705 2014-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1708 * decl.c (grokdeclarator): Do not early check for operator-function-id
1711 2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
1713 * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
1716 2014-06-24 Jakub Jelinek <jakub@redhat.com>
1718 * parser.c (cp_parser_omp_for_loop): For
1719 #pragma omp parallel for simd move lastprivate clause from parallel
1720 to for rather than simd.
1722 2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
1726 * decl.c (grokparms): Accept a single parameter of type 'void'.
1728 2014-06-20 Jason Merrill <jason@redhat.com>
1731 * call.c (add_function_candidate): Avoid special 'this' handling
1732 if we have a ref-qualifier.
1735 * call.c (build_over_call): Call build_this in template path.
1737 2014-06-19 Jason Merrill <jason@redhat.com>
1740 * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
1742 2014-06-18 Jason Merrill <jason@redhat.com>
1745 * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
1746 ref-qualifier handling.
1749 * pt.c (resolve_overloaded_unification): Preserve
1750 ARGUMENT_PACK_EXPLICIT_ARGS.
1752 2014-06-18 Jakub Jelinek <jakub@redhat.com>
1754 * cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
1756 * cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
1758 2014-06-17 Jason Merrill <jason@redhat.com>
1761 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
1763 2014-06-15 Jason Merrill <jason@redhat.com>
1766 * pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
1769 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
1771 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1773 * decl.c (grokvardecl): Fix pasto in previous patch.
1775 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1777 * decl.c (duplicate_decls): Use set_decl_tls_model.
1778 (grokdeclarator): Likewise.
1779 * semantics.c (finish_id_expression): Check TLS only for
1781 (finish_omp_threadprivate): Use decl_default_tls_model.
1782 * decl2.c (get_guard): Likewise.
1783 * call.c (make_temporary_var_for_ref_to_temp): Likewise.
1785 2014-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1788 * decl.c (grokparms): Improve error message about void parameters.
1789 * error.c (type_to_string): Fix aka cut off code.
1791 2014-06-12 Jason Merrill <jason@redhat.com>
1793 * call.c (convert_arg_to_ellipsis): Use abi_version_crosses.
1794 * cvt.c (type_promotes_to): Likewise.
1795 * mangle.c (write_type, write_expression): Likewise.
1796 (write_name, write_template_arg): Likewise.
1797 (mangle_decl): Make alias based on flag_abi_compat_version.
1798 Emit -Wabi warning here.
1799 (finish_mangling_internal): Not here. Drop warn parm.
1800 (finish_mangling_get_identifier, finish_mangling): Adjust.
1801 (mangle_type_string, mangle_special_for_type): Adjust.
1802 (mangle_ctor_vtbl_for_type, mangle_thunk): Adjust.
1803 (mangle_guard_variable, mangle_tls_init_fn): Adjust.
1804 (mangle_tls_wrapper_fn, mangle_ref_init_variable): Adjust.
1806 * call.c (build_operator_new_call): Remove -fabi-version=1 support.
1807 * class.c (walk_subobject_offsets, include_empty_classes): Likewise.
1808 (layout_nonempty_base_or_field, end_of_class): Likewise.
1809 (layout_empty_base, build_base_field, layout_class_type): Likewise.
1810 (is_empty_class, add_vcall_offset_vtbl_entries_1): Likewise.
1811 (layout_virtual_bases): Likewise.
1812 * decl.c (compute_array_index_type): Likewise.
1813 * mangle.c (write_mangled_name, write_prefix): Likewise.
1814 (write_template_prefix, write_integer_cst, write_expression): Likewise.
1815 (write_template_arg, write_array_type): Likewise.
1816 * method.c (lazily_declare_fn): Likewise.
1817 * rtti.c (get_pseudo_ti_index): Likewise.
1818 * typeck.c (comp_array_types): Likewise.
1820 2014-06-11 Jan Hubicka <hubicka@ucw.cz>
1822 * vtable-class-hierarchy.c: Update handling for section names
1823 that are no longer trees.
1824 * decl.c (duplicate_decls): Likewise.
1826 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1829 * parser.c (cp_parser_init_declarator): Actually pass friend_p
1830 to cp_parser_declarator.
1832 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1835 * parser.c (cp_parser_using_declaration): Handle unscoped enums.
1836 * name-lookup.c (validate_nonmember_using_decl): Adjust error
1839 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1842 * parser.c (cp_parser_declarator): Add bool parameter.
1843 (cp_parser_direct_declarator): Likewise, use it.
1844 (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
1845 (cp_parser_condition, cp_parser_explicit_instantiation,
1846 cp_parser_init_declarator, cp_parser_type_id_1,
1847 cp_parser_parameter_declaration, cp_parser_exception_declaration,
1848 cp_parser_cache_defarg, cp_parser_objc_class_ivars,
1849 cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
1851 * decl.c (grokdeclarator): Fix handling of friend declared in
1852 namespace scope (g++.dg/parse/friend10.C).
1854 2014-06-10 Jan Hubicka <hubicka@ucw.cz>
1856 * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)
1858 * optimize.c (cdtor_comdat_group): Fix handling of aliases.
1859 (maybe_clone_body): Move symbol across comdat groups.
1860 * method.c (use_thunk): Copy implicit section flag.
1862 2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1865 * name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
1867 2014-06-07 Jan Hubicka <hubicka@ucw.cz>
1869 * method.c (use_thunk): Use set_decl_section_name.
1870 * optimize.c (maybe_clone_body): Use set_decl_section_name.
1871 * decl.c (duplicate_decls): Likewise.
1872 * vtable-class-hierarchy.c: Likewise.
1874 2014-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1877 * class.c (check_field_decls): In C++11 mode do not reject
1878 static data members and reference-type members in unions.
1880 2014-06-05 Jason Merrill <jason@redhat.com>
1883 * decl.c (check_initializer): Collapse a TREE_LIST here.
1884 * typeck2.c (store_init_value): Not here.
1886 2014-06-05 Richard Biener <rguenther@suse.de>
1887 Paolo Carlini <paolo.carlini@oracle.com>
1890 * cp-gimplify.c (cp_gimplify_expr, [MODIFY_EXPR]): Rework
1891 handling of empty classes.
1893 2014-06-04 Jason Merrill <jason@redhat.com>
1895 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
1896 for noexcept and thread_local, too.
1899 * decl.c (check_initializer): Maybe clear
1900 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1902 2014-06-05 Richard Biener <rguenther@suse.de>
1905 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
1906 warnings for accessing empty classes.
1908 2014-06-05 Marek Polacek <polacek@redhat.com>
1911 * parser.c (cp_parser_binary_expression): Warn when logical not is
1912 used on the left hand side operand of a comparison.
1914 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1917 * typeck.c (cp_build_modify_expr): Handle array of characters
1918 initialized by a string literal.
1919 * decl.c (check_initializer): Handle parenthesized string literal
1921 * typeck2.c (store_init_value): Remove redundant check.
1923 2014-06-04 Jason Merrill <jason@redhat.com>
1927 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
1928 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
1930 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
1933 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
1936 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1940 * call.c (standard_conversion): Convert nullptr to bool only
1941 in case of direct-initialization.
1942 (convert_like_real): Provide informative error message.
1944 2014-06-03 Marek Polacek <polacek@redhat.com>
1947 * semantics.c (finish_switch_cond): Warn if switch condition has
1950 2014-06-03 Jason Merrill <jason@redhat.com>
1953 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
1954 variable to local_specializations.
1957 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
1959 2014-06-02 Jason Merrill <jason@redhat.com>
1962 * decl.c (reshape_init_class): Handle un-folded
1963 constant-expressions.
1966 * pt.c (pack_deducible_p): Handle canonicalization.
1968 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1970 * pt.c (tsubst_function_type): Initialize arg_types.
1972 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
1975 * class.c (handle_using_decl): Pass the correct scope to
1976 cp_emit_debug_info_for_using.
1978 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
1982 * search.c (accessible_p): Use current_nonlambda_class_type.
1983 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1985 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
1987 * decl.c: Include builtins.h.
1988 * semantics.c: Likewise.
1990 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1994 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
1995 * pt.c (tsubst_function_type): Inject the this parameter; do the
1996 substitutions in the order mandated by the DR.
1997 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
1998 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
1999 (static_fn_type): Copy it.
2000 * decl2.c (build_memfn_type, change_return_type,
2001 cp_reconstruct_complex_type): Likewise.
2002 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
2003 * tree.c (strip_typedefs): Likewise.
2004 * typeck.c (merge_types): Likewise.
2006 2014-05-30 Jason Merrill <jason@redhat.com>
2009 * pt.c (instantiate_decl): Check that defer_ok is not set for
2010 local class members.
2013 * pt.c (tsubst_init): Split out from...
2014 (tsubst_expr) [DECL_EXPR]: Here.
2015 (tsubst_copy) [VAR_DECL]: Use it.
2016 * semantics.c (finish_id_expression): Return the decl for static/const.
2018 2014-05-28 Jason Merrill <jason@redhat.com>
2021 * decl.c (cxx_comdat_group): Return a decl.
2022 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
2024 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
2028 * call.c (build_aggr_conv): Ignore passed in flags.
2029 (build_array_conv, build_complex_conv): Likewise.
2031 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2033 * optimize.c (maybe_thunk_body): Use set_comdat_group.
2034 (maybe_clone_body): Likewise.
2035 * decl.c (duplicate_decls): Update code duplicating comdat group;
2036 do not copy symtab pointer; before freeing newdecl remove it
2038 * decl2.c (constrain_visibility): Use set_comdat_group.
2040 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2042 * rtti.c: Include tm_p.h
2043 (emit_tinfo_decl): Force RTTI data to be aligned to required
2046 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2048 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
2049 ignoring other target adjustments.
2051 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
2053 * semantics.c (finish_omp_clauses): Remove duplicated variable
2056 * parser.c (cp_parser_omp_target): Return bool values.
2058 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2061 * lambda.c (add_capture): Enforce that capture by value requires
2063 * typeck2.c (cxx_incomplete_type_inform): Early return if
2064 TYPE_MAIN_DECL is null.
2066 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
2069 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
2071 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2074 * lambda.c (build_capture_proxy, add_capture): Treat normal
2075 captures and init-captures identically.
2077 2014-05-21 Mark Wielaard <mjw@redhat.com>
2080 * cp-lang.c (cxx_enum_underlying_base_type): New function.
2081 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
2083 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2085 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
2086 * cp-array-notation.c (replace_invariant_exprs): Likewise.
2087 (expand_array_notation): Handle VOID_CST.
2088 * error.c (dump_expr): Likewise.
2089 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
2090 (cxx_pretty_printer::expression): Likewise.
2091 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
2092 * decl.c (register_dtor_fn): Likewise.
2093 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
2094 (build_delete, push_base_cleanups): Likewise.
2095 * mangle.c (write_expression): Likewise.
2096 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
2097 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
2098 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
2099 * tree.c (cp_tree_equal): Likewise.
2100 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
2101 instead of void_zero_node.
2102 * typeck.c (check_return_expr): Likewise.
2103 * typeck2.c (build_functional_cast): Likewise.
2105 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
2108 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
2110 (cp_parser_statement): ...here. Make sure only semicolon can go after
2113 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2118 * typeck2.c (digest_nsdmi_init): New.
2119 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
2120 * init.c (get_nsdmi): Likewise.
2121 * cp-tree.h (digest_nsdmi_init): Declare.
2123 2014-05-20 Jason Merrill <jason@redhat.com>
2125 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
2126 up a virtual function in a dummy object.
2128 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2131 * decl.c (duplicate_decls): Replace pair of warning_at with
2132 warning_at + inform.
2133 (maybe_commonize_var): Likewise.
2135 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2138 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
2139 (tsubst_copy_and_build): Perform recursive substitutions in a
2140 deterministic order.
2142 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2145 * typeck2.c (cxx_incomplete_type_inform): New.
2146 (cxx_incomplete_type_diagnostic): Use it.
2147 * decl.c (grokdeclarator): Check the element type of an
2148 incomplete array type; call the above.
2149 * cp-tree.h (cxx_incomplete_type_inform): Declare.
2151 2014-05-19 Jason Merrill <jason@redhat.com>
2154 * pt.c (tsubst_copy): Don't check at_function_scope_p.
2155 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
2157 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
2159 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
2160 * parser.c (cp_parser_enum_specifier): Likewise.
2162 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
2164 * class.c (sorted_fields_type_new): Adjust.
2165 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
2166 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
2167 * cp-tree.h: Remove usage of variable_size gty attribute.
2168 * decl.c (make_label_decl): Adjust.
2169 (check_goto): Likewise.
2170 (start_preparsed_function): Likewise.
2171 (save_function_data): Likewise.
2172 * lex.c (init_reswords): Likewise.
2173 (retrofit_lang_decl): Likewise.
2174 (cxx_dup_lang_specific_decl): Likewise.
2175 (copy_lang_type): Likewise.
2176 (cxx_make_type): Likewise.
2177 * name-lookup.c (binding_entry_make): Likewise.
2178 (binding_table_construct): Likewise.
2179 (binding_table_new): Likewise.
2180 (cxx_binding_make): Likewise.
2181 (pushdecl_maybe_friend_1): Likewise.
2182 (begin_scope): Likewise.
2183 (push_to_top_level): Likewise.
2184 * parser.c (cp_lexer_alloc): Likewise.
2185 (cp_lexer_new_from_tokens): Likewise.
2186 (cp_token_cache_new): Likewise.
2187 (cp_parser_context_new): Likewise.
2188 (cp_parser_new): Likewise.
2189 (cp_parser_nested_name_specifier_opt): Likewise.
2190 (cp_parser_template_id): Likewise.
2191 * pt.c (maybe_process_partial_specialization): Likewise.
2192 (register_specialization): Likewise.
2193 (add_pending_template): Likewise.
2194 (lookup_template_class_1): Likewise.
2195 (push_tinst_level): Likewise.
2196 * semantics.c (register_constexpr_fundef): Likewise.
2197 (cxx_eval_call_expression): Likewise.
2198 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
2200 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
2203 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
2204 when cp_parser_lookup_name sets ambiguous_decls.
2206 2014-05-15 Jason Merrill <jason@redhat.com>
2208 * call.c (print_conversion_rejection): Use loc consistently.
2210 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2212 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
2213 * call.c (convert_like_real, build_new_method_call_1): Use it.
2214 * decl2.c (grokfield): Likewise.
2215 * init.c (perform_member_init, build_aggr_init, expand_default_init,
2216 build_new_1): Likewise.
2217 * mangle.c (write_expression): Likewise.
2218 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
2220 2014-05-14 Jason Merrill <jason@redhat.com>
2224 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
2225 dropped cv-quals as a bad conversion.
2226 (convert_like_real) [ck_ref_bind]: Explain them.
2227 (compare_ics): Check badness before stripping reference
2228 bindings. Handle comparing bad reference bindings.
2229 * typeck.c (comp_cv_qualification): Add overload that just takes
2231 * cp-tree.h: Declare it.
2233 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
2234 (arg_conversion_rejection, bad_arg_conversion_rejection)
2235 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
2236 (add_function_candidate): Pass actual argument, rather than type, to
2237 bad_arg_conversion_rejection.
2238 (print_conversion_rejection): Explain what's wrong with the conversion.
2239 (print_z_candidates): Say "candidate:" before each candidate.
2240 (splice_viable): Be strict if we see a viable or template candidate.
2241 (build_user_type_conversion_1): Pass false to strict parameter.
2242 (perform_overload_resolution, build_conditional_expr_1): Likewise.
2243 (build_new_op_1, build_new_method_call_1): Likewise.
2244 (build_op_call_1): Pass true to strict parameter.
2246 2014-05-13 Jason Merrill <jason@redhat.com>
2248 * call.c (print_error_for_call_failure): Say "no match" rather
2249 than "ambiguous" if there were no strict matches.
2250 (build_new_method_call_1): Likewise.
2253 * semantics.c (is_this_parameter): Allow capture proxies too.
2255 2014-05-12 Jason Merrill <jason@redhat.com>
2257 * call.c (maybe_print_user_conv_context): New.
2258 (convert_like_real): Use it. Print call context for bad
2259 user-defined conversion.
2260 (build_over_call): Print call context for bad 'this' conversion.
2262 * call.c (convert_like_real): Use inform for identifying the
2265 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
2267 * cvt.c (cp_convert_to_pointer): Don't call error_at if
2268 complain & tf_error is false.
2270 * decl.c (make_unbound_class_template): Prefer inform for
2271 "declared here"-type message.
2273 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
2277 * lambda.c (lambda_expr_this_capture): Add new parameter
2278 add_capture_p controlling whether the functions will try to
2279 capture 'this' via the default capture.
2280 (maybe_resolve_dummy): Likewise.
2281 * cp-tree.h: Adjust prototypes.
2282 * call.c, semantics.c: Change callers of these functions.
2283 * call.c (build_new_method_call_1): Use the actual 'this' that
2284 would be potentially captured for the overload resolution, instead
2285 of the dummy object.
2287 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2289 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
2291 (convert_nontype_argument): Adjust calls.
2292 (coerce_template_parameter_pack): Add missing complain & tf_error
2295 2014-05-09 Jason Merrill <jason@redhat.com>
2299 * call.c (build_conditional_expr_1, conditional_conversion): Handle
2300 non-class lvalues and xvalues that differ only in cv-qualifiers.
2304 * call.c (build_user_type_conversion_1): The copy-init temporary
2308 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
2311 * call.c (build_conditional_expr_1): If overload resolution finds
2312 no match, just say "different types".
2315 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
2318 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
2319 if we didn't find a conversion.
2320 Don't accept a bad conversion too early.
2322 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2325 * typeck.c (convert_for_assignment): Provide an inform for pointers
2326 to incomplete class types.
2328 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2331 * pt.c (convert_nontype_argument): Protect all the error calls
2332 with complain & tf_error.
2334 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2337 * pt.c (instantiate_decl): Avoid generating the body of a
2340 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2343 * pt.c (maybe_begin_member_template_processing): Use
2344 uses_template_parms.
2346 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
2347 Mike Stump <mikestump@comcast.net>
2348 Richard Sandiford <rdsandiford@googlemail.com>
2350 * call.c: Include wide-int.h.
2351 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2352 (convert_for_arg_passing): Likewise.
2353 * class.c: Include wide-int.h.
2354 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
2355 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2356 (include_empty_classes): Likewise
2357 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
2358 * cvt.c: Include wide-int.h.
2359 (ignore_overflows): Use wide_int_to_tree.
2360 * decl.c: Include wide-int.h.
2361 (check_array_designated_initializer): Use wide-int interfaces.
2362 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
2363 (finish_enum_value_list): Use signop.
2364 (build_enumerator): Use wide-int interfaces.
2365 * init.c: Include wide-int.h.
2366 (build_new_1): Use wide-int interfaces.
2367 * mangle.c: Include wide-int.h.
2368 (write_integer_cst): Use wide-int interfaces.
2369 (write_array_type): Likewise.
2370 * tree.c: Include wide-int.h.
2371 (cp_tree_equal): Use tree_int_cst_equal.
2372 * typeck2.c: Include wide-int.h.
2373 (process_init_constructor_array): Use wide-int interfaces.
2375 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2378 * decl.c (grokfndecl): Check duplicate_decls return value for
2380 * pt.c (instantiate_decl): A deleted function is defined.
2382 2014-05-02 Jason Merrill <jason@redhat.com>
2384 * decl2.c (vague_linkage_p): Local statics have vague linkage.
2387 * lambda.c (lambda_capture_field_type): Wrap anything dependent
2389 (add_capture): Check for VLA before calling it.
2390 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
2391 just the current one. Make non-static.
2392 * cp-tree.h: Declare it.
2393 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
2394 the operand was static or constant.
2396 2014-05-02 Marek Polacek <polacek@redhat.com>
2398 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
2401 2014-05-01 Marek Polacek <polacek@redhat.com>
2404 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
2405 between label and variable when warning about returning local address.
2407 2014-04-30 Jason Merrill <jason@redhat.com>
2410 * init.c (build_value_init): Don't try to call an array constructor.
2413 * typeck2.c (massage_init_elt): Use maybe_constant_init.
2415 2014-04-30 Marek Polacek <polacek@redhat.com>
2417 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
2418 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
2419 for non-integer types.
2421 2014-04-29 Jason Merrill <jason@redhat.com>
2424 Represent the unevaluated exception specification of an implicitly
2425 declared or deleted function with a simple placeholder, not a list
2427 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
2428 * except.c (unevaluated_noexcept_spec): New.
2429 * class.c (deduce_noexcept_on_destructor): Use it.
2430 * decl.c (check_redeclaration_exception_specification): Call
2431 maybe_instantiate_noexcept.
2432 (duplicate_decls): Call it before merge_types.
2433 (start_preparsed_function): Call maybe_instantiate_noexcept.
2434 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
2435 * init.c (get_nsdmi): Factor out of perform_member_init.
2436 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
2437 (walk_field_subobs): Consider NSDMI for EH spec.
2438 (get_defaulted_eh_spec): New.
2439 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
2440 (defaulted_late_check): Defer EH checking in non-template classes.
2441 (after_nsdmi_defaulted_late_checks): New.
2442 * parser.c (cp_parser_class_specifier_1): Use it.
2443 (unparsed_classes): New macro.
2444 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
2445 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
2446 Remove list-of-functions handling.
2447 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
2448 handling and FN parameter.
2449 * typeck.c (merge_types): Adjust.
2451 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2454 * parser.c (cp_parser_alias_declaration): Check return value of
2457 2014-04-24 Jakub Jelinek <jakub@redhat.com>
2459 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
2460 atomic-clause, allow comma in between atomic-clause and
2463 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
2466 * rtti.c (emit_support_tinfos): Do not iterate on
2467 registered_builtin_types (partial revert).
2469 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
2472 * semantics.c (apply_deduced_return_type): Complete non-void type
2473 before estimating whether the type is aggregate.
2475 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
2478 * rtti.c (emit_support_tinfo_1): New function, extracted from
2479 emit_support_tinfos.
2480 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
2482 2014-04-22 Jakub Jelinek <jakub@redhat.com>
2485 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
2486 fails, don't set OM_PARALLEL_COMBINED and return NULL.
2488 2014-04-18 Jason Merrill <jason@redhat.com>
2491 * call.c (reference_binding): Recurse on user-defined conversion.
2494 * call.c (standard_conversion): Don't try to apply restrict to void.
2496 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
2498 * decl.c (reshape_init_r): Handle a single element of vector type.
2500 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2503 * decl2.c (cplus_decl_attributes): Handle
2504 pointer-to-member-function declarations.
2506 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2509 * call.c (build_user_type_coversion): Use build_dummy_object
2510 to create the placeholder object for a constructor method call.
2511 (build_special_member_call): Likewise.
2512 (build_over_call): Check for the placeholder object with
2514 (build_new_method_call_1): Likewise. Don't attempt to resolve
2515 a dummy object for a constructor method call.
2517 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
2520 * friend.c (add_friend, make_friend_class): Move repeated friend
2521 warning under Wredundant_decls.
2523 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
2525 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
2526 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2527 (do_class_using_decl): Likewise.
2528 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
2530 2014-04-15 Jakub Jelinek <jakub@redhat.com>
2533 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
2535 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2537 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
2539 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2541 * pt.c (mark_template_parm): Use template_parm_level_and_index.
2543 2014-04-11 Jason Merrill <jason@redhat.com>
2545 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
2547 (cp_lexer_get_preprocessor_token): Always clear it.
2548 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
2552 * decl.c (reshape_init_r): Handle a single element of class type.
2555 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
2556 built-in operator new.
2558 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2561 * name-lookup.c (parse_using_directive): Return early if the
2562 attribs argument is error_mark_node; use get_attribute_name.
2564 2014-04-11 Jason Merrill <jason@redhat.com>
2568 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
2569 * call.c (struct z_candidate): Add flags field.
2570 (add_candidate): Add flags parm.
2571 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
2572 (add_template_candidate_real): Pass it.
2573 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
2574 * tree.c (build_aggr_init_expr): Copy it.
2575 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
2577 2014-04-10 Richard Biener <rguenther@suse.de>
2578 Jakub Jelinek <jakub@redhat.com>
2581 * error.c (dump_decl) <case FUNCTION_DECL>: If
2582 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
2583 recurse on DECL_ABSTRACT_ORIGIN instead of printing
2586 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
2588 * pt.c (check_template_variable): Check for the return of pedwarn
2589 before emitting a note.
2590 * parser.c (cp_parser_lambda_introducer): Likewise.
2592 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2595 * pt.c (process_template_parm): For an invalid non-type parameter
2596 only set TREE_TYPE to error_mark_node.
2597 (push_inline_template_parms_recursive, comp_template_parms,
2598 redeclare_class_template, coerce_template_template_parm,
2599 coerce_template_template_parms, unify): Use error_operand_p.
2601 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
2603 * class.c (check_bases_and_members): Warn about non-virtual dtors
2604 in public bases only. Check warn_ecpp before complaining about
2605 non-polymorphic bases.
2607 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2609 * decl.c (duplicate_decls): Check for the return of warning_at
2610 before emitting a note.
2611 (warn_misplaced_attr_for_class_type): Likewise.
2612 (check_tag_decl): Likewise.
2614 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
2617 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
2619 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
2622 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
2623 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
2624 instantiating a variable-sized type.
2627 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
2629 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2631 * class.c (find_abi_tags_r): Check for the return of warning
2632 before emitting a note.
2633 (one_inherited_ctor): Likewise.
2635 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2637 * decl.c (duplicate_decls): Check for the return of permerror
2638 before emitting a note.
2640 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
2642 * class.c (accessible_nvdtor_p): New.
2643 (check_bases): Don't check base destructor here ...
2644 (check_bases_and_members): ... check them here. Trigger on
2645 Wnon-virtual-dtor flag.
2646 (finish_struct_1): Use accessible_nvdtor_p.
2648 2014-04-01 Jason Merrill <jason@redhat.com>
2650 * pt.c (process_partial_specialization): Say "not deducible"
2651 rather than "not used". Use inform.
2654 * pt.c (coerce_template_parms): Check that the pack expansion
2655 pattern works with the first matching parameter.
2657 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
2659 * init.c (perform_member_init): Homogenize uninitialized
2662 2014-04-01 Jason Merrill <jason@redhat.com>
2665 * call.c (build_array_conv): Call complete_type.
2668 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
2669 (picflag_from_initializer): Return it.
2670 (process_init_constructor): Handle it.
2673 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
2674 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
2675 * pt.c (get_template_info): Handle NAMESPACE_DECL.
2676 (most_general_template): Handle more kinds of template.
2677 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
2678 instantiations and specializations.
2680 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
2683 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
2684 COMPONENT_REFs and ARRAY_REFs sooner.
2686 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
2689 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
2690 usage in non-functions with pushed scope.
2692 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
2695 * name-lookup.h (cp_binding_level): New transient field defining_class_p
2696 to indicate whether a scope is in the process of defining a class.
2697 * semantics.c (begin_class_definition): Set defining_class_p.
2698 * name-lookup.c (leave_scope): Reset defining_class_p.
2699 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
2700 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
2701 unwinding to class-defining scope to handle the erroneous definition of
2702 a generic function of an arbitrarily nested class within an enclosing
2705 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
2708 * method.c (walk_field_subobs): Improve the diagnostic
2709 locations for both REFERENCE_TYPEs and non-static const members.
2710 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
2711 instead of %qD to be consistent with the c++11 diagnostic.
2713 2014-03-25 Jason Merrill <jason@redhat.com>
2717 * class.c (build_vtbl_initializer): Handle abstract dtors here.
2718 * search.c (get_pure_virtuals): Not here.
2721 * parser.c (cp_parser_lambda_expression): Don't parse the body of
2722 a lambda in unevaluated context.
2725 * decl.c (create_array_type_for_decl): Complain about array of auto.
2727 2014-03-25 Jakub Jelinek <jakub@redhat.com>
2730 * semantics.c (potential_constant_expression_1): Handle
2733 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
2736 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
2737 introducing an implicit function template parameter within an explicit
2740 2014-03-22 Jason Merrill <jason@redhat.com>
2743 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
2746 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2749 * name-lookup.c (push_class_level_binding_1): Check identifier_p
2750 on the name argument.
2752 2014-03-20 Jakub Jelinek <jakub@redhat.com>
2755 * init.c (build_zero_init_1): Ignore fields with error_mark_node
2758 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2761 * call.c (build_new_method_call_1): Handle pure virtuals called by
2764 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
2767 * parser.c (cp_parser_member_declaration): Don't allow
2768 finish_fully_implicit_template to consider friend declarations to be
2769 class member templates.
2770 (synthesize_implicit_template_parm): Handling winding back through class
2771 scope to the class being defined in order to inject a template argument
2775 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
2776 function scope as per cp_parser_skip_to_end_of_statement.
2778 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2781 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
2783 2014-03-14 Jason Merrill <jason@redhat.com>
2787 * search.c (get_pure_virtuals): Handle abstract dtor here.
2788 (dfs_get_pure_virtuals): Not here.
2791 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
2792 abstract class as pure.
2794 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2797 * pt.c (maybe_process_partial_specialization): Check return value
2798 of check_specialization_namespace.
2800 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2803 * semantics.c (finish_static_assert): Call cxx_constant_value only
2804 if require_potential_rvalue_constant_expression returns true.
2806 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
2809 * method.c (get_inherited_ctor): New.
2810 * cp-tree.h (get_inherited_ctor): Declare it.
2811 * semantics.c (is_valid_constexpr_fn): Use it.
2813 2014-03-10 Jason Merrill <jason@redhat.com>
2816 * call.c (convert_default_arg): Remove special handling for
2820 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
2821 when deciding whether to call push_template_decl for a member class.
2822 * pt.c (push_template_decl_real): Return after wrong levels error.
2824 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
2827 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
2828 lambda, remove the lambda's own template argument list prior to fetching
2832 * parser.c (cp_parser_parameter_declaration_clause): Move generic
2833 function template unwinding on error into a more general location, ...
2834 (cp_parser_skip_to_end_of_statement): ... here.
2836 2014-03-07 Jason Merrill <jason@redhat.com>
2838 * Make-lang.in (check_g++_parallelize): Split dg.exp.
2840 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
2841 we're in a trailing return type.
2843 * typeck.c (comp_template_parms_position): 'auto' and
2844 'decltype(auto)' are different from real template parms.
2846 * parser.c (cp_parser_using_declaration): Consume the semicolon
2847 after bare parameter pack error.
2849 * cp-tree.h (REF_PARENTHESIZED_P): New.
2850 * semantics.c (force_paren_expr): Set it.
2851 * pt.c (do_auto_deduction): Check it.
2852 (tsubst) [COMPONENT_REF]: Copy it.
2853 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
2855 * decl.c (create_array_type_for_decl): Only warn about invalid
2856 C++1y VLA if flag_iso or warn_vla>0.
2857 (grokdeclarator): Likewise.
2858 * pt.c (tsubst): Likewise.
2859 * semantics.c (finish_decltype_type): Likewise.
2860 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
2861 (cp_build_addr_expr_1): Likewise.
2862 * init.c (build_new_1): Improve diagnostics.
2864 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2867 * decl.c (check_initializer): Return NULL_TREE after error;
2868 consistently use inform.
2870 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2872 * decl.c (check_initializer): Remove dead code.
2874 2014-03-06 Marek Polacek <polacek@redhat.com>
2877 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
2878 of checking tree code.
2880 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2882 * parser.c (cp_lexer_set_source_position): New.
2883 (cp_parser_mem_initializer): Use it.
2884 (cp_parser_postfix_open_square_expression): Likewise.
2885 (cp_parser_parenthesized_expression_list): Likewise.
2886 (cp_parser_new_initializer): Likewise.
2887 (cp_parser_jump_statement): Likewise.
2888 (cp_parser_initializer): Likewise.
2889 (cp_parser_functional_cast): Likewise.
2891 2014-03-05 Jason Merrill <jason@redhat.com>
2894 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
2895 dependent expression.
2898 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
2899 if re-parsing might succeed.
2900 * semantics.c (finish_id_expression): Use of a parameter outside
2901 the function body is a parse error.
2903 * parser.c (cp_parser_mem_initializer): Set input_location
2904 properly for init-list warning.
2905 (cp_parser_postfix_open_square_expression): Likewise.
2906 (cp_parser_parenthesized_expression_list): Likewise.
2907 (cp_parser_new_initializer): Likewise.
2908 (cp_parser_jump_statement): Likewise.
2909 (cp_parser_initializer): Likewise.
2910 (cp_parser_functional_cast): Likewise.
2912 2014-03-04 Jason Merrill <jason@redhat.com>
2915 * typeck2.c (process_init_constructor_record): Set
2916 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
2920 * parser.c (cp_parser_direct_declarator): Set declarator to
2921 cp_error_declarator on invalid qualified-id.
2923 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
2926 * parser.c (cp_parser_using_declaration): Early return when
2927 cp_parser_nested_name_specifier errors out.
2929 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
2932 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
2933 function scope on parse error in function parameter list.
2935 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
2937 * method.c (implicitly_declare_fn): Remove redundant
2938 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
2939 * semantics.c (is_instantiation_of_constexpr): Likewise.
2940 * error.c (dump_function_decl): Likewise.
2942 2014-03-01 Jason Merrill <jason@redhat.com>
2945 * semantics.c (begin_maybe_infinite_loop): Use
2946 fold_non_dependent_expr_sfinae.
2948 2014-02-28 Jason Merrill <jason@redhat.com>
2951 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
2953 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
2956 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
2957 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
2958 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2960 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2963 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
2966 2014-02-27 Jason Merrill <jason@redhat.com>
2970 * decl2.c (tentative_decl_linkage): Don't mess with functions that
2971 are not yet defined.
2973 2014-02-26 Jason Merrill <jason@redhat.com>
2977 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
2978 * init.c (build_vtbl_address): Do it here.
2984 * pt.c (struct warning_sentinel): New.
2985 (tsubst_copy_and_build): Use it instead of
2986 c_inhibit_evaluation_warnings.
2987 * typeck.c (maybe_warn_about_useless_cast): Remove
2988 c_inhibit_evaluation_warnings check.
2991 * pt.c (get_template_parm_index): New.
2992 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
2993 (process_template_parm): Allow bare packs in template template
2994 parm template parms.
2995 (coerce_template_parameter_pack): Handle fixed template template
2996 parm packs and fixed packs not at the end of the parm list.
2997 (coerce_template_parms): Handle template parm packs not at the end
2999 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
3002 * pt.c (unify): Ignore alias templates when deducing a template
3008 * call.c (reference_binding): Recurse on user-defined conversion.
3009 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3011 2014-02-25 Jason Merrill <jason@redhat.com>
3014 * call.c (reference_binding): Recurse on user-defined conversion.
3015 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3017 * call.c (print_conversion_rejection): Handle n_arg of -2.
3018 (build_user_type_conversion_1): Pass it.
3021 * decl2.c (no_linkage_error): Handle C++98 semantics.
3022 (reset_type_linkage): Move from decl.c.
3023 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
3024 (bt_reset_linkage_2, reset_decl_linkage): New.
3025 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
3026 (cp_write_global_declarations): Move condition into no_linkage_error.
3027 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
3028 * semantics.c (expand_or_defer_fn_1): Factor out
3029 tentative_decl_linkage.
3030 * cp-tree.h: Adjust.
3032 * decl2.c (finish_static_data_member_decl): Diagnose static data
3033 member in unnamed class.
3034 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
3037 * class.c (clone_function_decl): Call note_vague_linkage_fn for
3038 defaulted virtual dtor.
3042 * pt.c (get_underlying_template): Fix equivalence calculation.
3044 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
3047 * parser.c (function_being_declared_is_template_p): Return false when
3048 processing a template parameter list.
3049 (cp_parser_parameter_declaration_clause): Don't set
3050 auto_is_implicit_function_template_parm_p when processing a
3051 template parameter list.
3053 * parser.c (synthesize_implicit_template_parm): Inject new template
3054 argument list appropriately when a generic member function
3055 of a class template is declared out-of-line.
3058 * parser.c (cp_parser_direct_declarator): Don't save and
3059 restore num_template_parameter_lists around call to
3060 cp_parser_parameter_declaration_list.
3061 (function_being_declared_is_template_p): New predicate.
3062 (cp_parser_parameter_declaration_list): Use
3063 function_being_declared_is_template_p as predicate for
3064 inspecting current function template parameter list length
3065 rather than num_template_parameter_lists.
3067 2014-02-24 Jason Merrill <jason@redhat.com>
3070 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
3071 DECL_EXPR initialize a non-class iterator.
3074 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
3076 2014-02-21 Jason Merrill <jason@redhat.com>
3079 * parser.c (cp_parser_type_name): Always check dependency.
3080 (cp_parser_type_specifier_seq): Call
3081 cp_parser_parse_and_diagnose_invalid_type_name.
3084 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
3087 * parser.c (cp_parser_default_argument): Clear
3088 current_class_ptr/current_class_ref like tsubst_default_argument.
3091 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
3092 than current_binding_level.
3095 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
3098 * parser.c (cp_parser_enum_specifier): Call
3099 check_for_bare_parameter_packs.
3102 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
3106 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
3107 of the partial instantiation, not the most general template.
3108 (maybe_process_partial_specialization): Reassign everything on
3112 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
3113 (check_explicit_specialization): Don't clone.
3116 * pt.c (coerce_template_parms): Bail if argument packing fails.
3119 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
3120 Don't get confused by a CONSTRUCTOR that already has a type.
3123 * call.c (build_array_conv): Don't crash on VLA.
3126 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
3129 * lambda.c (maybe_resolve_dummy): Don't try to capture this
3130 in declaration context.
3134 * pt.c (unify): Only unify if deducible. Handle 0-length list.
3137 * parser.c (cp_parser_direct_declarator): Don't wrap a
3138 type-dependent expression in a NOP_EXPR.
3141 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
3146 * parser.c (cp_parser_template_argument): Restore dereference.
3147 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
3148 (process_partial_specialization): Handle deref.
3151 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
3155 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
3156 implicit_template_scope upon leaving an out-of-line generic member
3157 function definition.
3159 2014-02-20 Kai Tietz <ktietz@redhat.com>
3162 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
3163 valued type argument as error_mark_node.
3166 * semantics.c (finish_fname): Handle error_mark_node.
3168 2014-02-19 Jason Merrill <jason@redhat.com>
3171 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
3172 spec from template context.
3174 2014-02-19 Jakub Jelinek <jakub@redhat.com>
3177 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
3178 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
3181 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
3183 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3186 * semantics.c (ensure_literal_type_for_constexpr_object): Use
3189 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3192 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
3193 During error recovery allow_non_constant may be false.
3195 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
3198 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
3199 scope whenever a template parameter list has been started, independent
3200 of whether the function call operator was well-formed or not.
3203 * parser.c (cp_parser_member_declaration): Pop fully implicit template
3204 scope for generic friend declarations as well as for non-friends.
3206 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
3209 * method.c (implicitly_declare_fn): A constructor of a class with
3210 virtual base classes isn't constexpr (7.1.5p4).
3212 2014-02-05 Jan Hubicka <hubicka@ucw.cz
3214 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
3216 2014-02-05 Jakub Jelinek <jakub@redhat.com>
3219 * parser.c (cp_parser_omp_declare_reduction): Save and free
3222 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
3226 * tree.c (handle_init_priority_attribute): Call default_conversion on
3227 the attribute argument.
3229 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
3232 * method.c (synthesized_method_walk): If vbases is non-null but
3233 is_empty is true, likewise don't worry about the virtual bases.
3235 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
3238 * typeck2.c (process_init_constructor_record): Just skip unnamed
3241 2014-01-31 Jason Merrill <jason@redhat.com>
3244 * pt.c (mark_decl_instantiated): Call mark_needed.
3247 * decl2.c (handle_tls_init): Handle null init fn.
3250 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
3252 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
3255 * class.c (build_vfield_ref): Early return error_mark_node if
3256 TYPE_VFIELD (type) is null.
3257 (build_base_path): Check return value of build_vfield_ref.
3259 2014-01-31 Jason Merrill <jason@redhat.com>
3262 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
3263 [ck_list]: Check for error_mark_node.
3264 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
3267 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
3268 during partial ordering.
3270 2014-01-31 Marek Polacek <polacek@redhat.com>
3273 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
3275 2014-01-30 Jason Merrill <jason@redhat.com>
3278 * cp-tree.h (struct saved_scope): Add x_local_specializations.
3279 (local_specializations): New macro.
3280 * pt.c (local_specializations): Remove variable.
3282 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
3285 * parser.c (make_string_pack): Use double_int::from_buffer.
3287 2014-01-30 Marek Polacek <polacek@redhat.com>
3290 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
3292 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
3293 with input_location.
3294 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
3297 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3300 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
3302 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3305 * pt.c (lookup_template_class_1): Check start_enum return value
3306 for error_mark_node.
3308 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3310 * decl.c (duplicate_decls, typename_hash, typename_compare):
3311 Use TYPE_IDENTIFIER.
3312 * error.c (dump_type): Likewise.
3313 * mangle.c (dump_substitution_candidates): Likewise.
3315 2014-01-30 Jason Merrill <jason@redhat.com>
3318 * decl2.c (attributes_naming_typedef_ok): New.
3319 * cp-tree.h: Declare it.
3320 * decl.c (grokdeclarator): Check it.
3321 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
3323 2014-01-29 Jason Merrill <jason@redhat.com>
3326 * call.c (add_builtin_candidate): Catch dependent types.
3329 * pt.c (expand_template_argument_pack): Correct
3330 non_default_args_count calculation.
3333 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
3336 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
3337 have a friend template in a class template.
3338 * pt.c (tsubst_friend_function): Look through it.
3339 (push_template_decl_real): A friend member template is
3342 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3345 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
3348 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3351 * pt.c (instantiate_template_1): Check for error_mark_node the second
3354 2014-01-29 Jason Merrill <jason@redhat.com>
3357 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
3358 cdtor_returns_this case.
3361 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
3363 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3366 * semantics.c (finish_omp_reduction_clause): Check type for
3369 2014-01-28 Jason Merrill <jason@redhat.com>
3372 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
3373 (tsubst_copy): Use it if lookup fails.
3376 * pt.c (tsubst_function_type): Make sure we keep the same function
3380 * semantics.c (build_anon_member_initialization): Stop walking
3381 when we run out of COMPONENT_REFs.
3384 * decl.c (lookup_and_check_tag): Ignore template parameters if
3385 scope == ts_current.
3386 * pt.c (check_template_shadow): Don't complain about the injected
3389 * decl.c (duplicate_decls): Tweak.
3392 * mangle.c (write_unqualified_name): Handle operator auto.
3394 2014-01-27 Jason Merrill <jason@redhat.com>
3398 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
3399 list-initialization. A conversion to rvalue ref that involves
3400 an lvalue-rvalue conversion is bad.
3401 (convert_like_real): Give helpful error message.
3404 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
3407 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
3411 * pt.c (template_parm_to_arg): Call convert_from_reference.
3412 (tsubst_template_arg): Don't strip reference refs.
3415 * call.c (build_aggr_conv): Reject value-initialization of reference.
3419 * call.c (convert_like_real): Give helpful error about excess braces
3420 for ck_rvalue of scalar type.
3423 * call.c (reference_binding): Only elide braces if the single
3424 element is reference-related.
3427 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
3431 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
3435 * decl.c (compute_array_index_type): Don't call
3436 maybe_constant_value for a non-integral expression.
3438 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
3440 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
3442 * cp-gimplify.c (cp_genericize): Likewise.
3443 * decl.c (grokfndecl): Likewise.
3444 * parser.c (cp_parser_postfix_expression): Likewise.
3445 (cp_parser_postfix_open_square_expression): Likewise.
3446 (cp_parser_direct_declarator): Likewise.
3447 (is_cilkplus_vector_p): Likewise.
3448 (cp_parser_omp_clause_name): Likewise.
3449 (cp_parser_omp_all_clauses): Likewise.
3450 * pt.c (apply_late_template_attributes): Likewise.
3451 * typeck.c (cp_build_array_ref): Likewise.
3452 (cp_build_compound_expr): Likewise.
3453 (check_return_expr): Likewise.
3455 2014-01-24 Jason Merrill <jason@redhat.com>
3458 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
3463 * typeck2.c (process_init_constructor_array): Don't create
3466 2014-01-24 Jakub Jelinek <jakub@redhat.com>
3468 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
3469 handling for RANGE_ARRAY case.
3471 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
3474 * name-lookup.c (push_using_directive): Use timevar_cond_start.
3476 2014-01-23 Marek Polacek <polacek@redhat.com>
3479 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
3481 2014-01-23 Marek Polacek <polacek@redhat.com>
3484 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
3487 2014-01-23 Jason Merrill <jason@redhat.com>
3490 * cp-tree.h (struct language_function): Add infinite_loop and
3492 (current_function_infinite_loop): New.
3493 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
3494 (break_maybe_infinite_loop): New.
3495 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
3496 (finish_do_stmt, finish_for_cond, finish_for_stmt)
3497 (begin_range_for_stmt): Use them.
3498 * decl.c (finish_function): Don't warn about missing return
3499 if current_function_infinite_loop.
3500 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
3501 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
3503 * call.c (build_op_delete_call): Use make_tree_vector and
3504 release_tree_vector.
3506 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3509 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
3510 nested_name_specifier.
3512 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
3514 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
3515 see if there is an attribute after function decl. If so, then
3517 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
3518 enabled function late parsing.
3519 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
3520 attribute for a SIMD-enabled function.
3521 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
3522 the function is used by SIMD-enabled function (indicated by NULL
3523 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
3524 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
3525 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
3526 vectorlength clause in SIMD-enabled function and #pragma SIMD's
3527 vectorlength clause. Added a new bool parameter to differentiate
3529 (cp_parser_cilk_simd_fn_vector_attrs): New function.
3530 (is_cilkplus_vector_p): Likewise.
3531 (cp_parser_late_parsing_elem_fn_info): Likewise.
3532 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
3533 and "vectorlength" clauses when Cilk Plus is enabled.
3534 (cp_parser_omp_clause_linear): Added a new parameter of type bool
3535 and emit a sorry message when step size is a parameter.
3536 * parser.h (cp_parser::cilk_simd_fn_info): New field.
3537 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
3539 * pt.c (apply_late_template_attributes): Likewise.
3541 2014-01-23 Jakub Jelinek <jakub@redhat.com>
3544 * semantics.c (finish_omp_reduction_clause): Reject
3545 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
3547 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
3550 * parser.c (cp_parser_class_head): Push the class before parsing
3551 the base-clause, pop after it.
3553 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
3555 * decl2.c (cpp_check): Revert prototype change.
3557 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3561 * init.c (build_value_init_noctor): Don't pass error_mark_node to
3564 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3567 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
3568 only when errorcount == 0.
3570 2014-01-17 Marek Polacek <polacek@redhat.com>
3573 * cvt.c (ocp_convert): Don't segfault on non-existing
3574 ENUM_UNDERLYING_TYPE.
3576 2014-01-16 Jason Merrill <jason@redhat.com>
3579 * tree.c (bot_manip): Update the location of builtin_LINE and
3582 2014-01-14 Jason Merrill <jason@redhat.com>
3585 * typeck2.c (massage_init_elt): New.
3586 (process_init_constructor_record)
3587 (process_init_constructor_union): Use it.
3588 (process_init_constructor_array): Use it. Use RANGE_EXPR.
3589 (split_nonconstant_init_1): Handle it.
3590 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
3592 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
3595 * parser.c (cp_parser_postfix_expression): Added a new if-statement
3596 and replaced an existing if-statement with else-if statement.
3597 Changed an existing error message wording to match the one from the C
3600 2014-01-08 Jason Merrill <jason@redhat.com>
3603 * class.c (abi_tag_data): Add tags field.
3604 (check_abi_tags): Initialize it.
3605 (find_abi_tags_r): Support collecting missing tags.
3606 (mark_type_abi_tags): Don't look at template args.
3607 (inherit_targ_abi_tags): New.
3608 (check_bases_and_members): Use it.
3609 * cp-tree.h (ABI_TAG_IMPLICIT): New.
3610 * mangle.c (write_abi_tags): Check it.
3612 2014-01-07 Jason Merrill <jason@redhat.com>
3615 * pt.c (num_innermost_template_parms): New.
3616 (get_underlying_template): Use it.
3619 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
3621 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3623 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
3624 the letter of 20.11.6 about Base and Derived naming the same
3625 class type modulo cv-qualifiers.
3627 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
3630 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
3631 function as unimplemented for generic lambdas with varargs.
3634 * parser.c (cp_parser_template_parameter): Early out with
3635 error_mark_node if parameter declaration was not parsed.
3638 * parser.c (cp_parser_lambda_expression): Save/reset/restore
3639 auto_is_implicit_function_template_parm_p around lambda body.
3642 * parser.c (cp_parser_init_declarator): Undo fully implicit
3643 template parameter list when declarator is not a function.
3645 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
3648 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
3650 2014-01-03 Tobias Burnus <burnus@net-b.de>
3653 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
3655 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3659 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
3660 as include_std to perform_koenig_lookup.
3661 (cp_parser_postfix_expression): Adjust.
3662 * pt.c (tsubst_copy_and_build): Likewise.
3663 * semantics.c (perform_koenig_lookup): Remove bool parameter.
3664 (omp_reduction_lookup): Adjust.
3665 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
3666 (lookup_arg_dependent): Likewise.
3667 (lookup_function_nonclass): Adjust.
3668 * name-lookup.h: Adjust declaration.
3669 * cp-tree.h: Likewise.
3671 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3674 * parser.c (cp_parser_userdef_numeric_literal): Mention
3675 -fext-numeric-literals in the message.
3677 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3680 * call.c (build_conditional_expr_1): Check the return value of
3683 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3685 * call.c (convert_like_real): Check complain.
3687 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3690 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
3693 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3695 Update copyright years
3697 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3699 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
3700 the standard form for the copyright notice.
3702 Copyright (C) 2014 Free Software Foundation, Inc.
3704 Copying and distribution of this file, with or without modification,
3705 are permitted in any medium without royalty provided the copyright
3706 notice and this notice are preserved.