1 2014-11-21 Jakub Jelinek <jakub@redhat.com>
4 * typeck.c (cp_build_array_ref): Adjust
5 convert_vector_to_pointer_for_subscript caller. If it returns true,
6 call non_lvalue_loc on the result.
8 2014-11-20 Jason Merrill <jason@redhat.com>
11 * pt.c (convert_nontype_argument): Call convert_from_reference.
12 (check_instantiated_arg): Don't be confused by reference refs.
13 (unify): Look through reference refs on the arg, too.
14 * mangle.c (write_template_arg): Look through reference refs.
16 * error.c (dump_expr): Avoid printing (*&i) for references.
18 2014-11-20 Ville Voutilainen <ville.voutilainen@gmail.com>
21 * tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.
23 2014-11-20 Trevor Saunders <tsaunders@mozilla.com>
25 * cp-objcp-common.c: Use hash_table instead of htab.
27 2014-11-19 Jason Merrill <jason@redhat.com>
30 * cp-tree.h (struct processing_template_decl_sentinel): New.
31 * pt.c (instantiate_non_dependent_expr_internal): Split out from...
32 (instantiate_non_dependent_expr_sfinae): Here.
33 (convert_nontype_argument): Use them.
34 * constexpr.c (fold_non_dependent_expr): Use them.
37 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
38 complain yet about a reference.
39 [TARGET_EXPR]: Handle TARGET_EXPR with addr == true.
40 [ADDR_EXPR]: Make sure we don't take the address of a CONSTRUCTOR.
41 (cxx_bind_parameters_in_call): In the new scheme addr is always false.
42 * typeck.c (build_address): Don't take the address of a CONSTRUCTOR.
45 * init.c (decl_really_constant_value): Rename from
46 integral_constant_value.
47 (scalar_constant_value): Similar but limited to scalar results.
48 (decl_constant_value_safe): Remove.
49 (constant_value_1): Respect return_aggregate_cst_ok_p.
50 * typeck.c (decay_conversion): Use scalar_constant_value.
51 * call.c (convert_like_real): Likewise.
52 * cvt.c (ocp_convert): No need to check CLASS_TYPE_P.
53 * typeck.c (decay_conversion): Or ARRAY_TYPE.
54 * constexpr.c (struct constexpr_ctx): Add strict field.
55 (cxx_eval_constant_expression) [VAR_DECL]: Use it to select between
56 decl_constant_value and decl_really_constant_value.
57 (cxx_eval_outermost_constant_expr): Add strict parm.
58 (maybe_constant_init): Not strict.
59 (potential_constant_expression_1): Add strict parm.
60 Shorten most internal calls with RECUR macro.
61 * cp-tree.h, pt.c, semantics.c: Adjust.
63 2014-11-19 Jason Merrill <jason@redhat.com>
66 * constexpr.c (cxx_eval_store_expression): Return init, not *valp.
68 2014-11-19 Paolo Carlini <paolo.carlini@oracle.com>
71 * constexpr.c (constexpr_fn_retval): Accept __func__, __FUNCTION__,
72 and __PRETTY_FUNCTION__.
74 2014-11-18 Jason Merrill <jason@redhat.com>
77 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: A load
78 from a variable of empty class type is constant.
80 * constexpr.c (cxx_eval_statement_list): Handle statement-expressions.
81 (potential_constant_expression_1): Handle STMT_EXPR.
83 * constexpr.c (cxx_eval_constant_expression): Give jump_target a
85 (lots): Omit NULL jump_target arguments.
87 * constexpr.c (struct constexpr_ctx): Add quiet field.
88 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Set it.
89 (lots): Replace allow_non_constant parameter with ctx->quiet.
92 * constexpr.c (cxx_eval_binary_expression): Don't assume the
93 expression was already folded.
94 (cxx_eval_unary_expression): Likewise.
96 2014-11-18 Marc Glisse <marc.glisse@inria.fr>
99 * rtti.c (emit_support_tinfos): Handle __float128.
101 2014-11-18 Jason Merrill <jason@redhat.com>
104 * constexpr.c (cxx_eval_increment_expression): Use POINTER_PLUS_EXPR.
107 * constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
108 rather than VOID_TYPE_P.
110 * pt.c (instantiate_template_1): Use tsubst_aggr_type for context.
113 * typeck2.c (store_init_value): Set it.
114 * cp-tree.h (CONSTRUCTOR_MUTABLE_POISON): New.
115 * constexpr.c (cxx_eval_outermost_constant_expr): Check it.
117 2014-11-17 Jason Merrill <jason@redhat.com>
120 * call.c (build_call_a): Don't warn_deprecated_use here.
121 (build_over_call): Or here.
122 * decl2.c (mark_used): Do it here.
123 (is_late_template_attribute): Attribute deprecated is not deferred.
124 (cplus_decl_attributes): Propagate TREE_DEPRECATED out to the template.
125 * parser.c (cp_parser_template_name): Warn about deprecated template.
126 (cp_parser_template_argument): Likewise.
129 * decl.c (cp_finish_decl): Don't try to process a non-dependent
130 constant initializer for a reference.
131 * pt.c (value_dependent_expression_p): A reference is always
133 * call.c (extend_ref_init_temps_1): Also clear TREE_SIDE_EFFECTS
136 Handle C++14 constexpr flow control.
137 * constexpr.c (cxx_eval_loop_expr, cxx_eval_switch_expr): New.
138 (cxx_eval_statement_list): New.
139 (cxx_eval_constant_expression): Handle LABEL_EXPR,
140 CASE_LABEL_EXPR, GOTO_EXPR, LOOP_EXPR, SWITCH_EXPR. Handle jump
141 semantics of RETURN_EXPR.
142 (many functions): Add jump_target parameter.
143 (returns, breaks, continues, switches, label_matches): New.
144 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): New.
145 * cp-gimplify.c (begin_bc_block): Set them.
147 * cp-gimplify.c (genericize_cp_loop): Use LOOP_EXPR.
148 (genericize_for_stmt): Handle null statement-list.
150 * constexpr.c (use_new_call): Always use new call handling.
152 C++14 constexpr support (minus loops and multiple returns)
153 * constexpr.c (use_new_call): New macro.
154 (build_data_member_initialization): Ignore non-mem-inits.
155 (check_constexpr_bind_expr_vars): Remove C++14 checks.
156 (constexpr_fn_retval): Likewise.
157 (check_constexpr_ctor_body): Do nothing in C++14.
158 (massage_constexpr_body): In C++14 only collect mem-inits.
159 (get_function_named_in_call): Handle null CALL_EXPR_FN.
160 (cxx_bind_parameters_in_call): Build bindings in same order as
161 parameters. Don't treat iniviref parms specially in new call mode.
162 (cxx_eval_call_expression): If use_new_call, do constexpr expansion
163 based on DECL_SAVED_TREE rather than the massaged constexpr body.
164 Set up ctx->object from AGGR_INIT_EXPR_SLOT if we don't have one.
165 (is_sub_constant_expr): Don't mess with ctx.ctor here.
166 (cxx_eval_component_reference): A null element means we're mid-
168 (cxx_eval_store_expression, cxx_eval_increment_expression): New.
169 (cxx_eval_constant_expression): Handle RESULT_DECL, DECL_EXPR,
170 MODIFY_EXPR, STATEMENT_LIST, BIND_EXPR, USING_STMT,
171 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
172 POSTDECREMENT_EXPR. Don't look into DECL_INITIAL of variables in
173 constexpr functions. In new-call mode find parms in the values table.
174 (potential_constant_expression_1): Handle null CALL_EXPR_FN.
175 Handle STATEMENT_LIST, MODIFY_EXPR, MODOP_EXPR, IF_STMT,
176 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
177 POSTDECREMENT_EXPR, BIND_EXPR, WITH_CLEANUP_EXPR,
178 CLEANUP_POINT_EXPR, MUST_NOT_THROW_EXPR, TRY_CATCH_EXPR,
179 EH_SPEC_BLOCK, EXPR_STMT, DECL_EXPR, CASE_LABEL_EXPR, BREAK_STMT,
180 CONTINUE_STMT, USING_STMT, IF_STMT, DO_STMT, FOR_STMT, WHILE_STMT,
181 SWITCH_STMT, ASM_EXPR.
182 (cxx_eval_vec_init_1): Call build_aggr_init_expr.
183 (cxx_eval_indirect_ref): Don't return a CONSTRUCTOR when the
184 caller wants an lvalue.
185 (cxx_eval_outermost_constant_expr): Pull object out of AGGR_INIT_EXPR.
186 (maybe_constant_init): Look through INIT_EXPR.
187 (ensure_literal_type_for_constexpr_object): Set
188 cp_function_chain->invalid_constexpr.
189 * cp-tree.h (struct language_function): Add invalid_constexpr bitfield.
190 * decl.c (start_decl): Set cp_function_chain->invalid_constexpr.
191 (check_for_uninitialized_const_var): Likewise.
192 (maybe_save_function_definition): Check it.
193 * parser.c (cp_parser_jump_statement): Set
194 cp_function_chain->invalid_constexpr.
195 (cp_parser_asm_definition): Likewise.
198 * decl.c (build_ptrmemfunc_type): Don't build a different
199 RECORD_TYPE for a qualified PMF.
200 * cp-tree.h (TYPE_PTRMEMFUNC_FN_TYPE): Merge cv-quals.
201 (TYPE_PTRMEMFUNC_FN_TYPE_RAW): New.
202 * decl2.c (cplus_decl_attributes): Use TYPE_PTRMEMFUNC_FN_TYPE_RAW.
203 * tree.c (cp_walk_subtrees): Likewise.
204 (cp_build_qualified_type_real): Remove special PMF handling.
206 2014-11-15 Jason Merrill <jason@redhat.com>
208 * parser.c (cp_parser_omp_declare_reduction_exprs): A block is not
211 * constexpr.c (cxx_eval_builtin_function_call): Use
212 fold_builtin_call_array.
214 * constexpr.c (cx_check_missing_mem_inits): Clarify error message.
216 2014-11-14 Paolo Carlini <paolo.carlini@oracle.com>
218 * semantics.c (end_maybe_infinite_loop): Use fold_non_dependent_expr.
219 * parser.c (cp_parser_omp_clause_collapse): Likewise.
220 (cp_parser_enumerator_definition): Don't call
221 instantiate_non_dependent_expr...
222 * decl.c (build_enumerator): ... call fold_non_dependent_expr here.
223 * typeck2.c (massage_init_elt): Use fold_non_dependent_expr.
224 * constexpr.c (maybe_constant_value): Allow VIEW_CONVERT_EXPR in
225 the final gcc_assert.
227 * constexpr.c (fold_non_dependent_expr): Add.
228 * cp-tree.h (fold_non_dependent_expr): Declare it.
229 * call.c (null_ptr_cst_p): Use it.
230 * pt.c (tsubst_copy_and_build, build_non_dependent_expr): Likewise.
231 * semantics.c (begin_maybe_infinite_loop): Likewise.
232 * typeck.c (cp_build_binary_op): Likewise.
233 * typeck2.c (check_narrowing): Likewise.
235 * pt.c (fold_non_dependent_expr): Rename to
236 instantiate_non_dependent_expr.
237 (fold_non_dependent_expr_sfinae): Rename to
238 instantiate_non_dependent_expr_sfinae.
239 (convert_nontype_argument, build_non_dependent_expr): Adjust.
240 * decl.c (compute_array_index_type): Likewise.
241 * parser.c (cp_parser_parenthesized_expression_list,
242 cp_parser_enumerator_definition, cp_parser_omp_clause_collapse):
244 * semantics.c (end_maybe_infinite_loop, finish_static_assert):
246 * typeck.c (cxx_alignas_expr): Likewise.
247 * typeck2.c (store_init_value, massage_init_elt): Likewise.
248 * call.c: Adjust comments.
250 * constexpr.c: Likewise.
254 2014-11-14 Jonathan Wakely <jwakely@redhat.com>
256 * mangle.c (find_substitution): Look for abi_tag on class templates.
258 2014-11-13 Bernd Schmidt <bernds@codesourcery.com>
259 Thomas Schwinge <thomas@codesourcery.com>
260 Ilya Verbin <ilya.verbin@intel.com>
261 Andrey Turetskiy <andrey.turetskiy@intel.com>
263 * Make-lang.in (c++.install-common): Do not install for the offload
266 2014-11-13 Kai Tietz <ktietz@redhat.com>
268 * cp-tree.h (cp_build_function_call): Remove prototype.
269 (cp_build_addr_expr_strict): Likewise.
270 (build_typed_address): Likewise.
271 * typeck.c (build_typed_address): Removed.
272 (cp_build_addr_expr_strict): Make static.
273 (cp_build_function_call): Likewise.
275 2014-11-12 Paolo Carlini <paolo.carlini@oracle.com>
279 * cp-tree.h (struct cp_decl_specifier_seq): Add decltype_p bool field.
280 * decl.c (grokdeclarator): Use it.
281 * parser.c (cp_parser_simple_type_specifier): Likewise.
282 * pt.c (tsubst, case DECLTYPE_TYPE): Use tf_ignore_bad_quals.
284 2014-11-11 Paolo Carlini <paolo.carlini@oracle.com>
287 * pt.c (tsubst_copy_and_build, case COND_EXPR): Maybe fold to
288 constant the condition.
290 2014-11-10 Andi Kleen <ak@linux.intel.com>
292 * semantics.c (finish_goto_stmt): Call check_no_cilk.
293 (finish_while_stmt_cond): Dito.
294 (finish_do_stmt): Dito.
295 (finish_for_cond): Dito.
296 (finish_switch_cond): Dito.
298 2014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
300 * typeck.c (cp_build_binary_op): Use OPT_Wshift_count_negative and
301 OPT_Wshift_count_overflow in the warnings.
303 2014-11-09 Jason Merrill <jason@redhat.com>
306 * typeck.c (build_reinterpret_cast_1): reinterpret_cast to the
307 same scalar type is an rvalue.
310 * call.c (build_new_op_1): Don't do non-class lookup for =, -> or [].
312 2014-11-07 Jason Merrill <jason@redhat.com>
315 * pt.c (dependent_alias_template_spec_p): New.
316 (dependent_type_p_r): Handle dependent alias template specialization.
317 (template_args_equal): A dependent alias template specializations
318 is not equal to its underlying type as a template argument.
319 * tree.c (strip_typedefs): Don't strip a dependent alias
322 * parser.c (cp_parser_unqualified_id): Handle __func__ here.
323 (cp_parser_primary_expression): Not here.
325 2014-11-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
328 * decl.c (grokdeclarator): Fix __complex meaning __complex double.
330 2014-10-29 Richard Sandiford <richard.sandiford@arm.com>
332 * constexpr.c: Remove redundant enum from machine_mode.
334 2014-10-28 Jason Merrill <jason@redhat.com>
336 * constexpr.c (cxx_eval_outermost_constant_expr): Tweak.
338 2014-10-28 Andrew MacLeod <amacleod@redhat.com>
340 * call.c: Adjust include files.
349 * semantics.c: Ditto.
351 * vtable-class-hierarchy.c: Ditto.
353 2014-10-24 Jason Merrill <jason@redhat.com>
355 Implement N3653 (Member initializers and aggregates) and fix
356 references to 'this' in constexpr constructors.
357 * class.c (check_field_decls): In C++14 an NSDMI does not make the
359 * constexpr.c (struct constexpr_ctx): New.
360 (cxx_bind_parameters_in_call): Handle 'this'.
361 (cxx_eval_call_expression): Create new constexpr_ctx.
362 (cxx_eval_component_reference): Check CONSTRUCTOR_NO_IMPLICIT_ZERO.
363 (initialized_type, init_subob_ctx, verify_ctor_sanity): New.
364 (cxx_eval_bare_aggregate): Use them. Build CONSTRUCTOR early.
365 (cxx_eval_vec_init_1): Likewise.
366 (cxx_eval_constant_expression) [PARM_DECL]: Allow 'this'.
367 [TARGET_EXPR]: Build new constexpr_ctx.
368 [PLACEHOLDER_EXPR]: New.
369 (cxx_eval_outermost_constant_expr): Build new constexpr_ctx. Add
371 (is_sub_constant_expr): Build new constexpr_ctx.
372 (potential_constant_expression_1): Handle PLACEHOLDER_EXPR.
374 * cp-gimplify.c (cp_gimplify_init_expr): Call replace_placeholders.
375 * cp-tree.h (CONSTRUCTOR_NO_IMPLICIT_ZERO): New.
376 * error.c (dump_expr): Handle PLACEHOLDER_EXPR.
377 * init.c (get_nsdmi): Generate PLACEHOLDER_EXPR.
378 * tree.c (lvalue_kind): Handle PLACEHOLDER_EXPR.
379 (build_ctor_subob_ref, replace_placeholders): New.
380 * typeck2.c (store_init_value): Use replace_placeholders.
381 (process_init_constructor_record): Make zero-init before NSDMI
384 2014-10-27 Andrew MacLeod <amacleod@redhat.com>
386 * cp-gimplify.c: Adjust include files.
388 2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
391 * cp-objcp-common.c: Do not include new.
392 (cxx_initialize_diagnostics): Move from here to ...
393 * error.c (cxx_initialize_diagnostics): : ... here. Move
394 diagnostics initialization here from init_error.
395 (cxx_pp): Use a real pointer not a macro.
396 (init_error): Just initialize cxx_pp.
397 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer): Do
398 not set maximum line length.
400 2014-10-23 Jonathan Wakely <jwakely@redhat.com>
403 * decl2.c (delete_sanity): Use OPT_Wdelete_incomplete in warning.
405 2014-10-21 Paolo Carlini <paolo.carlini@oracle.com>
407 * parser.c (cp_parser_unary_expression): Add default arguments.
408 (cp_parser_cast_expression, cp_parser_sizeof_operand,
409 cp_parser_omp_atomic): Adjust.
411 2014-10-20 Jason Merrill <jason@redhat.com>
414 * lambda.c (current_nonlambda_function): New.
415 * semantics.c (finish_this_expr): Use it.
416 * cp-tree.h: Declare it.
418 2014-10-17 Alan Modra <amodra@gmail.com>
421 * decl.c (merge_decls): Don't merge section name, comdat group or
422 tls model to newdecl symtab node, instead merge to olddecl.
423 Override existing olddecl section name. Set tls_model for all
424 thread-local vars, not just OMP thread-private ones. Remove
427 2014-10-16 Andrew MacLeod <amacleod@redhat.com>
429 * cp-tree.h: Adjust include files.
431 2014-10-15 Jason Merrill <jason@redhat.com>
434 * pt.c (lookup_template_variable): Call coerce_template_parms.
436 2014-10-15 Paolo Carlini <paolo.carlini@oracle.com>
438 * semantics.c (is_instantiation_of_constexpr, literal_type_p,
439 ensure_literal_type_for_constexpr_object,
440 constexpr_fundef_hasher::equal, constexpr_fundef_hasher::hash,
441 retrieve_constexpr_fundef, is_valid_constexpr_fn,
442 build_anon_member_initialization, build_data_member_initialization,
443 check_constexpr_bind_expr_vars, check_constexpr_ctor_body_1,
444 check_constexpr_ctor_body, sort_constexpr_mem_initializers,
445 build_constexpr_constructor_member_initializers, constexpr_fn_retval,
446 massage_constexpr_body, cx_check_missing_mem_inits,
447 register_constexpr_fundef, explain_invalid_constexpr_fn,
448 constexpr_call_hasher::hash, constexpr_call_hasher::equal,
449 maybe_initialize_constexpr_call_table, get_function_named_in_call,
450 get_nth_callarg, lookup_parameter_binding,
451 cxx_eval_builtin_function_call, adjust_temp_type,
452 cxx_bind_parameters_in_call, push_cx_call_context,
453 pop_cx_call_context, cx_error_context, cxx_eval_call_expression,
454 reduced_constant_expression_p, verify_constant,
455 cxx_eval_unary_expression, cxx_eval_binary_expression,
456 cxx_eval_conditional_expression, cxx_eval_array_reference,
457 cxx_eval_component_reference, cxx_eval_bit_field_ref,
458 cxx_eval_logical_expression, base_field_constructor_elt,
459 cxx_eval_bare_aggregate, cxx_eval_vec_init_1, cxx_eval_vec_init,
460 cxx_fold_indirect_ref, cxx_eval_indirect_ref, non_const_var_error,
461 cxx_eval_trinary_expression, var_in_constexpr_fn,
462 cxx_eval_constant_expression, cxx_eval_outermost_constant_expr,
463 is_sub_constant_expr, cxx_constant_value, maybe_constant_value,
464 maybe_constant_init, potential_constant_expression_1,
465 potential_constant_expression, potential_rvalue_constant_expression,
466 require_potential_constant_expression,
467 require_potential_rvalue_constant_expression): Moved definitions...
468 * constexpr.c: ... here, new file.
469 * Make-lang.in: Update.
470 * config-lang.in: Likewise.
472 2014-10-14 Jason Merrill <jason@redhat.com>
475 * parser.c (struct saved_token_sentinel): New.
476 (cp_parser_statement): Use it.
477 (cp_parser_start_tentative_firewall): New.
478 (cp_parser_end_tentative_firewall): New.
479 (cp_parser_lambda_expression): Use them.
480 (cp_parser_statement_expr): New.
481 (cp_parser_primary_expression): Use it.
483 2014-10-14 DJ Delorie <dj@redhat.com>
485 * typeck.c (cp_common_type): Check for all __intN types, not just
487 * decl.c (grokdeclarator): Likewise.
488 * rtti.c (emit_support_tinfos): Check for all __intN types, not just
490 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
491 for all __intN types, not just __int128.
492 (cp_parser_simple_type_specifier): Likewise.
493 * mangle.c (integer_type_codes): Remove int128-specific codes.
494 * cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
495 __intN was specified.
496 * lex.c (init_reswords): Reserve all __intN keywords.
498 2014-10-14 Marc Glisse <marc.glisse@inria.fr>
500 * typeck.c (cp_build_unary_op) [TRUTH_NOT_EXPR]: Accept float vectors.
502 2014-10-13 H.J. Lu <hongjiu.lu@intel.com>
504 * mangle.c (mangle_conv_op_name_for_type): Cast elements to
506 (print_template_statistics): Cast size and elements to long.
508 2014-10-12 Trevor Saunders <tsaunders@mozilla.com>
510 * cp-gimplify.c, cp-tree.h, decl.c, mangle.c, name-lookup.c,
511 pt.c, semantics.c, tree.c, typeck2.c: Use hash_table instead of
514 2014-10-10 Jason Merrill <jason@redhat.com>
517 * class.c (build_base_path): Preserve rvalueness.
518 * call.c (convert_like_real) [ck_base]: Let convert_to_base handle &/*.
519 * rtti.c (build_dynamic_cast_1): Call convert_to_reference later.
522 * method.c (defaulted_late_check): Call maybe_instantiate_noexcept.
524 * method.c (implicitly_declare_fn): Handle deleted lambda default
525 ctor and copy assop here.
526 * class.c (check_bases_and_members): Not here.
527 (add_implicitly_declared_members): And don't set
528 CLASSTYPE_LAZY_MOVE_ASSIGN.
530 * semantics.c (finish_id_expression): Check for error_mark_node.
532 2014-10-09 Jason Merrill <jason@redhat.com>
535 * semantics.c (outer_var_p): Non-static.
536 (process_outer_var_ref): Split out from finish_id_expression.
537 * pt.c (tsubst_copy_and_build): Call them.
538 * cp-tree.h: Declare them.
540 2014-10-09 Paolo Carlini <paolo.carlini@oracle.com>
542 * semantics.c (check_constexpr_ctor_body_1): New.
543 (check_constexpr_ctor_body): Use it; add bool parameter.
544 (build_data_member_initialization): Handle BIND_EXPR and
545 USING_STMT in the main conditional.
546 (build_constexpr_constructor_member_initializers): Do not
547 handle BIND_EXPR here.
548 (constexpr_fn_retval): Handle BIND_EXPR in the switch.
549 (massage_constexpr_body): Don't do it here.
550 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
551 Adjust check_constexpr_ctor_body call.
552 (cp_parser_compound_statement): Do not pedwarn for compound-statement
553 in constexpr function in C++14 mode.
554 * cp-tree.h (check_constexpr_ctor_body): Update declaration.
556 2014-10-09 Jason Merrill <jason@redhat.com>
559 * parser.c (cp_parser_class_head): push_template_decl for members
563 * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
564 (iterative_hash_template_arg): Likewise.
567 * cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF.
568 * semantics.c (force_paren_expr): And set it.
569 * typeck.c (check_return_expr): And handle it.
571 2014-10-09 Marc Glisse <marc.glisse@inria.fr>
573 * decl.c (grokdeclarator): constexpr only implies const in C++11.
575 2014-10-08 Jason Merrill <jason@redhat.com>
578 * pt.c (tsubst_pack_expansion): Limit simple expansion to type packs.
581 * tree.c (build_cplus_array_type): Look for a type with no
582 typedef-name or attributes.
584 * call.c (call_copy_ctor): New.
585 (build_over_call): Use it to avoid infinite recursion on invalid code.
587 2014-10-07 Jason Merrill <jason@redhat.com>
589 * tree.c (cp_tree_equal) [TRAIT_EXPR]: Use cp_tree_equal for type2.
591 2014-10-06 Edward Smith-Rowland <3dw4rd@verizon.net>
593 * cp/parser.c: Allow [[deprecated]] for C++11. Issue a pedwarn.
595 2014-10-06 Paolo Carlini <paolo.carlini@oracle.com>
598 * semantics.c (check_constexpr_bind_expr_vars): New.
599 (check_constexpr_ctor_body, massage_constexpr_body): Use it.
600 (build_constexpr_constructor_member_initializers): Handle
601 BIND_EXPR in the main conditional.
603 2014-10-02 Mark Wielaard <mjw@redhat.com>
606 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
607 (cp_function_decl_deleted_p): New prototype.
608 * cp-objcp-common.c (cp_function_deleted_p): New function.
610 2014-10-03 Marc Glisse <marc.glisse@inria.fr>
615 * typeck.c (cp_build_binary_op): save_expr after convert to save
616 redundant operations.
617 [TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR]: Handle vectors.
618 (cp_build_unary_op) [TRUTH_NOT_EXPR]: Likewise.
620 2014-10-03 Jason Merrill <jason@redhat.com>
622 * decl.c (start_decl): Complain about static/thread_local vars
623 in constexpr function.
624 (check_for_uninitialized_const_var): Also uninitialized vars.
625 * parser.c (cp_parser_jump_statement): And gotos.
626 (cp_parser_asm_operand_list): And asm.
627 (cp_parser_try_block): And try.
628 * semantics.c (ensure_literal_type_for_constexpr_object): And
631 * semantics.c (constexpr_fn_retval): Ignore declarations in C++14.
632 (var_in_constexpr_fn): New.
633 (cxx_eval_constant_expression): Look into DECL_INITIAL.
634 (potential_constant_expression_1): Allow constexpr-local vars.
637 * tree.c (strip_typedefs): Handle TREE_LIST.
639 2014-10-03 Paolo Carlini <paolo.carlini@oracle.com>
641 * parser.c (cp_parser_assignment_expression,
642 cp_parser_constant_expression): Add default arguments.
643 (cp_parser_primary_expression,
644 cp_parser_postfix_open_square_expression,
645 cp_parser_parenthesized_expression_list,
646 cp_parser_question_colon_clause,
647 cp_parser_expression, cp_parser_constant_expression,
648 cp_parser_label_for_labeled_statement, cp_parser_static_assert,
649 cp_parser_template_argument, cp_parser_enumerator_definition,
650 cp_parser_member_declaration, cp_parser_constant_initializer,
651 cp_parser_noexcept_specification_opt, cp_parser_throw_expression,
652 cp_parser_std_attribute_spec, cp_parser_objc_message_args,
653 cp_parser_objc_class_ivars, cp_parser_omp_clause_collapse,
654 cp_parser_omp_clause_aligned, cp_parser_omp_clause_safelen,
655 cp_parser_omp_clause_simdlen, cp_parser_omp_clause_dist_schedule,
656 cp_parser_omp_for_incr, cp_parser_omp_for_loop_init,
657 cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear): Adjust.
659 2014-10-02 Paolo Carlini <paolo.carlini@oracle.com>
662 * cp-tree.h (struct saved_scope): Add noexcept_operand.
663 (cp_noexcept_operand): Define.
664 * call.c (build_over_call): Use it.
665 * parser.c (cp_parser_unary_expression, [RID_NOEXCEPT]): Likewise.
666 * pt.c (tsubst_copy_and_build, [NOEXCEPT_EXPR]): Likewise.
668 2014-10-01 Jason Merrill <jason@redhat.com>
671 * method.c (constructible_expr): Handle value-init of non-class.
672 * parser.c (cp_parser_trait_expr): Allow pack expansion.
673 * pt.c (tsubst_copy_and_build): Handle pack expansion.
676 * class.c (type_has_non_user_provided_default_constructor): Rename
677 from type_has_user_provided_default_constructor, reverse sense.
678 (default_init_uninitialized_part, explain_non_literal_class): Adjust.
679 (check_bases_and_members): Set TYPE_HAS_COMPLEX_DFLT.
680 * call.c (build_new_method_call_1): Adjust.
682 * decl.c (grok_special_member_properties): Don't set
683 TYPE_HAS_COMPLEX_DFLT.
684 * init.c (build_value_init_noctor): Don't use
685 type_has_user_provided_default_constructor.
687 2014-09-30 Jason Merrill <jason@redhat.com>
689 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_ASSIGNABLE and
690 CPTK_IS_TRIVIALLY_CONSTRUCTIBLE.
691 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
692 * parser.c (cp_parser_primary_expression): Likewise.
693 (cp_parser_trait_expr): Likewise. Handle variadic trait.
694 * semantics.c (trait_expr_value): Likewise.
695 (finish_trait_expr): Likewise.
696 (check_trait_type): Handle variadic trait. Return bool.
697 * method.c (build_stub_object): Add rvalue reference here.
698 (locate_fn_flags): Not here.
699 (check_nontriv, assignable_expr, constructible_expr): New.
700 (is_trivially_xible): New.
702 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_COPYABLE.
703 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
704 * parser.c (cp_parser_primary_expression): Likewise.
705 (cp_parser_trait_expr): Likewise.
706 * semantics.c (trait_expr_value): Likewise.
707 (finish_trait_expr): Likewise.
709 * method.c (build_stub_object): Use CONVERT_EXPR.
710 * tree.c (build_dummy_object): Likewise.
711 (is_dummy_object): Adjust.
713 * cp-tree.h (cp_trait_kind): Remove CPTK_IS_CONVERTIBLE_TO.
714 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
715 * semantics.c (trait_expr_value): Likewise.
716 (finish_trait_expr): Likewise.
717 * parser.c (cp_parser_primary_expression): Likewise.
718 (cp_parser_trait_expr): Likewise. Remove redundant grokdeclarator.
720 2014-09-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
723 * error.c (print_instantiation_context): Delete.
724 * typeck2.c (build_x_arrow): Record location when pushing
725 template instantiation.
726 * pt.c (push_tinst_level): Make it a wrapper around ...
727 (push_tinst_level_loc): ... this. New function. Make excessive
728 template instantiation depth a fatal error. Record location. Use
730 (instantiate_pending_templates): Make excessive
731 template instantiation depth a fatal error.
732 (problematic_instantiation_changed): Use bool as return type.
733 * cp-tree.h (print_instantiation_context): Delete.
734 (push_tinst_level): Update declaration.
735 (problematic_instantiation_changed): Likewise.
736 (push_tinst_level_loc): New.
738 2014-09-29 Richard Biener <rguenther@suse.de>
740 * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
743 2014-09-26 Jason Merrill <jason@redhat.com>
745 * mangle.c (find_substitution): Use write_abi_tags.
747 2014-09-25 Marek Polacek <polacek@redhat.com>
750 * class.c (warn_hidden): Check for FUNCTION_DECL.
752 2014-09-25 Jakub Jelinek <jakub@redhat.com>
755 * semantics.c (handle_omp_array_sections_1): Call mark_rvalue_use
756 on low_bound and length.
758 2014-09-24 Aldy Hernandez <aldyh@redhat.com>
760 * class.c, decl.c, optimize.c: Rename all instances of
761 DECL_ABSTRACT to DECL_ABSTRACT_P.
763 2014-09-24 Marek Polacek <polacek@redhat.com>
767 * semantics.c (finish_switch_cond): Call unlowered_expr_type.
768 * tree.c (bot_manip): Add default case.
769 * parser.c (cp_parser_primary_expression): Cast the controlling
770 expression of a switch to an int.
771 (cp_parser_unqualified_id): Likewise.
773 2014-09-23 Paolo Carlini <paolo.carlini@oracle.com>
776 * parser.c (cp_parser_skip_to_closing_square_bracket,
777 cp_parser_array_designator_p): New.
778 (cp_parser_initializer_list): Use the latter.
780 2014-09-22 Jason Merrill <jason@redhat.com>
782 * semantics.c (finish_non_static_data_member): In diagnostic, give
783 error at point of use and note at point of declaration.
788 * lambda.c (maybe_resolve_dummy, lambda_expr_this_capture): Handle
791 2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
794 * pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.
796 2014-09-22 Jason Merrill <jason@redhat.com>
798 * decl.c (poplevel): Don't warn about unused vars in template scope.
799 * error.c (dump_decl): Handle variable templates.
801 2014-09-20 Jason Merrill <jason@redhat.com>
804 * decl.c (begin_destructor_body): Only clobber the as-base part of
807 2014-09-19 Jason Merrill <jason@redhat.com>
810 * mangle.c (write_expression): Use unresolved-name mangling for
814 * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
815 after pulling out an element from a CONSTRUCTOR.
817 2014-09-18 Jakub Jelinek <jakub@redhat.com>
820 * semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
821 on type of type dependent expressions, and don't call it if
822 handle_omp_array_sections has kept TREE_LIST because something
824 * pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
825 Use keep_next_level, begin_omp_structured_block and
826 finish_omp_structured_block instead of push_stmt_list and
829 2014-09-18 Paolo Carlini <paolo.carlini@oracle.com>
832 * class.c (finish_struct_1): Do not -Wnon-virtual-dtor warn
833 for final class types.
835 2014-09-15 Jason Merrill <jason@redhat.com>
837 * pt.c (lookup_template_class_1): Splice out abi_tag attribute if
838 necessary. Call inherit_targ_abi_tags here.
839 * class.c (check_bases_and_members): Not here.
840 (inherit_targ_abi_tags): Check CLASS_TYPE_P.
841 * cp-tree.h: Declare inherit_targ_abi_tags.
843 2014-09-15 Ville Voutilainen <ville.voutilainen@gmail.com>
845 Do not diagnose lambda default arguments in c++14 modes.
846 * parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
849 2014-09-15 Jakub Jelinek <jakub@redhat.com>
851 * Make-lang.in (check_g++_parallelize): Change to just an upper bound
854 2014-09-13 Marek Polacek <polacek@redhat.com>
857 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: Set
858 location of a call expression.
860 2014-09-11 Jason Merrill <jason@redhat.com>
863 * decl.c (start_decl): Handle specialization of member variable
865 * pt.c (check_explicit_specialization): Adjust error.
867 2014-09-11 Paolo Carlini <paolo.carlini@oracle.com>
870 * typeck2.c (process_init_constructor_record): Do not warn about
871 missing field initializer if EMPTY_CONSTRUCTOR_P (init).
873 2014-09-11 Jason Merrill <jason@redhat.com>
876 * pt.c (tsubst_pack_expansion): Simplify substitution into T....
877 (tsubst): Don't throw away PACK_EXPANSION_EXTRA_ARGS.
879 2014-09-10 Jason Merrill <jason@redhat.com>
882 * decl.c (grokfndecl): Don't set DECL_COMDAT on static inlines.
883 (duplicate_decls, start_decl): Likewise.
884 * pt.c (check_explicit_specialization): Likewise.
885 (push_template_decl_real): Or static templates.
887 2014-09-08 Jason Merrill <jason@redhat.com>
889 * typeck.c (build_class_member_access_expr): Move
890 -Winvalid-offsetof code...
891 * semantics.c (finish_offsetof): ...here.
892 * parser.c (cp_parser_builtin_offsetof): Remember the location of
894 * pt.c (tsubst_copy_and_build) [OFFSETOF_EXPR]: Preserve it.
897 * pt.c (instantiate_decl): Handle recursive instantiation of
900 2014-09-05 Jason Merrill <jason@redhat.com>
903 * semantics.c (potential_constant_expression_1): Handle un-folded
904 pointer to member constants.
906 2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de>
909 * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
910 newdecl, not olddecl.
912 2014-09-02 Paolo Carlini <paolo.carlini@oracle.com>
915 * class.c (check_field_decls): A class of literal type cannot have
916 volatile non-static data members and base classes.
917 (explain_non_literal_class): Update.
919 2014-09-02 Jakub Jelinek <jakub@redhat.com>
920 Balaji V. Iyer <balaji.v.iyer@intel.com>
921 Igor Zamyatin <igor.zamyatin@intel.com>
923 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
925 * parser.c (cp_parser_cilk_for): New function.
926 (cp_parser_cilk_grainsize): Likewise.
927 (cp_parser_statement): Added RID_CILK_FOR case.
928 (cp_parser_omp_for_cond): Added CILK_FOR check.
929 (cp_parser_omp_for_loop_init): Change function argument to accept
930 tree_code instead just a bool flag; change the check to use that
931 tree_code; check for initialization declaration in case of Cilk_for.
932 (cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
933 changed call to cp_parser_omp_for_loop_init according new arguments'
935 (cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
936 * pt.c (tsubst_expr): Added CILK_FOR case.
937 * semantics.c: Include convert.h.
938 (finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
939 case; added OMP_CLAUSE__CILK_FOR_COUNT_.
940 (handle_omp_for_class_iterator): New argument lastp and its usage;
942 (finish_omp_for): Changed call to handle_omp_for_class_iterator
943 according new arguments' list; in case of Cilk_for save very first
944 decl and create empty stmt_list block; use block to build correct
947 2014-08-31 Jason Merrill <jason@redhat.com>
950 * optimize.c (cdtor_comdat_group): Just look at the
951 DECL_ASSEMBLER_NAME of the 'tors.
953 2014-08-27 Paolo Carlini <paolo.carlini@oracle.com>
956 * semantics.c (cxx_eval_call_expression): Use STRIP_NOPS on the
957 result of cxx_eval_constant_expression.
959 2014-08-26 Jason Merrill <jason@redhat.com>
962 * pt.c (tsubst_decl) [VAR_DECL]: Copy TLS model.
963 (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
964 * semantics.c (finish_id_expression): Don't call TLS wrapper in a
967 2014-08-25 Jason Merrill <jason@redhat.com>
969 * pt.c (check_explicit_specialization): Don't complain about
970 non-template variable.
971 (template_for_substitution): Allow variable templates.
972 (check_template_variable): Fix logic for member var template.
973 * decl.c (start_decl): Don't complain about extra template header
976 * decl.c (start_decl): Look through member variable template.
977 * pt.c (tsubst_decl) [VAR_DECL]: Handle member variable templates.
978 * decl2.c (grokfield): Set DECL_CONTEXT earlier on
981 2014-08-25 Paolo Carlini <paolo.carlini@oracle.com>
984 * cp-tree.h (TFF_POINTER): Add.
985 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): Forward the third
987 * error.c (dump_type_suffix): Actually print the const and noreturn
988 attribute when appropriate.
990 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
992 * decl.c (compute_array_index_type, grokdeclarator,
993 undeduced_auto_decl): Change from cxx1y to cxx14.
994 *lambda.c(add_capture()): Change error message from C++1y to C++14.
995 * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
996 cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
997 cp_parser_decltype, cp_parser_conversion_type_id,
998 cp_parser_simple_type_specifier, cp_parser_type_id_1,
999 cp_parser_template_type_arg, cp_parser_std_attribute,
1000 cp_parser_template_declaration_after_export): Ditto.
1001 * pt.c (tsubst): Ditto.
1002 * semantics.c (force_paren_expr, finish_decltype_type): Ditto.
1003 * tree.c: Change comment.
1004 * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
1005 cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
1007 2014-08-23 Jason Merrill <jason@redhat.com>
1009 Allow non-constexpr variable templates.
1010 * decl2.c (note_variable_template_instantiation): New.
1011 * cp-tree.h: Declare it.
1012 * pt.c (instantiate_decl): Call it.
1013 (push_template_decl_real): Allow non-constexpr variable templates.
1014 * semantics.c (finish_id_expression): Mark the variable template
1015 instantiation as used.
1016 * mangle.c (write_mangled_name): Variable template instantiations
1018 * parser.c (cp_parser_init_declarator): Complain about
1019 non-function implicit templates.
1021 2014-08-22 Marek Polacek <polacek@redhat.com>
1024 * parser.c (cp_parser_binary_expression): Check each LHS if it's
1025 preceded with logical not. Adjust call to
1026 warn_logical_not_parentheses.
1028 2014-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1031 * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
1032 declaration shadows a function declaration, unless the former
1033 declares a function, pointer to function or pointer to member
1034 function, because this is a common and valid case in real-world
1036 * cp-tree.h (TYPE_PTRFN_P,TYPE_REFFN_P,TYPE_PTRMEMFUNC_P):
1037 Improve description.
1039 2014-08-22 Jason Merrill <jason@redhat.com>
1042 * class.c (outermost_open_class): Fix logic.
1043 * decl.c (complete_vars): Fix logic.
1045 2014-08-22 Jason Merrill <jason@redhat.com>
1048 * class.c (outermost_open_class): New.
1049 * cp-tree.h: Declare it.
1050 * decl.c (maybe_register_incomplete_var): Use it.
1051 (complete_vars): Handle any constant variable.
1052 * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
1054 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
1057 * cp-array-notation.c (build_array_notation_ref): Added correct
1058 handling of case with incorrect array.
1060 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1063 * error.c (cp_diagnostic_finalizer): Delete.
1064 (init_error): Do not set diagnostic_finalizer here.
1066 2014-08-19 Marek Polacek <polacek@redhat.com>
1069 * call.c (build_new_op_1): Remember the type of arguments for
1070 a comparison. If either operand of a comparison is a boolean
1071 expression, call maybe_warn_bool_compare.
1073 2014-08-19 Jason Merrill <jason@redhat.com>
1075 PR tree-optimization/62091
1076 * decl2.c (decl_needed_p): Return true for virtual functions when
1081 * decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
1084 2014-08-19 Gerald Pfeifer <gerald@pfeifer.com>
1086 * class.c (contains_empty_class_p): Remove.
1088 2014-08-18 Paolo Carlini <paolo.carlini@oracle.com>
1090 * parser.c (cp_parser_expression): Add default arguments.
1091 (cp_parser_primary_expression, cp_parser_postfix_expression,
1092 cp_parser_array_notation, cp_parser_postfix_open_square_expression,
1093 cp_parser_unary_expression, cp_parser_direct_new_declarator,
1094 cp_parser_question_colon_clause, cp_parser_assignment_operator_opt,
1095 cp_parser_lambda_body, cp_parser_expression_statement,
1096 cp_parser_condition, cp_parser_c_for, cp_parser_range_for,
1097 cp_parser_iteration_statement, cp_parser_jump_statement,
1098 cp_parser_decltype_expr, cp_parser_noexcept_specification_opt,
1099 cp_parser_asm_operand_list, cp_parser_objc_message_receiver,
1100 cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement,
1101 cp_parser_omp_var_list_no_open, cp_parser_omp_clause_num_threads,
1102 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
1103 cp_parser_omp_clause_linear, cp_parser_omp_clause_device,
1104 cp_parser_omp_atomic, cp_parser_omp_for_loop_init,
1105 cp_parser_omp_for_loop, cp_parser_omp_declare_reduction_exprs,
1106 cp_parser_transaction_expression): Adjust.
1108 2014-08-15 Jason Merrill <jason@redhat.com>
1111 * pt.c (lookup_template_class_1): Revert recent change.
1112 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Revert recent change.
1115 * pt.c (instantiate_class_template_1): Ignore lambda on
1116 CLASSTYPE_DECL_LIST.
1117 (push_template_decl_real): A lambda is not primary.
1118 (lookup_template_class_1): Don't look for a lambda partial
1120 * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
1121 currently in a function and the lambda living in a function.
1122 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
1124 2014-08-15 Richard Biener <rguenther@suse.de>
1125 Jason Merrill <jason@redhat.com>
1128 * tree.c (build_min_array_type, set_array_type_canon): Split out...
1129 (build_cplus_array_type): ...from here. Only call build_array_type
1132 2014-08-15 Paolo Carlini <paolo.carlini@oracle.com>
1136 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1140 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1141 cv-qualifiers of function types.
1143 2014-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1145 * call.c (build_conditional_expr_1): Use OPT_Wextra in warning.
1147 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1149 * typeck.c (composite_pointer_type, cxx_sizeof_or_alignof_type,
1150 cp_build_array_ref, cp_build_function_call_vec): When a
1151 pedwarn is suppressed under SFINAE, return error_mark_node.
1153 * typeck.c (cxx_sizeof_or_alignof_type): Fix complain &
1154 tf_warning_or_error, where complain is a bool, glitch.
1156 2014-08-14 Ville Voutilainen <ville.voutilainen@gmail.com>
1159 * decl.c (grokdeclarator): Move the check for friend initializers..
1160 * decl2.c (grokfield) ..here. Postpone early return for friends
1161 until after the initializer check.
1163 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1166 * pt.c (coerce_template_parms): Improve error message vs default
1169 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1171 * parser.c (cp_parser_init_declarator): Remove redundant check of
1172 decl_specifiers->type.
1174 2014-08-13 Jason Merrill <jason@redhat.com>
1176 * call.c (build_x_va_arg): Support passing non-POD through ....
1177 (convert_arg_to_ellipsis): Likewise.
1179 2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
1181 * pt.c (lookup_template_variable): Make dependent variable templates
1184 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1186 * parser.c (cp_parser_elaborated_type_specifier): Handle
1187 specially cp_parser_template_id returning a BASELINK.
1189 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1191 * parser.c (cp_parser_diagnose_invalid_type_name,
1192 cp_parser_make_typename_type): Remove scope parameter.
1193 (cp_parser_parse_and_diagnose_invalid_type_name,
1194 cp_parser_elaborated_type_specifier): Adjust calls.
1196 2014-08-12 Ville Voutilainen <ville.voutilainen@gmail.com>
1198 Reject virt-specifiers on friends and member templates
1199 * friend.c (do_friend): Diagnose virt-specifiers.
1200 * pt.c (push_template_decl_real): Diagnose virt-specifiers.
1202 2014-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1204 * typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
1205 return type to bool; in C++11 for constants give errors, not pedwarns.
1206 * cp-tree.h (check_narrowing): Adjust declaration.
1207 * call.c (convert_like_real): Update calls.
1208 * semantics.c (finish_compound_literal): Likewise.
1210 2014-08-08 Jason Merrill <jason@redhat.com>
1212 * pt.c (lookup_template_class_1): Copy abi_tag.
1214 2014-08-08 Kai Tietz <ktietz@redhat.com>
1216 * semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
1217 that we operate on a true inline.
1219 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1221 * class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
1222 optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
1224 2014-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1227 * decl.c (build_enumerator): Handle class types with conversion
1228 operators via perform_implicit_conversion_flags and
1229 build_expr_type_conversion.
1231 * cvt.c (build_expr_type_conversion): Replace pair of errors
1232 with error + inform.
1234 2014-08-07 Jason Merrill <jason@redhat.com>
1237 * parser.c (c_parse_file): Change sorry to fatal_error.
1240 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
1242 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1244 * cp-tree.h, pt.c: Use hash_map instead of pointer_map.
1246 2014-08-06 Jason Merrill <jason@redhat.com>
1248 * init.c (build_vec_init): Fix constant initialization of
1250 (build_value_init_noctor): Call maybe_constant_init.
1251 * semantics.c (maybe_constant_init): See through EXPR_STMT and
1255 * init.c (build_vec_init): Reorganize earlier change a bit.
1258 * init.c (build_vec_init): Leave atype an ARRAY_TYPE
1259 if we're just returning an INIT_EXPR.
1261 2014-08-06 Jason Merrill <jason@redhat.com>
1262 Braden Obrzut <admin@maniacsvault.net>
1264 * pt.c (check_explicit_specialization): Don't test
1265 DECL_DECLARED_INLINE_P for a variable template.
1267 2014-08-06 Paolo Carlini <paolo.carlini@oracle.com>
1270 * typeck.c (cp_build_binary_op): Extend to more cases the
1273 2014-08-01 Braden Obrzut <admin@maniacsvault.net>
1275 Implement constexpr variable templates
1276 * decl.c (grokvardecl): Handle specializations of variable templates.
1277 (grokdeclarator): Handle variable template id expressions and NULL_TREE
1278 return from grokvardecl.
1279 * decl2.c (check_member_template): Allow declaration of template member
1281 * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for
1283 * pt.c (check_template_variable): Accept variable temploids at
1285 (push_template_decl_real): The current instantiation of a template
1287 (determine_specialization): Accept variable templates.
1288 (check_explicit_specialization): Handle and check for malformed
1289 variable template specializations.
1290 (lookup_template_variable): New.
1291 (tsubst_decl): Handle variable template specializations.
1292 (do_decl_instantiation): Handle template variables.
1293 (instantiate_decl): Handle template variables.
1294 * semantics.c (finish_template_variable): New.
1295 (finish_id_expression): Instantiate variable templates.
1296 * cp-tree.h (variable_template_p): New.
1298 2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1301 * decl.c (check_redeclaration_no_default_args): New.
1302 (duplicate_decls): Use it, handle default arguments
1303 in redeclarations of function templates.
1305 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1307 * optimize.c, semantics.c: Use hash_map instead of pointer_map.
1309 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1311 * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
1312 method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
1313 instead of pointer_set.
1315 2014-08-01 Jason Merrill <jason@redhat.com>
1318 * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
1319 init-list for trailing elements.
1320 * typeck2.c (process_init_constructor_array): Likewise.
1322 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1325 * decl.c (duplicate_decls): Handle static member functions too.
1327 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1329 * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
1332 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1335 * parser.c (cp_parser_array_notation): Added check for array_type.
1337 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1340 * cp-array-notation.c (expand_array_notation_exprs): Handling of
1341 DECL_EXPR improved. Changed handling for INIT_EXPR.
1343 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1345 * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P.
1347 2014-08-01 Jakub Jelinek <jakub@redhat.com>
1349 * cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
1350 -fsanitize=alignment call ubsan_maybe_instrument_reference
1351 for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
1352 for calls to member functions.
1354 2014-07-31 Marc Glisse <marc.glisse@inria.fr>
1357 * typeck.c (maybe_warn_about_returning_address_of_local): Return
1358 whether it is returning the address of a local variable.
1359 (check_return_expr): Return 0 instead of the address of a local
1362 2014-07-30 Jason Merrill <jason@redhat.com>
1366 * pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
1368 2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1371 * pt.c (unify_arity): Add boolean parameter.
1372 (unify_too_few_arguments): Likewise.
1373 (type_unification_real): Diagnose correctly insufficient
1374 arguments in the presence of trailing variadic parameters;
1375 deducing multiple trailing packs as empty is fine.
1377 2014-07-30 Jason Merrill <jason@redhat.com>
1382 * decl2.c (mark_all_virtuals): New variable.
1383 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1384 (cp_write_global_declarations): Set it and give helpful diagnostic
1385 if it introduces errors.
1386 * class.c (finish_struct_1): Check it.
1390 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
1391 (check_explicit_specialization): Clear it on specializations.
1392 * decl.c (duplicate_decls, start_decl): Likewise.
1393 (grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
1394 * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
1395 linkage after setting the appropriate flags.
1396 * tree.c (decl_linkage): Don't check DECL_COMDAT.
1397 * decl2.c (mark_needed): Mark clones.
1398 (import_export_decl): Not here.
1400 2014-07-25 Edward Smith-Rowland <3dw4rd@verizon.net>
1402 Implement N4051 - Allow typename in a template template parameter
1403 * parser.c (cp_parser_type_parameter_key): New funtion;
1404 (cp_parser_token_is_type_parameter_key): Ditto;
1405 (cp_parser_type_parameter): Look for type-parameter-key for all versions
1406 but pedwarn for less than cxx1z.
1408 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1411 * call.c (standard_conversion): Use resolve_nondeduced_context
1412 for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
1414 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1417 * parser.c (cp_parser_tokens_start_cast_expression): Return -1
1420 2014-07-15 Jason Merrill <jason@redhat.com>
1423 * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
1427 * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
1428 * class.c (finish_struct): Reject invalid definition of
1429 std::initializer_list.
1431 2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
1433 * call.c (convert_like_real): Call print_z_candidate and inform only
1434 if permerror returns true.
1436 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
1438 * class.c (build_clone): Do not clear assembler names of
1440 * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
1441 * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
1442 as a special case return sizeof (struct tree_decl_non_common)
1444 (cp_common_init_ts): Do not initialize NAMESPACE_DECL;
1445 initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
1446 * cp/cp-tree.h (tree_template_decl): New structure.
1447 (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
1448 (union cp_lang_tree_node): Add template_decl.
1449 (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
1451 2014-07-14 Jason Merrill <jason@redhat.com>
1455 * pt.c (instantiate_decl): Don't check defer_ok for local class
1458 2014-07-14 Jakub Jelinek <jakub@redhat.com>
1461 * cp-tree.h (LITERAL_ZERO_P): Define.
1462 * parser.c (cp_parser_parenthesized_expression_list): Add
1463 want_literal_zero_p argument, if true, for literal zeros
1464 insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
1465 (cp_parser_postfix_expression): Adjust
1466 cp_parser_parenthesized_expression_list caller, handle
1467 -Wmemset-transposed-args.
1468 (literal_zeros): New variable.
1470 2014-07-13 Jason Merrill <jason@redhat.com>
1473 * semantics.c (is_instantiation_of_constexpr): Return true for
1474 defaulted functions, too.
1475 (explain_invalid_constexpr_fn): Only use
1476 explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P.
1477 * method.c (explain_implicit_non_constexpr): Pass
1478 DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr.
1481 * decl.c (check_initializer): Don't finish_compound_literal
1482 on erroneous constexpr init.
1485 * tree.c (bot_replace): Only replace a dummy 'this' parm.
1488 * decl.c (create_array_type_for_decl): Only check for auto once.
1491 * call.c (build_list_conv): Don't try to build a list of references.
1493 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
1495 PR C++/60209 - Declaration of user-defined literal operator cause error
1496 * parser.c (cp_parser_operator): Fold treatment of strings
1497 and user-defined string literals. Use the full string parser.
1498 (cp_parser_string_literal): Add flag to not look for literal operator.
1500 2014-07-11 Jason Merrill <jason@redhat.com>
1504 * call.c (build_conditional_expr_1): Avoid reading freed memory.
1506 2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
1509 * call.c (build_user_type_conversion_1): Copy LOOKUP_NO_NARROWING
1511 * decl.c (check_initializer): Don't call check_narrowing here,
1512 set LOOKUP_NO_NARROWING.
1513 * typeck2.c (digest_init_r): Likewise.
1515 2014-07-10 Jason Merrill <jason@redhat.com>
1518 * semantics.c (reduced_constant_expression_p): Handle CONSTRUCTOR.
1522 * decl2.c (mark_all_virtuals): New variable.
1523 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1524 (cp_write_global_declarations): Set it and give helpful diagnostic
1525 if it introduces errors.
1526 * class.c (finish_struct_1): Check it.
1527 * decl.c (grokdeclarator): Clear virtualp after 'virtual auto' error.
1529 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1532 * decl.c (grokdeclarator): Adjust error messages about 'explicit'
1533 outside class declaration, in friend declaration, and neither on
1534 constructor nor conversion operator.
1536 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1540 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1541 cv-qualifiers of function types.
1543 2014-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
1544 Paolo Carlini <paolo.carlini@oracle.com>
1547 * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
1550 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
1552 * class.c (check_for_override): Wrap the 'final' and 'override'
1553 keywords in %< and %>.
1555 2014-07-06 Marek Polacek <polacek@redhat.com>
1558 * cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
1559 * decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
1560 * typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
1563 2014-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1565 * pt.c (convert_template_argument): Use inform instead of error in
1568 2014-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1573 * parser.c (cp_parser_userdef_string_literal): Take a tree
1575 (cp_parser_string_literal): Don't hack the token stream.
1577 2014-06-30 Jason Merrill <jason@redhat.com>
1581 * decl2.c (maybe_emit_vtables): Mark all vtable entries if
1583 * init.c (build_vtbl_address): Don't mark destructor.
1584 * class.c (finish_struct_1): Add all classes to keyed_classes
1588 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
1591 * mangle.c (decl_mangling_context): Look through a TEMPLATE_DECL.
1593 * decl.c (build_ptrmemfunc_type): Don't give a PMF RECORD_TYPE
1594 TYPE_BINFO or TYPE_LANG_SPECIFIC.
1595 * cp-tree.h (TYPE_PTRMEMFUNC_FLAG): Use TYPE_LANG_FLAG_2.
1596 (TYPE_PTRMEMFUNC_P): Don't expect TYPE_LANG_SPECIFIC.
1597 * typeck.c (build_ptrmemfunc_access_expr): Don't use lookup_member.
1598 * pt.c (unify): Also check whether the argument is a PMF.
1600 2014-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1603 * parser.c (cp_parser_tokens_start_cast_expression): In C++11
1604 a '[' can also start a primary-expression.
1605 (cp_parser_cast_expression): Parse a cast-expression only tentatively
1606 when cp_parser_tokens_start_cast_expression returns -1.
1608 2014-06-30 Jason Merrill <jason@redhat.com>
1611 * pt.c (unify_one_argument): Type/expression mismatch just causes
1614 * semantics.c (simplify_aggr_init_expr): Remove remnants of
1617 2014-06-30 Marek Polacek <polacek@redhat.com>
1619 * cp-gimplify.c (cp_genericize): Don't instrument returns if the
1620 function has no_sanitize_undefined attribute.
1621 * decl.c (compute_array_index_type): Don't instrument VLAs if the
1622 function has no_sanitize_undefined attribute.
1624 2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
1627 * cp-array-notation.c (expand_sec_reduce_builtin):
1628 Check that bultin argument is correct.
1629 * call.c (build_cxx_call): Check for 0 arguments in builtin call.
1631 2014-06-28 Jonathan Wakely <jwakely@redhat.com>
1635 * typeck.c (check_return_expr): Lookup as an rvalue even when the
1636 types aren't the same.
1638 2014-06-27 Jason Merrill <jason@redhat.com>
1641 * error.c (dump_template_bindings): Don't tsubst in a clone.
1643 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1646 * semantics.c (finish_compound_literal): Revert r204228.
1648 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1650 * parser.c (cp_parser_compound_literal_p): New.
1651 (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it.
1653 2014-06-26 Jason Merrill <jason@redhat.com>
1655 * parser.c (cp_parser_for_init_statement): Change range-for error
1658 N3994 Ranged-based for-loops: The Next Generation
1659 * parser.c (cp_lexer_nth_token_is): New.
1660 (cp_parser_for_init_statement): Allow "for (id : init)".
1662 2014-06-26 Teresa Johnson <tejohnson@google.com>
1664 * class.c (dump_class_hierarchy): Use saved dump files.
1665 (dump_vtable): Ditto.
1668 2014-06-26 Adam Butcher <adam@jessamine.co.uk>
1671 * parser.c (cp_parser_elaborated_type_specifier): Only consider template
1672 parameter lists outside of function parameter scope.
1674 2014-06-25 Paolo Carlini <paolo.carlini@oracle.com>
1678 * typeck2.c (process_init_constructor_record): Do not complain about
1679 uninitialized const members, because within aggregate-initialization,
1680 members without explicit initializers are value-initialized.
1682 2014-06-25 Jakub Jelinek <jakub@redhat.com>
1684 * semantics.c (finish_omp_clauses): Make sure
1685 OMP_CLAUSE_LINEAR_STEP has correct type.
1687 2014-06-24 Jan Hubicka <hubicka@ucw.cz>
1689 * class.c (check_methods, create_vtable_ptr, determine_key_method,
1690 add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by
1691 FUNCTION_DECL check.
1692 * cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
1693 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
1694 (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
1695 (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
1697 2014-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1700 * decl.c (grokdeclarator): Do not early check for operator-function-id
1703 2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
1705 * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
1708 2014-06-24 Jakub Jelinek <jakub@redhat.com>
1710 * parser.c (cp_parser_omp_for_loop): For
1711 #pragma omp parallel for simd move lastprivate clause from parallel
1712 to for rather than simd.
1714 2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
1718 * decl.c (grokparms): Accept a single parameter of type 'void'.
1720 2014-06-20 Jason Merrill <jason@redhat.com>
1723 * call.c (add_function_candidate): Avoid special 'this' handling
1724 if we have a ref-qualifier.
1727 * call.c (build_over_call): Call build_this in template path.
1729 2014-06-19 Jason Merrill <jason@redhat.com>
1732 * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
1734 2014-06-18 Jason Merrill <jason@redhat.com>
1737 * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
1738 ref-qualifier handling.
1741 * pt.c (resolve_overloaded_unification): Preserve
1742 ARGUMENT_PACK_EXPLICIT_ARGS.
1744 2014-06-18 Jakub Jelinek <jakub@redhat.com>
1746 * cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
1748 * cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
1750 2014-06-17 Jason Merrill <jason@redhat.com>
1753 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
1755 2014-06-15 Jason Merrill <jason@redhat.com>
1758 * pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
1761 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
1763 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1765 * decl.c (grokvardecl): Fix pasto in previous patch.
1767 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1769 * decl.c (duplicate_decls): Use set_decl_tls_model.
1770 (grokdeclarator): Likewise.
1771 * semantics.c (finish_id_expression): Check TLS only for
1773 (finish_omp_threadprivate): Use decl_default_tls_model.
1774 * decl2.c (get_guard): Likewise.
1775 * call.c (make_temporary_var_for_ref_to_temp): Likewise.
1777 2014-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1780 * decl.c (grokparms): Improve error message about void parameters.
1781 * error.c (type_to_string): Fix aka cut off code.
1783 2014-06-12 Jason Merrill <jason@redhat.com>
1785 * call.c (convert_arg_to_ellipsis): Use abi_version_crosses.
1786 * cvt.c (type_promotes_to): Likewise.
1787 * mangle.c (write_type, write_expression): Likewise.
1788 (write_name, write_template_arg): Likewise.
1789 (mangle_decl): Make alias based on flag_abi_compat_version.
1790 Emit -Wabi warning here.
1791 (finish_mangling_internal): Not here. Drop warn parm.
1792 (finish_mangling_get_identifier, finish_mangling): Adjust.
1793 (mangle_type_string, mangle_special_for_type): Adjust.
1794 (mangle_ctor_vtbl_for_type, mangle_thunk): Adjust.
1795 (mangle_guard_variable, mangle_tls_init_fn): Adjust.
1796 (mangle_tls_wrapper_fn, mangle_ref_init_variable): Adjust.
1798 * call.c (build_operator_new_call): Remove -fabi-version=1 support.
1799 * class.c (walk_subobject_offsets, include_empty_classes): Likewise.
1800 (layout_nonempty_base_or_field, end_of_class): Likewise.
1801 (layout_empty_base, build_base_field, layout_class_type): Likewise.
1802 (is_empty_class, add_vcall_offset_vtbl_entries_1): Likewise.
1803 (layout_virtual_bases): Likewise.
1804 * decl.c (compute_array_index_type): Likewise.
1805 * mangle.c (write_mangled_name, write_prefix): Likewise.
1806 (write_template_prefix, write_integer_cst, write_expression): Likewise.
1807 (write_template_arg, write_array_type): Likewise.
1808 * method.c (lazily_declare_fn): Likewise.
1809 * rtti.c (get_pseudo_ti_index): Likewise.
1810 * typeck.c (comp_array_types): Likewise.
1812 2014-06-11 Jan Hubicka <hubicka@ucw.cz>
1814 * vtable-class-hierarchy.c: Update handling for section names
1815 that are no longer trees.
1816 * decl.c (duplicate_decls): Likewise.
1818 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1821 * parser.c (cp_parser_init_declarator): Actually pass friend_p
1822 to cp_parser_declarator.
1824 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1827 * parser.c (cp_parser_using_declaration): Handle unscoped enums.
1828 * name-lookup.c (validate_nonmember_using_decl): Adjust error
1831 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1834 * parser.c (cp_parser_declarator): Add bool parameter.
1835 (cp_parser_direct_declarator): Likewise, use it.
1836 (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
1837 (cp_parser_condition, cp_parser_explicit_instantiation,
1838 cp_parser_init_declarator, cp_parser_type_id_1,
1839 cp_parser_parameter_declaration, cp_parser_exception_declaration,
1840 cp_parser_cache_defarg, cp_parser_objc_class_ivars,
1841 cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
1843 * decl.c (grokdeclarator): Fix handling of friend declared in
1844 namespace scope (g++.dg/parse/friend10.C).
1846 2014-06-10 Jan Hubicka <hubicka@ucw.cz>
1848 * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)
1850 * optimize.c (cdtor_comdat_group): Fix handling of aliases.
1851 (maybe_clone_body): Move symbol across comdat groups.
1852 * method.c (use_thunk): Copy implicit section flag.
1854 2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1857 * name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
1859 2014-06-07 Jan Hubicka <hubicka@ucw.cz>
1861 * method.c (use_thunk): Use set_decl_section_name.
1862 * optimize.c (maybe_clone_body): Use set_decl_section_name.
1863 * decl.c (duplicate_decls): Likewise.
1864 * vtable-class-hierarchy.c: Likewise.
1866 2014-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1869 * class.c (check_field_decls): In C++11 mode do not reject
1870 static data members and reference-type members in unions.
1872 2014-06-05 Jason Merrill <jason@redhat.com>
1875 * decl.c (check_initializer): Collapse a TREE_LIST here.
1876 * typeck2.c (store_init_value): Not here.
1878 2014-06-05 Richard Biener <rguenther@suse.de>
1879 Paolo Carlini <paolo.carlini@oracle.com>
1882 * cp-gimplify.c (cp_gimplify_expr, [MODIFY_EXPR]): Rework
1883 handling of empty classes.
1885 2014-06-04 Jason Merrill <jason@redhat.com>
1887 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
1888 for noexcept and thread_local, too.
1891 * decl.c (check_initializer): Maybe clear
1892 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1894 2014-06-05 Richard Biener <rguenther@suse.de>
1897 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
1898 warnings for accessing empty classes.
1900 2014-06-05 Marek Polacek <polacek@redhat.com>
1903 * parser.c (cp_parser_binary_expression): Warn when logical not is
1904 used on the left hand side operand of a comparison.
1906 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1909 * typeck.c (cp_build_modify_expr): Handle array of characters
1910 initialized by a string literal.
1911 * decl.c (check_initializer): Handle parenthesized string literal
1913 * typeck2.c (store_init_value): Remove redundant check.
1915 2014-06-04 Jason Merrill <jason@redhat.com>
1919 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
1920 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
1922 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
1925 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
1928 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1932 * call.c (standard_conversion): Convert nullptr to bool only
1933 in case of direct-initialization.
1934 (convert_like_real): Provide informative error message.
1936 2014-06-03 Marek Polacek <polacek@redhat.com>
1939 * semantics.c (finish_switch_cond): Warn if switch condition has
1942 2014-06-03 Jason Merrill <jason@redhat.com>
1945 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
1946 variable to local_specializations.
1949 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
1951 2014-06-02 Jason Merrill <jason@redhat.com>
1954 * decl.c (reshape_init_class): Handle un-folded
1955 constant-expressions.
1958 * pt.c (pack_deducible_p): Handle canonicalization.
1960 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1962 * pt.c (tsubst_function_type): Initialize arg_types.
1964 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
1967 * class.c (handle_using_decl): Pass the correct scope to
1968 cp_emit_debug_info_for_using.
1970 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
1974 * search.c (accessible_p): Use current_nonlambda_class_type.
1975 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1977 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
1979 * decl.c: Include builtins.h.
1980 * semantics.c: Likewise.
1982 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1986 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
1987 * pt.c (tsubst_function_type): Inject the this parameter; do the
1988 substitutions in the order mandated by the DR.
1989 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
1990 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
1991 (static_fn_type): Copy it.
1992 * decl2.c (build_memfn_type, change_return_type,
1993 cp_reconstruct_complex_type): Likewise.
1994 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
1995 * tree.c (strip_typedefs): Likewise.
1996 * typeck.c (merge_types): Likewise.
1998 2014-05-30 Jason Merrill <jason@redhat.com>
2001 * pt.c (instantiate_decl): Check that defer_ok is not set for
2002 local class members.
2005 * pt.c (tsubst_init): Split out from...
2006 (tsubst_expr) [DECL_EXPR]: Here.
2007 (tsubst_copy) [VAR_DECL]: Use it.
2008 * semantics.c (finish_id_expression): Return the decl for static/const.
2010 2014-05-28 Jason Merrill <jason@redhat.com>
2013 * decl.c (cxx_comdat_group): Return a decl.
2014 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
2016 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
2020 * call.c (build_aggr_conv): Ignore passed in flags.
2021 (build_array_conv, build_complex_conv): Likewise.
2023 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2025 * optimize.c (maybe_thunk_body): Use set_comdat_group.
2026 (maybe_clone_body): Likewise.
2027 * decl.c (duplicate_decls): Update code duplicating comdat group;
2028 do not copy symtab pointer; before freeing newdecl remove it
2030 * decl2.c (constrain_visibility): Use set_comdat_group.
2032 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2034 * rtti.c: Include tm_p.h
2035 (emit_tinfo_decl): Force RTTI data to be aligned to required
2038 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2040 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
2041 ignoring other target adjustments.
2043 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
2045 * semantics.c (finish_omp_clauses): Remove duplicated variable
2048 * parser.c (cp_parser_omp_target): Return bool values.
2050 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2053 * lambda.c (add_capture): Enforce that capture by value requires
2055 * typeck2.c (cxx_incomplete_type_inform): Early return if
2056 TYPE_MAIN_DECL is null.
2058 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
2061 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
2063 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2066 * lambda.c (build_capture_proxy, add_capture): Treat normal
2067 captures and init-captures identically.
2069 2014-05-21 Mark Wielaard <mjw@redhat.com>
2072 * cp-lang.c (cxx_enum_underlying_base_type): New function.
2073 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
2075 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2077 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
2078 * cp-array-notation.c (replace_invariant_exprs): Likewise.
2079 (expand_array_notation): Handle VOID_CST.
2080 * error.c (dump_expr): Likewise.
2081 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
2082 (cxx_pretty_printer::expression): Likewise.
2083 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
2084 * decl.c (register_dtor_fn): Likewise.
2085 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
2086 (build_delete, push_base_cleanups): Likewise.
2087 * mangle.c (write_expression): Likewise.
2088 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
2089 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
2090 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
2091 * tree.c (cp_tree_equal): Likewise.
2092 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
2093 instead of void_zero_node.
2094 * typeck.c (check_return_expr): Likewise.
2095 * typeck2.c (build_functional_cast): Likewise.
2097 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
2100 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
2102 (cp_parser_statement): ...here. Make sure only semicolon can go after
2105 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2110 * typeck2.c (digest_nsdmi_init): New.
2111 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
2112 * init.c (get_nsdmi): Likewise.
2113 * cp-tree.h (digest_nsdmi_init): Declare.
2115 2014-05-20 Jason Merrill <jason@redhat.com>
2117 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
2118 up a virtual function in a dummy object.
2120 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2123 * decl.c (duplicate_decls): Replace pair of warning_at with
2124 warning_at + inform.
2125 (maybe_commonize_var): Likewise.
2127 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2130 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
2131 (tsubst_copy_and_build): Perform recursive substitutions in a
2132 deterministic order.
2134 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2137 * typeck2.c (cxx_incomplete_type_inform): New.
2138 (cxx_incomplete_type_diagnostic): Use it.
2139 * decl.c (grokdeclarator): Check the element type of an
2140 incomplete array type; call the above.
2141 * cp-tree.h (cxx_incomplete_type_inform): Declare.
2143 2014-05-19 Jason Merrill <jason@redhat.com>
2146 * pt.c (tsubst_copy): Don't check at_function_scope_p.
2147 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
2149 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
2151 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
2152 * parser.c (cp_parser_enum_specifier): Likewise.
2154 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
2156 * class.c (sorted_fields_type_new): Adjust.
2157 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
2158 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
2159 * cp-tree.h: Remove usage of variable_size gty attribute.
2160 * decl.c (make_label_decl): Adjust.
2161 (check_goto): Likewise.
2162 (start_preparsed_function): Likewise.
2163 (save_function_data): Likewise.
2164 * lex.c (init_reswords): Likewise.
2165 (retrofit_lang_decl): Likewise.
2166 (cxx_dup_lang_specific_decl): Likewise.
2167 (copy_lang_type): Likewise.
2168 (cxx_make_type): Likewise.
2169 * name-lookup.c (binding_entry_make): Likewise.
2170 (binding_table_construct): Likewise.
2171 (binding_table_new): Likewise.
2172 (cxx_binding_make): Likewise.
2173 (pushdecl_maybe_friend_1): Likewise.
2174 (begin_scope): Likewise.
2175 (push_to_top_level): Likewise.
2176 * parser.c (cp_lexer_alloc): Likewise.
2177 (cp_lexer_new_from_tokens): Likewise.
2178 (cp_token_cache_new): Likewise.
2179 (cp_parser_context_new): Likewise.
2180 (cp_parser_new): Likewise.
2181 (cp_parser_nested_name_specifier_opt): Likewise.
2182 (cp_parser_template_id): Likewise.
2183 * pt.c (maybe_process_partial_specialization): Likewise.
2184 (register_specialization): Likewise.
2185 (add_pending_template): Likewise.
2186 (lookup_template_class_1): Likewise.
2187 (push_tinst_level): Likewise.
2188 * semantics.c (register_constexpr_fundef): Likewise.
2189 (cxx_eval_call_expression): Likewise.
2190 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
2192 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
2195 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
2196 when cp_parser_lookup_name sets ambiguous_decls.
2198 2014-05-15 Jason Merrill <jason@redhat.com>
2200 * call.c (print_conversion_rejection): Use loc consistently.
2202 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2204 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
2205 * call.c (convert_like_real, build_new_method_call_1): Use it.
2206 * decl2.c (grokfield): Likewise.
2207 * init.c (perform_member_init, build_aggr_init, expand_default_init,
2208 build_new_1): Likewise.
2209 * mangle.c (write_expression): Likewise.
2210 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
2212 2014-05-14 Jason Merrill <jason@redhat.com>
2216 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
2217 dropped cv-quals as a bad conversion.
2218 (convert_like_real) [ck_ref_bind]: Explain them.
2219 (compare_ics): Check badness before stripping reference
2220 bindings. Handle comparing bad reference bindings.
2221 * typeck.c (comp_cv_qualification): Add overload that just takes
2223 * cp-tree.h: Declare it.
2225 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
2226 (arg_conversion_rejection, bad_arg_conversion_rejection)
2227 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
2228 (add_function_candidate): Pass actual argument, rather than type, to
2229 bad_arg_conversion_rejection.
2230 (print_conversion_rejection): Explain what's wrong with the conversion.
2231 (print_z_candidates): Say "candidate:" before each candidate.
2232 (splice_viable): Be strict if we see a viable or template candidate.
2233 (build_user_type_conversion_1): Pass false to strict parameter.
2234 (perform_overload_resolution, build_conditional_expr_1): Likewise.
2235 (build_new_op_1, build_new_method_call_1): Likewise.
2236 (build_op_call_1): Pass true to strict parameter.
2238 2014-05-13 Jason Merrill <jason@redhat.com>
2240 * call.c (print_error_for_call_failure): Say "no match" rather
2241 than "ambiguous" if there were no strict matches.
2242 (build_new_method_call_1): Likewise.
2245 * semantics.c (is_this_parameter): Allow capture proxies too.
2247 2014-05-12 Jason Merrill <jason@redhat.com>
2249 * call.c (maybe_print_user_conv_context): New.
2250 (convert_like_real): Use it. Print call context for bad
2251 user-defined conversion.
2252 (build_over_call): Print call context for bad 'this' conversion.
2254 * call.c (convert_like_real): Use inform for identifying the
2257 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
2259 * cvt.c (cp_convert_to_pointer): Don't call error_at if
2260 complain & tf_error is false.
2262 * decl.c (make_unbound_class_template): Prefer inform for
2263 "declared here"-type message.
2265 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
2269 * lambda.c (lambda_expr_this_capture): Add new parameter
2270 add_capture_p controlling whether the functions will try to
2271 capture 'this' via the default capture.
2272 (maybe_resolve_dummy): Likewise.
2273 * cp-tree.h: Adjust prototypes.
2274 * call.c, semantics.c: Change callers of these functions.
2275 * call.c (build_new_method_call_1): Use the actual 'this' that
2276 would be potentially captured for the overload resolution, instead
2277 of the dummy object.
2279 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2281 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
2283 (convert_nontype_argument): Adjust calls.
2284 (coerce_template_parameter_pack): Add missing complain & tf_error
2287 2014-05-09 Jason Merrill <jason@redhat.com>
2291 * call.c (build_conditional_expr_1, conditional_conversion): Handle
2292 non-class lvalues and xvalues that differ only in cv-qualifiers.
2296 * call.c (build_user_type_conversion_1): The copy-init temporary
2300 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
2303 * call.c (build_conditional_expr_1): If overload resolution finds
2304 no match, just say "different types".
2307 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
2310 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
2311 if we didn't find a conversion.
2312 Don't accept a bad conversion too early.
2314 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2317 * typeck.c (convert_for_assignment): Provide an inform for pointers
2318 to incomplete class types.
2320 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2323 * pt.c (convert_nontype_argument): Protect all the error calls
2324 with complain & tf_error.
2326 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2329 * pt.c (instantiate_decl): Avoid generating the body of a
2332 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2335 * pt.c (maybe_begin_member_template_processing): Use
2336 uses_template_parms.
2338 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
2339 Mike Stump <mikestump@comcast.net>
2340 Richard Sandiford <rdsandiford@googlemail.com>
2342 * call.c: Include wide-int.h.
2343 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2344 (convert_for_arg_passing): Likewise.
2345 * class.c: Include wide-int.h.
2346 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
2347 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2348 (include_empty_classes): Likewise
2349 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
2350 * cvt.c: Include wide-int.h.
2351 (ignore_overflows): Use wide_int_to_tree.
2352 * decl.c: Include wide-int.h.
2353 (check_array_designated_initializer): Use wide-int interfaces.
2354 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
2355 (finish_enum_value_list): Use signop.
2356 (build_enumerator): Use wide-int interfaces.
2357 * init.c: Include wide-int.h.
2358 (build_new_1): Use wide-int interfaces.
2359 * mangle.c: Include wide-int.h.
2360 (write_integer_cst): Use wide-int interfaces.
2361 (write_array_type): Likewise.
2362 * tree.c: Include wide-int.h.
2363 (cp_tree_equal): Use tree_int_cst_equal.
2364 * typeck2.c: Include wide-int.h.
2365 (process_init_constructor_array): Use wide-int interfaces.
2367 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2370 * decl.c (grokfndecl): Check duplicate_decls return value for
2372 * pt.c (instantiate_decl): A deleted function is defined.
2374 2014-05-02 Jason Merrill <jason@redhat.com>
2376 * decl2.c (vague_linkage_p): Local statics have vague linkage.
2379 * lambda.c (lambda_capture_field_type): Wrap anything dependent
2381 (add_capture): Check for VLA before calling it.
2382 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
2383 just the current one. Make non-static.
2384 * cp-tree.h: Declare it.
2385 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
2386 the operand was static or constant.
2388 2014-05-02 Marek Polacek <polacek@redhat.com>
2390 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
2393 2014-05-01 Marek Polacek <polacek@redhat.com>
2396 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
2397 between label and variable when warning about returning local address.
2399 2014-04-30 Jason Merrill <jason@redhat.com>
2402 * init.c (build_value_init): Don't try to call an array constructor.
2405 * typeck2.c (massage_init_elt): Use maybe_constant_init.
2407 2014-04-30 Marek Polacek <polacek@redhat.com>
2409 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
2410 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
2411 for non-integer types.
2413 2014-04-29 Jason Merrill <jason@redhat.com>
2416 Represent the unevaluated exception specification of an implicitly
2417 declared or deleted function with a simple placeholder, not a list
2419 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
2420 * except.c (unevaluated_noexcept_spec): New.
2421 * class.c (deduce_noexcept_on_destructor): Use it.
2422 * decl.c (check_redeclaration_exception_specification): Call
2423 maybe_instantiate_noexcept.
2424 (duplicate_decls): Call it before merge_types.
2425 (start_preparsed_function): Call maybe_instantiate_noexcept.
2426 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
2427 * init.c (get_nsdmi): Factor out of perform_member_init.
2428 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
2429 (walk_field_subobs): Consider NSDMI for EH spec.
2430 (get_defaulted_eh_spec): New.
2431 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
2432 (defaulted_late_check): Defer EH checking in non-template classes.
2433 (after_nsdmi_defaulted_late_checks): New.
2434 * parser.c (cp_parser_class_specifier_1): Use it.
2435 (unparsed_classes): New macro.
2436 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
2437 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
2438 Remove list-of-functions handling.
2439 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
2440 handling and FN parameter.
2441 * typeck.c (merge_types): Adjust.
2443 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2446 * parser.c (cp_parser_alias_declaration): Check return value of
2449 2014-04-24 Jakub Jelinek <jakub@redhat.com>
2451 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
2452 atomic-clause, allow comma in between atomic-clause and
2455 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
2458 * rtti.c (emit_support_tinfos): Do not iterate on
2459 registered_builtin_types (partial revert).
2461 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
2464 * semantics.c (apply_deduced_return_type): Complete non-void type
2465 before estimating whether the type is aggregate.
2467 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
2470 * rtti.c (emit_support_tinfo_1): New function, extracted from
2471 emit_support_tinfos.
2472 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
2474 2014-04-22 Jakub Jelinek <jakub@redhat.com>
2477 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
2478 fails, don't set OM_PARALLEL_COMBINED and return NULL.
2480 2014-04-18 Jason Merrill <jason@redhat.com>
2483 * call.c (reference_binding): Recurse on user-defined conversion.
2486 * call.c (standard_conversion): Don't try to apply restrict to void.
2488 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
2490 * decl.c (reshape_init_r): Handle a single element of vector type.
2492 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2495 * decl2.c (cplus_decl_attributes): Handle
2496 pointer-to-member-function declarations.
2498 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2501 * call.c (build_user_type_coversion): Use build_dummy_object
2502 to create the placeholder object for a constructor method call.
2503 (build_special_member_call): Likewise.
2504 (build_over_call): Check for the placeholder object with
2506 (build_new_method_call_1): Likewise. Don't attempt to resolve
2507 a dummy object for a constructor method call.
2509 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
2512 * friend.c (add_friend, make_friend_class): Move repeated friend
2513 warning under Wredundant_decls.
2515 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
2517 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
2518 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2519 (do_class_using_decl): Likewise.
2520 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
2522 2014-04-15 Jakub Jelinek <jakub@redhat.com>
2525 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
2527 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2529 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
2531 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2533 * pt.c (mark_template_parm): Use template_parm_level_and_index.
2535 2014-04-11 Jason Merrill <jason@redhat.com>
2537 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
2539 (cp_lexer_get_preprocessor_token): Always clear it.
2540 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
2544 * decl.c (reshape_init_r): Handle a single element of class type.
2547 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
2548 built-in operator new.
2550 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2553 * name-lookup.c (parse_using_directive): Return early if the
2554 attribs argument is error_mark_node; use get_attribute_name.
2556 2014-04-11 Jason Merrill <jason@redhat.com>
2560 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
2561 * call.c (struct z_candidate): Add flags field.
2562 (add_candidate): Add flags parm.
2563 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
2564 (add_template_candidate_real): Pass it.
2565 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
2566 * tree.c (build_aggr_init_expr): Copy it.
2567 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
2569 2014-04-10 Richard Biener <rguenther@suse.de>
2570 Jakub Jelinek <jakub@redhat.com>
2573 * error.c (dump_decl) <case FUNCTION_DECL>: If
2574 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
2575 recurse on DECL_ABSTRACT_ORIGIN instead of printing
2578 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
2580 * pt.c (check_template_variable): Check for the return of pedwarn
2581 before emitting a note.
2582 * parser.c (cp_parser_lambda_introducer): Likewise.
2584 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2587 * pt.c (process_template_parm): For an invalid non-type parameter
2588 only set TREE_TYPE to error_mark_node.
2589 (push_inline_template_parms_recursive, comp_template_parms,
2590 redeclare_class_template, coerce_template_template_parm,
2591 coerce_template_template_parms, unify): Use error_operand_p.
2593 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
2595 * class.c (check_bases_and_members): Warn about non-virtual dtors
2596 in public bases only. Check warn_ecpp before complaining about
2597 non-polymorphic bases.
2599 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2601 * decl.c (duplicate_decls): Check for the return of warning_at
2602 before emitting a note.
2603 (warn_misplaced_attr_for_class_type): Likewise.
2604 (check_tag_decl): Likewise.
2606 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
2609 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
2611 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
2614 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
2615 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
2616 instantiating a variable-sized type.
2619 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
2621 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2623 * class.c (find_abi_tags_r): Check for the return of warning
2624 before emitting a note.
2625 (one_inherited_ctor): Likewise.
2627 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2629 * decl.c (duplicate_decls): Check for the return of permerror
2630 before emitting a note.
2632 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
2634 * class.c (accessible_nvdtor_p): New.
2635 (check_bases): Don't check base destructor here ...
2636 (check_bases_and_members): ... check them here. Trigger on
2637 Wnon-virtual-dtor flag.
2638 (finish_struct_1): Use accessible_nvdtor_p.
2640 2014-04-01 Jason Merrill <jason@redhat.com>
2642 * pt.c (process_partial_specialization): Say "not deducible"
2643 rather than "not used". Use inform.
2646 * pt.c (coerce_template_parms): Check that the pack expansion
2647 pattern works with the first matching parameter.
2649 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
2651 * init.c (perform_member_init): Homogenize uninitialized
2654 2014-04-01 Jason Merrill <jason@redhat.com>
2657 * call.c (build_array_conv): Call complete_type.
2660 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
2661 (picflag_from_initializer): Return it.
2662 (process_init_constructor): Handle it.
2665 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
2666 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
2667 * pt.c (get_template_info): Handle NAMESPACE_DECL.
2668 (most_general_template): Handle more kinds of template.
2669 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
2670 instantiations and specializations.
2672 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
2675 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
2676 COMPONENT_REFs and ARRAY_REFs sooner.
2678 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
2681 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
2682 usage in non-functions with pushed scope.
2684 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
2687 * name-lookup.h (cp_binding_level): New transient field defining_class_p
2688 to indicate whether a scope is in the process of defining a class.
2689 * semantics.c (begin_class_definition): Set defining_class_p.
2690 * name-lookup.c (leave_scope): Reset defining_class_p.
2691 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
2692 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
2693 unwinding to class-defining scope to handle the erroneous definition of
2694 a generic function of an arbitrarily nested class within an enclosing
2697 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
2700 * method.c (walk_field_subobs): Improve the diagnostic
2701 locations for both REFERENCE_TYPEs and non-static const members.
2702 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
2703 instead of %qD to be consistent with the c++11 diagnostic.
2705 2014-03-25 Jason Merrill <jason@redhat.com>
2709 * class.c (build_vtbl_initializer): Handle abstract dtors here.
2710 * search.c (get_pure_virtuals): Not here.
2713 * parser.c (cp_parser_lambda_expression): Don't parse the body of
2714 a lambda in unevaluated context.
2717 * decl.c (create_array_type_for_decl): Complain about array of auto.
2719 2014-03-25 Jakub Jelinek <jakub@redhat.com>
2722 * semantics.c (potential_constant_expression_1): Handle
2725 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
2728 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
2729 introducing an implicit function template parameter within an explicit
2732 2014-03-22 Jason Merrill <jason@redhat.com>
2735 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
2738 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2741 * name-lookup.c (push_class_level_binding_1): Check identifier_p
2742 on the name argument.
2744 2014-03-20 Jakub Jelinek <jakub@redhat.com>
2747 * init.c (build_zero_init_1): Ignore fields with error_mark_node
2750 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2753 * call.c (build_new_method_call_1): Handle pure virtuals called by
2756 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
2759 * parser.c (cp_parser_member_declaration): Don't allow
2760 finish_fully_implicit_template to consider friend declarations to be
2761 class member templates.
2762 (synthesize_implicit_template_parm): Handling winding back through class
2763 scope to the class being defined in order to inject a template argument
2767 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
2768 function scope as per cp_parser_skip_to_end_of_statement.
2770 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2773 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
2775 2014-03-14 Jason Merrill <jason@redhat.com>
2779 * search.c (get_pure_virtuals): Handle abstract dtor here.
2780 (dfs_get_pure_virtuals): Not here.
2783 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
2784 abstract class as pure.
2786 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2789 * pt.c (maybe_process_partial_specialization): Check return value
2790 of check_specialization_namespace.
2792 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2795 * semantics.c (finish_static_assert): Call cxx_constant_value only
2796 if require_potential_rvalue_constant_expression returns true.
2798 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
2801 * method.c (get_inherited_ctor): New.
2802 * cp-tree.h (get_inherited_ctor): Declare it.
2803 * semantics.c (is_valid_constexpr_fn): Use it.
2805 2014-03-10 Jason Merrill <jason@redhat.com>
2808 * call.c (convert_default_arg): Remove special handling for
2812 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
2813 when deciding whether to call push_template_decl for a member class.
2814 * pt.c (push_template_decl_real): Return after wrong levels error.
2816 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
2819 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
2820 lambda, remove the lambda's own template argument list prior to fetching
2824 * parser.c (cp_parser_parameter_declaration_clause): Move generic
2825 function template unwinding on error into a more general location, ...
2826 (cp_parser_skip_to_end_of_statement): ... here.
2828 2014-03-07 Jason Merrill <jason@redhat.com>
2830 * Make-lang.in (check_g++_parallelize): Split dg.exp.
2832 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
2833 we're in a trailing return type.
2835 * typeck.c (comp_template_parms_position): 'auto' and
2836 'decltype(auto)' are different from real template parms.
2838 * parser.c (cp_parser_using_declaration): Consume the semicolon
2839 after bare parameter pack error.
2841 * cp-tree.h (REF_PARENTHESIZED_P): New.
2842 * semantics.c (force_paren_expr): Set it.
2843 * pt.c (do_auto_deduction): Check it.
2844 (tsubst) [COMPONENT_REF]: Copy it.
2845 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
2847 * decl.c (create_array_type_for_decl): Only warn about invalid
2848 C++1y VLA if flag_iso or warn_vla>0.
2849 (grokdeclarator): Likewise.
2850 * pt.c (tsubst): Likewise.
2851 * semantics.c (finish_decltype_type): Likewise.
2852 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
2853 (cp_build_addr_expr_1): Likewise.
2854 * init.c (build_new_1): Improve diagnostics.
2856 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2859 * decl.c (check_initializer): Return NULL_TREE after error;
2860 consistently use inform.
2862 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2864 * decl.c (check_initializer): Remove dead code.
2866 2014-03-06 Marek Polacek <polacek@redhat.com>
2869 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
2870 of checking tree code.
2872 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2874 * parser.c (cp_lexer_set_source_position): New.
2875 (cp_parser_mem_initializer): Use it.
2876 (cp_parser_postfix_open_square_expression): Likewise.
2877 (cp_parser_parenthesized_expression_list): Likewise.
2878 (cp_parser_new_initializer): Likewise.
2879 (cp_parser_jump_statement): Likewise.
2880 (cp_parser_initializer): Likewise.
2881 (cp_parser_functional_cast): Likewise.
2883 2014-03-05 Jason Merrill <jason@redhat.com>
2886 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
2887 dependent expression.
2890 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
2891 if re-parsing might succeed.
2892 * semantics.c (finish_id_expression): Use of a parameter outside
2893 the function body is a parse error.
2895 * parser.c (cp_parser_mem_initializer): Set input_location
2896 properly for init-list warning.
2897 (cp_parser_postfix_open_square_expression): Likewise.
2898 (cp_parser_parenthesized_expression_list): Likewise.
2899 (cp_parser_new_initializer): Likewise.
2900 (cp_parser_jump_statement): Likewise.
2901 (cp_parser_initializer): Likewise.
2902 (cp_parser_functional_cast): Likewise.
2904 2014-03-04 Jason Merrill <jason@redhat.com>
2907 * typeck2.c (process_init_constructor_record): Set
2908 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
2912 * parser.c (cp_parser_direct_declarator): Set declarator to
2913 cp_error_declarator on invalid qualified-id.
2915 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
2918 * parser.c (cp_parser_using_declaration): Early return when
2919 cp_parser_nested_name_specifier errors out.
2921 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
2924 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
2925 function scope on parse error in function parameter list.
2927 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
2929 * method.c (implicitly_declare_fn): Remove redundant
2930 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
2931 * semantics.c (is_instantiation_of_constexpr): Likewise.
2932 * error.c (dump_function_decl): Likewise.
2934 2014-03-01 Jason Merrill <jason@redhat.com>
2937 * semantics.c (begin_maybe_infinite_loop): Use
2938 fold_non_dependent_expr_sfinae.
2940 2014-02-28 Jason Merrill <jason@redhat.com>
2943 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
2945 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
2948 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
2949 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
2950 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2952 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2955 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
2958 2014-02-27 Jason Merrill <jason@redhat.com>
2962 * decl2.c (tentative_decl_linkage): Don't mess with functions that
2963 are not yet defined.
2965 2014-02-26 Jason Merrill <jason@redhat.com>
2969 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
2970 * init.c (build_vtbl_address): Do it here.
2976 * pt.c (struct warning_sentinel): New.
2977 (tsubst_copy_and_build): Use it instead of
2978 c_inhibit_evaluation_warnings.
2979 * typeck.c (maybe_warn_about_useless_cast): Remove
2980 c_inhibit_evaluation_warnings check.
2983 * pt.c (get_template_parm_index): New.
2984 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
2985 (process_template_parm): Allow bare packs in template template
2986 parm template parms.
2987 (coerce_template_parameter_pack): Handle fixed template template
2988 parm packs and fixed packs not at the end of the parm list.
2989 (coerce_template_parms): Handle template parm packs not at the end
2991 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
2994 * pt.c (unify): Ignore alias templates when deducing a template
3000 * call.c (reference_binding): Recurse on user-defined conversion.
3001 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3003 2014-02-25 Jason Merrill <jason@redhat.com>
3006 * call.c (reference_binding): Recurse on user-defined conversion.
3007 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3009 * call.c (print_conversion_rejection): Handle n_arg of -2.
3010 (build_user_type_conversion_1): Pass it.
3013 * decl2.c (no_linkage_error): Handle C++98 semantics.
3014 (reset_type_linkage): Move from decl.c.
3015 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
3016 (bt_reset_linkage_2, reset_decl_linkage): New.
3017 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
3018 (cp_write_global_declarations): Move condition into no_linkage_error.
3019 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
3020 * semantics.c (expand_or_defer_fn_1): Factor out
3021 tentative_decl_linkage.
3022 * cp-tree.h: Adjust.
3024 * decl2.c (finish_static_data_member_decl): Diagnose static data
3025 member in unnamed class.
3026 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
3029 * class.c (clone_function_decl): Call note_vague_linkage_fn for
3030 defaulted virtual dtor.
3034 * pt.c (get_underlying_template): Fix equivalence calculation.
3036 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
3039 * parser.c (function_being_declared_is_template_p): Return false when
3040 processing a template parameter list.
3041 (cp_parser_parameter_declaration_clause): Don't set
3042 auto_is_implicit_function_template_parm_p when processing a
3043 template parameter list.
3045 * parser.c (synthesize_implicit_template_parm): Inject new template
3046 argument list appropriately when a generic member function
3047 of a class template is declared out-of-line.
3050 * parser.c (cp_parser_direct_declarator): Don't save and
3051 restore num_template_parameter_lists around call to
3052 cp_parser_parameter_declaration_list.
3053 (function_being_declared_is_template_p): New predicate.
3054 (cp_parser_parameter_declaration_list): Use
3055 function_being_declared_is_template_p as predicate for
3056 inspecting current function template parameter list length
3057 rather than num_template_parameter_lists.
3059 2014-02-24 Jason Merrill <jason@redhat.com>
3062 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
3063 DECL_EXPR initialize a non-class iterator.
3066 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
3068 2014-02-21 Jason Merrill <jason@redhat.com>
3071 * parser.c (cp_parser_type_name): Always check dependency.
3072 (cp_parser_type_specifier_seq): Call
3073 cp_parser_parse_and_diagnose_invalid_type_name.
3076 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
3079 * parser.c (cp_parser_default_argument): Clear
3080 current_class_ptr/current_class_ref like tsubst_default_argument.
3083 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
3084 than current_binding_level.
3087 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
3090 * parser.c (cp_parser_enum_specifier): Call
3091 check_for_bare_parameter_packs.
3094 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
3098 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
3099 of the partial instantiation, not the most general template.
3100 (maybe_process_partial_specialization): Reassign everything on
3104 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
3105 (check_explicit_specialization): Don't clone.
3108 * pt.c (coerce_template_parms): Bail if argument packing fails.
3111 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
3112 Don't get confused by a CONSTRUCTOR that already has a type.
3115 * call.c (build_array_conv): Don't crash on VLA.
3118 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
3121 * lambda.c (maybe_resolve_dummy): Don't try to capture this
3122 in declaration context.
3126 * pt.c (unify): Only unify if deducible. Handle 0-length list.
3129 * parser.c (cp_parser_direct_declarator): Don't wrap a
3130 type-dependent expression in a NOP_EXPR.
3133 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
3138 * parser.c (cp_parser_template_argument): Restore dereference.
3139 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
3140 (process_partial_specialization): Handle deref.
3143 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
3147 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
3148 implicit_template_scope upon leaving an out-of-line generic member
3149 function definition.
3151 2014-02-20 Kai Tietz <ktietz@redhat.com>
3154 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
3155 valued type argument as error_mark_node.
3158 * semantics.c (finish_fname): Handle error_mark_node.
3160 2014-02-19 Jason Merrill <jason@redhat.com>
3163 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
3164 spec from template context.
3166 2014-02-19 Jakub Jelinek <jakub@redhat.com>
3169 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
3170 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
3173 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
3175 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3178 * semantics.c (ensure_literal_type_for_constexpr_object): Use
3181 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3184 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
3185 During error recovery allow_non_constant may be false.
3187 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
3190 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
3191 scope whenever a template parameter list has been started, independent
3192 of whether the function call operator was well-formed or not.
3195 * parser.c (cp_parser_member_declaration): Pop fully implicit template
3196 scope for generic friend declarations as well as for non-friends.
3198 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
3201 * method.c (implicitly_declare_fn): A constructor of a class with
3202 virtual base classes isn't constexpr (7.1.5p4).
3204 2014-02-05 Jan Hubicka <hubicka@ucw.cz
3206 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
3208 2014-02-05 Jakub Jelinek <jakub@redhat.com>
3211 * parser.c (cp_parser_omp_declare_reduction): Save and free
3214 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
3218 * tree.c (handle_init_priority_attribute): Call default_conversion on
3219 the attribute argument.
3221 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
3224 * method.c (synthesized_method_walk): If vbases is non-null but
3225 is_empty is true, likewise don't worry about the virtual bases.
3227 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
3230 * typeck2.c (process_init_constructor_record): Just skip unnamed
3233 2014-01-31 Jason Merrill <jason@redhat.com>
3236 * pt.c (mark_decl_instantiated): Call mark_needed.
3239 * decl2.c (handle_tls_init): Handle null init fn.
3242 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
3244 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
3247 * class.c (build_vfield_ref): Early return error_mark_node if
3248 TYPE_VFIELD (type) is null.
3249 (build_base_path): Check return value of build_vfield_ref.
3251 2014-01-31 Jason Merrill <jason@redhat.com>
3254 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
3255 [ck_list]: Check for error_mark_node.
3256 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
3259 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
3260 during partial ordering.
3262 2014-01-31 Marek Polacek <polacek@redhat.com>
3265 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
3267 2014-01-30 Jason Merrill <jason@redhat.com>
3270 * cp-tree.h (struct saved_scope): Add x_local_specializations.
3271 (local_specializations): New macro.
3272 * pt.c (local_specializations): Remove variable.
3274 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
3277 * parser.c (make_string_pack): Use double_int::from_buffer.
3279 2014-01-30 Marek Polacek <polacek@redhat.com>
3282 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
3284 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
3285 with input_location.
3286 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
3289 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3292 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
3294 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3297 * pt.c (lookup_template_class_1): Check start_enum return value
3298 for error_mark_node.
3300 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3302 * decl.c (duplicate_decls, typename_hash, typename_compare):
3303 Use TYPE_IDENTIFIER.
3304 * error.c (dump_type): Likewise.
3305 * mangle.c (dump_substitution_candidates): Likewise.
3307 2014-01-30 Jason Merrill <jason@redhat.com>
3310 * decl2.c (attributes_naming_typedef_ok): New.
3311 * cp-tree.h: Declare it.
3312 * decl.c (grokdeclarator): Check it.
3313 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
3315 2014-01-29 Jason Merrill <jason@redhat.com>
3318 * call.c (add_builtin_candidate): Catch dependent types.
3321 * pt.c (expand_template_argument_pack): Correct
3322 non_default_args_count calculation.
3325 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
3328 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
3329 have a friend template in a class template.
3330 * pt.c (tsubst_friend_function): Look through it.
3331 (push_template_decl_real): A friend member template is
3334 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3337 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
3340 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3343 * pt.c (instantiate_template_1): Check for error_mark_node the second
3346 2014-01-29 Jason Merrill <jason@redhat.com>
3349 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
3350 cdtor_returns_this case.
3353 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
3355 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3358 * semantics.c (finish_omp_reduction_clause): Check type for
3361 2014-01-28 Jason Merrill <jason@redhat.com>
3364 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
3365 (tsubst_copy): Use it if lookup fails.
3368 * pt.c (tsubst_function_type): Make sure we keep the same function
3372 * semantics.c (build_anon_member_initialization): Stop walking
3373 when we run out of COMPONENT_REFs.
3376 * decl.c (lookup_and_check_tag): Ignore template parameters if
3377 scope == ts_current.
3378 * pt.c (check_template_shadow): Don't complain about the injected
3381 * decl.c (duplicate_decls): Tweak.
3384 * mangle.c (write_unqualified_name): Handle operator auto.
3386 2014-01-27 Jason Merrill <jason@redhat.com>
3390 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
3391 list-initialization. A conversion to rvalue ref that involves
3392 an lvalue-rvalue conversion is bad.
3393 (convert_like_real): Give helpful error message.
3396 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
3399 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
3403 * pt.c (template_parm_to_arg): Call convert_from_reference.
3404 (tsubst_template_arg): Don't strip reference refs.
3407 * call.c (build_aggr_conv): Reject value-initialization of reference.
3411 * call.c (convert_like_real): Give helpful error about excess braces
3412 for ck_rvalue of scalar type.
3415 * call.c (reference_binding): Only elide braces if the single
3416 element is reference-related.
3419 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
3423 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
3427 * decl.c (compute_array_index_type): Don't call
3428 maybe_constant_value for a non-integral expression.
3430 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
3432 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
3434 * cp-gimplify.c (cp_genericize): Likewise.
3435 * decl.c (grokfndecl): Likewise.
3436 * parser.c (cp_parser_postfix_expression): Likewise.
3437 (cp_parser_postfix_open_square_expression): Likewise.
3438 (cp_parser_direct_declarator): Likewise.
3439 (is_cilkplus_vector_p): Likewise.
3440 (cp_parser_omp_clause_name): Likewise.
3441 (cp_parser_omp_all_clauses): Likewise.
3442 * pt.c (apply_late_template_attributes): Likewise.
3443 * typeck.c (cp_build_array_ref): Likewise.
3444 (cp_build_compound_expr): Likewise.
3445 (check_return_expr): Likewise.
3447 2014-01-24 Jason Merrill <jason@redhat.com>
3450 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
3455 * typeck2.c (process_init_constructor_array): Don't create
3458 2014-01-24 Jakub Jelinek <jakub@redhat.com>
3460 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
3461 handling for RANGE_ARRAY case.
3463 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
3466 * name-lookup.c (push_using_directive): Use timevar_cond_start.
3468 2014-01-23 Marek Polacek <polacek@redhat.com>
3471 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
3473 2014-01-23 Marek Polacek <polacek@redhat.com>
3476 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
3479 2014-01-23 Jason Merrill <jason@redhat.com>
3482 * cp-tree.h (struct language_function): Add infinite_loop and
3484 (current_function_infinite_loop): New.
3485 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
3486 (break_maybe_infinite_loop): New.
3487 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
3488 (finish_do_stmt, finish_for_cond, finish_for_stmt)
3489 (begin_range_for_stmt): Use them.
3490 * decl.c (finish_function): Don't warn about missing return
3491 if current_function_infinite_loop.
3492 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
3493 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
3495 * call.c (build_op_delete_call): Use make_tree_vector and
3496 release_tree_vector.
3498 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3501 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
3502 nested_name_specifier.
3504 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
3506 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
3507 see if there is an attribute after function decl. If so, then
3509 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
3510 enabled function late parsing.
3511 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
3512 attribute for a SIMD-enabled function.
3513 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
3514 the function is used by SIMD-enabled function (indicated by NULL
3515 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
3516 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
3517 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
3518 vectorlength clause in SIMD-enabled function and #pragma SIMD's
3519 vectorlength clause. Added a new bool parameter to differentiate
3521 (cp_parser_cilk_simd_fn_vector_attrs): New function.
3522 (is_cilkplus_vector_p): Likewise.
3523 (cp_parser_late_parsing_elem_fn_info): Likewise.
3524 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
3525 and "vectorlength" clauses when Cilk Plus is enabled.
3526 (cp_parser_omp_clause_linear): Added a new parameter of type bool
3527 and emit a sorry message when step size is a parameter.
3528 * parser.h (cp_parser::cilk_simd_fn_info): New field.
3529 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
3531 * pt.c (apply_late_template_attributes): Likewise.
3533 2014-01-23 Jakub Jelinek <jakub@redhat.com>
3536 * semantics.c (finish_omp_reduction_clause): Reject
3537 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
3539 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
3542 * parser.c (cp_parser_class_head): Push the class before parsing
3543 the base-clause, pop after it.
3545 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
3547 * decl2.c (cpp_check): Revert prototype change.
3549 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3553 * init.c (build_value_init_noctor): Don't pass error_mark_node to
3556 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3559 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
3560 only when errorcount == 0.
3562 2014-01-17 Marek Polacek <polacek@redhat.com>
3565 * cvt.c (ocp_convert): Don't segfault on non-existing
3566 ENUM_UNDERLYING_TYPE.
3568 2014-01-16 Jason Merrill <jason@redhat.com>
3571 * tree.c (bot_manip): Update the location of builtin_LINE and
3574 2014-01-14 Jason Merrill <jason@redhat.com>
3577 * typeck2.c (massage_init_elt): New.
3578 (process_init_constructor_record)
3579 (process_init_constructor_union): Use it.
3580 (process_init_constructor_array): Use it. Use RANGE_EXPR.
3581 (split_nonconstant_init_1): Handle it.
3582 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
3584 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
3587 * parser.c (cp_parser_postfix_expression): Added a new if-statement
3588 and replaced an existing if-statement with else-if statement.
3589 Changed an existing error message wording to match the one from the C
3592 2014-01-08 Jason Merrill <jason@redhat.com>
3595 * class.c (abi_tag_data): Add tags field.
3596 (check_abi_tags): Initialize it.
3597 (find_abi_tags_r): Support collecting missing tags.
3598 (mark_type_abi_tags): Don't look at template args.
3599 (inherit_targ_abi_tags): New.
3600 (check_bases_and_members): Use it.
3601 * cp-tree.h (ABI_TAG_IMPLICIT): New.
3602 * mangle.c (write_abi_tags): Check it.
3604 2014-01-07 Jason Merrill <jason@redhat.com>
3607 * pt.c (num_innermost_template_parms): New.
3608 (get_underlying_template): Use it.
3611 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
3613 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3615 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
3616 the letter of 20.11.6 about Base and Derived naming the same
3617 class type modulo cv-qualifiers.
3619 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
3622 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
3623 function as unimplemented for generic lambdas with varargs.
3626 * parser.c (cp_parser_template_parameter): Early out with
3627 error_mark_node if parameter declaration was not parsed.
3630 * parser.c (cp_parser_lambda_expression): Save/reset/restore
3631 auto_is_implicit_function_template_parm_p around lambda body.
3634 * parser.c (cp_parser_init_declarator): Undo fully implicit
3635 template parameter list when declarator is not a function.
3637 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
3640 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
3642 2014-01-03 Tobias Burnus <burnus@net-b.de>
3645 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
3647 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3651 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
3652 as include_std to perform_koenig_lookup.
3653 (cp_parser_postfix_expression): Adjust.
3654 * pt.c (tsubst_copy_and_build): Likewise.
3655 * semantics.c (perform_koenig_lookup): Remove bool parameter.
3656 (omp_reduction_lookup): Adjust.
3657 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
3658 (lookup_arg_dependent): Likewise.
3659 (lookup_function_nonclass): Adjust.
3660 * name-lookup.h: Adjust declaration.
3661 * cp-tree.h: Likewise.
3663 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3666 * parser.c (cp_parser_userdef_numeric_literal): Mention
3667 -fext-numeric-literals in the message.
3669 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3672 * call.c (build_conditional_expr_1): Check the return value of
3675 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3677 * call.c (convert_like_real): Check complain.
3679 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3682 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
3685 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3687 Update copyright years
3689 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3691 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
3692 the standard form for the copyright notice.
3694 Copyright (C) 2014 Free Software Foundation, Inc.
3696 Copying and distribution of this file, with or without modification,
3697 are permitted in any medium without royalty provided the copyright
3698 notice and this notice are preserved.