1 2014-12-19 Kai Tietz <ktietz@redhat.com>
4 * pt.c (most_general_template): Don't break for template-alias.
6 2014-12-18 Jason Merrill <jason@redhat.com>
9 * parser.c (cp_parser_simple_type_specifier): Make auto parameter
10 before -std=c++14 an error.
13 * pt.c (tsubst_copy_and_build): Pass complain to mark_used.
16 * decl2.c (mark_used): Don't mark if in_template_function.
18 2014-12-18 Paolo Carlini <paolo.carlini@oracle.com>
21 * pt.c (struct warning_sentinel): Move it...
22 * cp-tree.h: ... here.
23 * semantics.c (force_paren_expr): Use it.
25 2014-12-17 Jason Merrill <jason@redhat.com>
28 * constexpr.c (cxx_bind_parameters_in_call): non_constant_args parm.
29 (cxx_eval_call_expression): Don't cache calls with non-constant args.
30 (cxx_eval_constant_expression) [COMPOUND_EXPR]: Pass true for lval.
31 (cxx_eval_unary_expression, cxx_eval_binary_expression)
32 (cxx_eval_conditional_expression): Pass false for lval.
34 * constexpr.c: Change "addr" parm names to "lval".
36 * constexpr.c: Tweak comments and formatting.
38 2014-12-16 Paolo Carlini <paolo.carlini@oracle.com>
41 * parser.c (cp_parser_member_declaration): Fix error recovery for
42 initialized non-static data member declared friend.
44 2014-12-15 Jan Hubicka <hubicka@ucw.cz>
46 * decl2.c (decl_needed_p): When not optimizing, do not consider external
49 2014-12-15 Jason Merrill <jason@redhat.com>
52 * typeck.c (apply_memfn_quals): Correct wrong TYPE_CANONICAL.
54 N3778: Sized Deallocation
55 * call.c (non_placement_deallocation_fn_p): A global sized
56 operator delete is not a usual deallocation function until C++14.
57 (build_op_delete_call): Choose the global sized op delete if we
59 * cp-tree.h: Declare non_placement_deallocation_fn_p.
60 (enum cp_tree_index): Remove CPTI_GLOBAL_DELETE_FNDECL.
61 (global_delete_fndecl): Remove.
62 * decl.c (cxx_init_decl_processing): Also declare sized op deletes.
63 (grok_op_properties): Warn about sized dealloc without the flag.
64 * init.c (build_builtin_delete_call): Remove.
65 (build_vec_delete_1, build_delete): Don't call it.
66 * decl2.c (maybe_warn_sized_delete): New.
67 (cp_write_global_declarations): Call it.
69 2014-12-15 Paolo Carlini <paolo.carlini@oracle.com>
72 * decl.c (check_array_designated_initializer): Diagnose gracefully
73 C99 designators which aren't integral constant-expressions; allow
74 constexpr user-defined type conversion operators.
76 2014-12-12 Paolo Carlini <paolo.carlini@oracle.com>
79 * semantics.c (finish_omp_reduction_clause): Early return true
80 if DECL_SAVED_TREE (id) is NULL_TREE.
82 2014-12-12 Jason Merrill <jason@redhat.com>
85 * pt.c (do_auto_deduction): In direct-init context, { x } deduces
88 * cp-tree.h (NAMESPACE_ABI_TAG): New.
89 * name-lookup.c (handle_namespace_attrs): Set it.
90 * class.c (check_tag): Split out from find_abi_tags_r.
91 (find_abi_tags_r): Also check namespace tags.
92 (mark_type_abi_tags): Also mark namespace tags.
94 2014-12-12 Kai Tietz <ktietz@redhat.com>
97 * constexpr.c (cxx_eval_loop_expr): Don't loop
98 endless on none-constant expression.
100 2014-12-12 Jason Merrill <jason@redhat.com>
103 * lambda.c (add_capture): Don't pass a dependent type to
104 variably_modified_type_p.
106 2014-12-11 Jason Merrill <jason@redhat.com>
108 Remove N3639 "array of runtime length" from -std=c++14.
109 * decl.c (compute_array_index_type): VLAs are not part of C++14.
110 (create_array_type_for_decl, grokdeclarator): Likewise.
111 * lambda.c (add_capture): Likewise.
112 * pt.c (tsubst): Likewise.
113 * rtti.c (get_tinfo_decl): Likewise.
114 * semantics.c (finish_decltype_type): Likewise.
115 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
116 (cp_build_addr_expr_1): Likewise.
117 * init.c (build_vec_init): Don't throw bad_array_length.
121 * parser.c (cp_parser_unqualified_id): Handle __func__ here.
122 (cp_parser_primary_expression): Not here.
125 * typeck2.c (split_nonconstant_init_1): Handle arrays here.
126 (store_init_value): Not here.
127 (split_nonconstant_init): Look through TARGET_EXPR. No longer static.
128 * cp-tree.h: Declare split_nonconstant_init.
129 * call.c (set_up_extended_ref_temp): Use split_nonconstant_init.
131 2014-12-11 Paolo Carlini <paolo.carlini@oracle.com>
133 * typeck.c (maybe_warn_about_useless_cast): Remove unnecessary
136 2014-12-10 Kai Tietz <ktietz@redhat.com>
139 * parser.c (cp_parser_diagnose_invalid_type_name): Check id
140 for being an identifier before accessing it.
143 * typeck.c (lookup_destructor): Handle incomplete type.
145 2014-12-09 Jason Merrill <jason@redhat.com>
148 * decl.c (grokdeclarator): Recover from variable template
149 specialization declared as function.
152 * parser.c (cp_parser_unqualified_id): Don't declare fname while
153 parsing function parms.
155 2014-12-03 Jason Merrill <jason@redhat.com>
158 * decl.c (grok_reference_init): Complete array type.
161 * constexpr.c (cxx_eval_store_expression): Handle non-decl store
164 2014-12-03 Paolo Carlini <paolo.carlini@oracle.com>
167 * decl.c (identify_goto): Return a bool if diagnostic is emitted.
168 (check_previous_goto_1): Consistently emit permerror + inform.
169 (check_goto): Likewise.
171 2014-12-03 Richard Biener <rguenther@suse.de>
173 * constexpr.c (cxx_eval_builtin_function_call): Use
174 fold_build_call_array_loc.
176 2014-12-02 Marek Polacek <polacek@redhat.com>
178 * constexpr.c (cxx_eval_check_shift_p): New function.
179 (cxx_eval_binary_expression): Call it. Set NON_CONSTANT_P if it
182 2014-12-01 Paolo Carlini <paolo.carlini@oracle.com>
185 * decl.c (reshape_init_r): Do not reject value-initialization of
186 scalar array element.
188 2014-12-01 Marek Polacek <polacek@redhat.com>
191 * constexpr.c: Include ubsan.h.
192 (cxx_eval_call_expression): Bail out for IFN_UBSAN_{NULL,BOUNDS}
193 internal functions and for ubsan builtins.
194 * error.c: Include internal-fn.h.
195 (dump_expr): Add printing of internal functions.
197 2014-12-01 Marek Polacek <polacek@redhat.com>
199 * constexpr.c (literal_type_p): Return true for void type in C++14.
201 2014-12-01 Paolo Carlini <paolo.carlini@oracle.com>
204 * typeck.c (finish_class_member_access_expr): Use %q#T instead of
205 %qD in error message.
207 2014-11-29 Jakub Jelinek <jakub@redhat.com>
209 * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument
210 from create_tmp_var calls.
212 2014-11-28 Marek Polacek <polacek@redhat.com>
215 * typeck.c (cp_build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
216 convert the right operand to integer type.
218 2014-11-27 Kai Tietz <ktietz@redhat.com>
221 * constexpr.c (cxx_eval_vec_init_1): Avoid
224 2014-11-26 Jason Merrill <jason@redhat.com>
226 Allow partial specialization of variable templates.
227 * cp-tree.h (TINFO_USED_TEMPLATE_ID): New.
228 * decl.c (duplicate_decls): Copy it.
229 * error.c (dump_decl) [TEMPLATE_ID_EXPR]: Handle variables.
230 * parser.c (cp_parser_decltype_expr): Do call finish_id_expression
232 * pt.c (register_specialization): Remember variable template insts.
233 (instantiate_template_1): Find the matching partial specialization.
234 (check_explicit_specialization): Allow variable partial specialization.
235 (process_partial_specialization): Likewise.
236 (push_template_decl_real): Likewise.
237 (more_specialized_partial_spec): Rename from more_specialized_class.
238 (most_specialized_partial_spec): Rename from most_specialized_class.
239 (get_partial_spec_bindings): Rename from get_class_bindings.
241 2014-11-26 Paolo Carlini <paolo.carlini@oracle.com>
244 * call.c (standard_conversion): Do not require expr to be non-null
245 when NULLPTR_TYPE_P (from) is true.
247 2014-11-26 Jason Merrill <jason@redhat.com>
249 * constexpr.c (cxx_eval_constant_expression) [SAVE_EXPR]: Avoid
252 * constexpr.c (cxx_eval_call_expression): Don't talk about
253 flowing off the end if we're already non-constant.
255 2014-11-26 Ville Voutilainen <ville.voutilainen@gmail.com>
257 Diagnose string constant conversion to char* in c++11 and above
258 as forbidden, not deprecated.
259 * typeck.c (string_conv_p): Do a pedwarn in c++11 and above,
260 change the diagnostic for the Wwrite-strings case for c++11 and above.
262 2014-11-24 Jason Merrill <jason@redhat.com>
264 * pt.c (lookup_template_variable): Always unknown_type_node.
266 2014-11-25 Paolo Carlini <paolo.carlini@oracle.com>
269 * parser.c (cp_parser_label_for_labeled_statement): Check the case
270 with check_for_bare_parameter_packs.
272 2014-11-24 Jonathan Wakely <jwakely@redhat.com>
273 Paolo Carlini <paolo.carlini@oracle.com>
276 * decl.c (initialize_local_var): Add -Winit-self warning for
277 references initialized with themselves.
279 2014-11-24 Jason Merrill <jason@redhat.com>
282 * mangle.c (mangle_decl): If we aren't going to create a symbol
283 alias, don't build the alias DECL either.
285 2014-11-24 Paolo Carlini <paolo.carlini@oracle.com>
288 * cp-tree.h (lang_decl_fn): Remove constructor_attr, destructor_attr.
290 2014-11-21 Jason Merrill <jason@redhat.com>
294 * call.c (set_up_extended_ref_temp): Set TREE_USED on the reference
295 if the temporary has a non-trivial destructor.
296 * decl.c (poplevel): Don't look through references.
299 * name-lookup.c (supplement_binding_1): Override a mangling alias.
300 * mangle.c (maybe_remove_implicit_alias): New.
301 (mangle_decl): Always avoid creating conflicting alias.
305 * mangle.c (decl_mangling_context): Use template_type_parameter_p.
308 * pt.c (uses_template_parms): Handle null argument.
310 2014-11-21 Jakub Jelinek <jakub@redhat.com>
313 * typeck.c (cp_build_array_ref): Adjust
314 convert_vector_to_pointer_for_subscript caller. If it returns true,
315 call non_lvalue_loc on the result.
317 2014-11-20 Jason Merrill <jason@redhat.com>
320 * pt.c (convert_nontype_argument): Call convert_from_reference.
321 (check_instantiated_arg): Don't be confused by reference refs.
322 (unify): Look through reference refs on the arg, too.
323 * mangle.c (write_template_arg): Look through reference refs.
325 * error.c (dump_expr): Avoid printing (*&i) for references.
327 2014-11-20 Ville Voutilainen <ville.voutilainen@gmail.com>
330 * tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.
332 2014-11-20 Trevor Saunders <tsaunders@mozilla.com>
334 * cp-objcp-common.c: Use hash_table instead of htab.
336 2014-11-19 Jason Merrill <jason@redhat.com>
339 * cp-tree.h (struct processing_template_decl_sentinel): New.
340 * pt.c (instantiate_non_dependent_expr_internal): Split out from...
341 (instantiate_non_dependent_expr_sfinae): Here.
342 (convert_nontype_argument): Use them.
343 * constexpr.c (fold_non_dependent_expr): Use them.
346 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
347 complain yet about a reference.
348 [TARGET_EXPR]: Handle TARGET_EXPR with addr == true.
349 [ADDR_EXPR]: Make sure we don't take the address of a CONSTRUCTOR.
350 (cxx_bind_parameters_in_call): In the new scheme addr is always false.
351 * typeck.c (build_address): Don't take the address of a CONSTRUCTOR.
354 * init.c (decl_really_constant_value): Rename from
355 integral_constant_value.
356 (scalar_constant_value): Similar but limited to scalar results.
357 (decl_constant_value_safe): Remove.
358 (constant_value_1): Respect return_aggregate_cst_ok_p.
359 * typeck.c (decay_conversion): Use scalar_constant_value.
360 * call.c (convert_like_real): Likewise.
361 * cvt.c (ocp_convert): No need to check CLASS_TYPE_P.
362 * typeck.c (decay_conversion): Or ARRAY_TYPE.
363 * constexpr.c (struct constexpr_ctx): Add strict field.
364 (cxx_eval_constant_expression) [VAR_DECL]: Use it to select between
365 decl_constant_value and decl_really_constant_value.
366 (cxx_eval_outermost_constant_expr): Add strict parm.
367 (maybe_constant_init): Not strict.
368 (potential_constant_expression_1): Add strict parm.
369 Shorten most internal calls with RECUR macro.
370 * cp-tree.h, pt.c, semantics.c: Adjust.
372 2014-11-19 Jason Merrill <jason@redhat.com>
375 * constexpr.c (cxx_eval_store_expression): Return init, not *valp.
377 2014-11-19 Paolo Carlini <paolo.carlini@oracle.com>
380 * constexpr.c (constexpr_fn_retval): Accept __func__, __FUNCTION__,
381 and __PRETTY_FUNCTION__.
383 2014-11-18 Jason Merrill <jason@redhat.com>
386 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: A load
387 from a variable of empty class type is constant.
389 * constexpr.c (cxx_eval_statement_list): Handle statement-expressions.
390 (potential_constant_expression_1): Handle STMT_EXPR.
392 * constexpr.c (cxx_eval_constant_expression): Give jump_target a
394 (lots): Omit NULL jump_target arguments.
396 * constexpr.c (struct constexpr_ctx): Add quiet field.
397 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Set it.
398 (lots): Replace allow_non_constant parameter with ctx->quiet.
401 * constexpr.c (cxx_eval_binary_expression): Don't assume the
402 expression was already folded.
403 (cxx_eval_unary_expression): Likewise.
405 2014-11-18 Marc Glisse <marc.glisse@inria.fr>
408 * rtti.c (emit_support_tinfos): Handle __float128.
410 2014-11-18 Jason Merrill <jason@redhat.com>
413 * constexpr.c (cxx_eval_increment_expression): Use POINTER_PLUS_EXPR.
416 * constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
417 rather than VOID_TYPE_P.
419 * pt.c (instantiate_template_1): Use tsubst_aggr_type for context.
422 * typeck2.c (store_init_value): Set it.
423 * cp-tree.h (CONSTRUCTOR_MUTABLE_POISON): New.
424 * constexpr.c (cxx_eval_outermost_constant_expr): Check it.
426 2014-11-17 Jason Merrill <jason@redhat.com>
429 * call.c (build_call_a): Don't warn_deprecated_use here.
430 (build_over_call): Or here.
431 * decl2.c (mark_used): Do it here.
432 (is_late_template_attribute): Attribute deprecated is not deferred.
433 (cplus_decl_attributes): Propagate TREE_DEPRECATED out to the template.
434 * parser.c (cp_parser_template_name): Warn about deprecated template.
435 (cp_parser_template_argument): Likewise.
438 * decl.c (cp_finish_decl): Don't try to process a non-dependent
439 constant initializer for a reference.
440 * pt.c (value_dependent_expression_p): A reference is always
442 * call.c (extend_ref_init_temps_1): Also clear TREE_SIDE_EFFECTS
445 Handle C++14 constexpr flow control.
446 * constexpr.c (cxx_eval_loop_expr, cxx_eval_switch_expr): New.
447 (cxx_eval_statement_list): New.
448 (cxx_eval_constant_expression): Handle LABEL_EXPR,
449 CASE_LABEL_EXPR, GOTO_EXPR, LOOP_EXPR, SWITCH_EXPR. Handle jump
450 semantics of RETURN_EXPR.
451 (many functions): Add jump_target parameter.
452 (returns, breaks, continues, switches, label_matches): New.
453 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): New.
454 * cp-gimplify.c (begin_bc_block): Set them.
456 * cp-gimplify.c (genericize_cp_loop): Use LOOP_EXPR.
457 (genericize_for_stmt): Handle null statement-list.
459 * constexpr.c (use_new_call): Always use new call handling.
461 C++14 constexpr support (minus loops and multiple returns)
462 * constexpr.c (use_new_call): New macro.
463 (build_data_member_initialization): Ignore non-mem-inits.
464 (check_constexpr_bind_expr_vars): Remove C++14 checks.
465 (constexpr_fn_retval): Likewise.
466 (check_constexpr_ctor_body): Do nothing in C++14.
467 (massage_constexpr_body): In C++14 only collect mem-inits.
468 (get_function_named_in_call): Handle null CALL_EXPR_FN.
469 (cxx_bind_parameters_in_call): Build bindings in same order as
470 parameters. Don't treat iniviref parms specially in new call mode.
471 (cxx_eval_call_expression): If use_new_call, do constexpr expansion
472 based on DECL_SAVED_TREE rather than the massaged constexpr body.
473 Set up ctx->object from AGGR_INIT_EXPR_SLOT if we don't have one.
474 (is_sub_constant_expr): Don't mess with ctx.ctor here.
475 (cxx_eval_component_reference): A null element means we're mid-
477 (cxx_eval_store_expression, cxx_eval_increment_expression): New.
478 (cxx_eval_constant_expression): Handle RESULT_DECL, DECL_EXPR,
479 MODIFY_EXPR, STATEMENT_LIST, BIND_EXPR, USING_STMT,
480 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
481 POSTDECREMENT_EXPR. Don't look into DECL_INITIAL of variables in
482 constexpr functions. In new-call mode find parms in the values table.
483 (potential_constant_expression_1): Handle null CALL_EXPR_FN.
484 Handle STATEMENT_LIST, MODIFY_EXPR, MODOP_EXPR, IF_STMT,
485 PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR,
486 POSTDECREMENT_EXPR, BIND_EXPR, WITH_CLEANUP_EXPR,
487 CLEANUP_POINT_EXPR, MUST_NOT_THROW_EXPR, TRY_CATCH_EXPR,
488 EH_SPEC_BLOCK, EXPR_STMT, DECL_EXPR, CASE_LABEL_EXPR, BREAK_STMT,
489 CONTINUE_STMT, USING_STMT, IF_STMT, DO_STMT, FOR_STMT, WHILE_STMT,
490 SWITCH_STMT, ASM_EXPR.
491 (cxx_eval_vec_init_1): Call build_aggr_init_expr.
492 (cxx_eval_indirect_ref): Don't return a CONSTRUCTOR when the
493 caller wants an lvalue.
494 (cxx_eval_outermost_constant_expr): Pull object out of AGGR_INIT_EXPR.
495 (maybe_constant_init): Look through INIT_EXPR.
496 (ensure_literal_type_for_constexpr_object): Set
497 cp_function_chain->invalid_constexpr.
498 * cp-tree.h (struct language_function): Add invalid_constexpr bitfield.
499 * decl.c (start_decl): Set cp_function_chain->invalid_constexpr.
500 (check_for_uninitialized_const_var): Likewise.
501 (maybe_save_function_definition): Check it.
502 * parser.c (cp_parser_jump_statement): Set
503 cp_function_chain->invalid_constexpr.
504 (cp_parser_asm_definition): Likewise.
507 * decl.c (build_ptrmemfunc_type): Don't build a different
508 RECORD_TYPE for a qualified PMF.
509 * cp-tree.h (TYPE_PTRMEMFUNC_FN_TYPE): Merge cv-quals.
510 (TYPE_PTRMEMFUNC_FN_TYPE_RAW): New.
511 * decl2.c (cplus_decl_attributes): Use TYPE_PTRMEMFUNC_FN_TYPE_RAW.
512 * tree.c (cp_walk_subtrees): Likewise.
513 (cp_build_qualified_type_real): Remove special PMF handling.
515 2014-11-15 Jason Merrill <jason@redhat.com>
517 * parser.c (cp_parser_omp_declare_reduction_exprs): A block is not
520 * constexpr.c (cxx_eval_builtin_function_call): Use
521 fold_builtin_call_array.
523 * constexpr.c (cx_check_missing_mem_inits): Clarify error message.
525 2014-11-14 Paolo Carlini <paolo.carlini@oracle.com>
527 * semantics.c (end_maybe_infinite_loop): Use fold_non_dependent_expr.
528 * parser.c (cp_parser_omp_clause_collapse): Likewise.
529 (cp_parser_enumerator_definition): Don't call
530 instantiate_non_dependent_expr...
531 * decl.c (build_enumerator): ... call fold_non_dependent_expr here.
532 * typeck2.c (massage_init_elt): Use fold_non_dependent_expr.
533 * constexpr.c (maybe_constant_value): Allow VIEW_CONVERT_EXPR in
534 the final gcc_assert.
536 * constexpr.c (fold_non_dependent_expr): Add.
537 * cp-tree.h (fold_non_dependent_expr): Declare it.
538 * call.c (null_ptr_cst_p): Use it.
539 * pt.c (tsubst_copy_and_build, build_non_dependent_expr): Likewise.
540 * semantics.c (begin_maybe_infinite_loop): Likewise.
541 * typeck.c (cp_build_binary_op): Likewise.
542 * typeck2.c (check_narrowing): Likewise.
544 * pt.c (fold_non_dependent_expr): Rename to
545 instantiate_non_dependent_expr.
546 (fold_non_dependent_expr_sfinae): Rename to
547 instantiate_non_dependent_expr_sfinae.
548 (convert_nontype_argument, build_non_dependent_expr): Adjust.
549 * decl.c (compute_array_index_type): Likewise.
550 * parser.c (cp_parser_parenthesized_expression_list,
551 cp_parser_enumerator_definition, cp_parser_omp_clause_collapse):
553 * semantics.c (end_maybe_infinite_loop, finish_static_assert):
555 * typeck.c (cxx_alignas_expr): Likewise.
556 * typeck2.c (store_init_value, massage_init_elt): Likewise.
557 * call.c: Adjust comments.
559 * constexpr.c: Likewise.
563 2014-11-14 Jonathan Wakely <jwakely@redhat.com>
565 * mangle.c (find_substitution): Look for abi_tag on class templates.
567 2014-11-13 Bernd Schmidt <bernds@codesourcery.com>
568 Thomas Schwinge <thomas@codesourcery.com>
569 Ilya Verbin <ilya.verbin@intel.com>
570 Andrey Turetskiy <andrey.turetskiy@intel.com>
572 * Make-lang.in (c++.install-common): Do not install for the offload
575 2014-11-13 Kai Tietz <ktietz@redhat.com>
577 * cp-tree.h (cp_build_function_call): Remove prototype.
578 (cp_build_addr_expr_strict): Likewise.
579 (build_typed_address): Likewise.
580 * typeck.c (build_typed_address): Removed.
581 (cp_build_addr_expr_strict): Make static.
582 (cp_build_function_call): Likewise.
584 2014-11-12 Paolo Carlini <paolo.carlini@oracle.com>
588 * cp-tree.h (struct cp_decl_specifier_seq): Add decltype_p bool field.
589 * decl.c (grokdeclarator): Use it.
590 * parser.c (cp_parser_simple_type_specifier): Likewise.
591 * pt.c (tsubst, case DECLTYPE_TYPE): Use tf_ignore_bad_quals.
593 2014-11-11 Paolo Carlini <paolo.carlini@oracle.com>
596 * pt.c (tsubst_copy_and_build, case COND_EXPR): Maybe fold to
597 constant the condition.
599 2014-11-10 Andi Kleen <ak@linux.intel.com>
601 * semantics.c (finish_goto_stmt): Call check_no_cilk.
602 (finish_while_stmt_cond): Dito.
603 (finish_do_stmt): Dito.
604 (finish_for_cond): Dito.
605 (finish_switch_cond): Dito.
607 2014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
609 * typeck.c (cp_build_binary_op): Use OPT_Wshift_count_negative and
610 OPT_Wshift_count_overflow in the warnings.
612 2014-11-09 Jason Merrill <jason@redhat.com>
615 * typeck.c (build_reinterpret_cast_1): reinterpret_cast to the
616 same scalar type is an rvalue.
619 * call.c (build_new_op_1): Don't do non-class lookup for =, -> or [].
621 2014-11-07 Jason Merrill <jason@redhat.com>
624 * pt.c (dependent_alias_template_spec_p): New.
625 (dependent_type_p_r): Handle dependent alias template specialization.
626 (template_args_equal): A dependent alias template specializations
627 is not equal to its underlying type as a template argument.
628 * tree.c (strip_typedefs): Don't strip a dependent alias
631 * parser.c (cp_parser_unqualified_id): Handle __func__ here.
632 (cp_parser_primary_expression): Not here.
634 2014-11-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
637 * decl.c (grokdeclarator): Fix __complex meaning __complex double.
639 2014-10-29 Richard Sandiford <richard.sandiford@arm.com>
641 * constexpr.c: Remove redundant enum from machine_mode.
643 2014-10-28 Jason Merrill <jason@redhat.com>
645 * constexpr.c (cxx_eval_outermost_constant_expr): Tweak.
647 2014-10-28 Andrew MacLeod <amacleod@redhat.com>
649 * call.c: Adjust include files.
658 * semantics.c: Ditto.
660 * vtable-class-hierarchy.c: Ditto.
662 2014-10-24 Jason Merrill <jason@redhat.com>
664 Implement N3653 (Member initializers and aggregates) and fix
665 references to 'this' in constexpr constructors.
666 * class.c (check_field_decls): In C++14 an NSDMI does not make the
668 * constexpr.c (struct constexpr_ctx): New.
669 (cxx_bind_parameters_in_call): Handle 'this'.
670 (cxx_eval_call_expression): Create new constexpr_ctx.
671 (cxx_eval_component_reference): Check CONSTRUCTOR_NO_IMPLICIT_ZERO.
672 (initialized_type, init_subob_ctx, verify_ctor_sanity): New.
673 (cxx_eval_bare_aggregate): Use them. Build CONSTRUCTOR early.
674 (cxx_eval_vec_init_1): Likewise.
675 (cxx_eval_constant_expression) [PARM_DECL]: Allow 'this'.
676 [TARGET_EXPR]: Build new constexpr_ctx.
677 [PLACEHOLDER_EXPR]: New.
678 (cxx_eval_outermost_constant_expr): Build new constexpr_ctx. Add
680 (is_sub_constant_expr): Build new constexpr_ctx.
681 (potential_constant_expression_1): Handle PLACEHOLDER_EXPR.
683 * cp-gimplify.c (cp_gimplify_init_expr): Call replace_placeholders.
684 * cp-tree.h (CONSTRUCTOR_NO_IMPLICIT_ZERO): New.
685 * error.c (dump_expr): Handle PLACEHOLDER_EXPR.
686 * init.c (get_nsdmi): Generate PLACEHOLDER_EXPR.
687 * tree.c (lvalue_kind): Handle PLACEHOLDER_EXPR.
688 (build_ctor_subob_ref, replace_placeholders): New.
689 * typeck2.c (store_init_value): Use replace_placeholders.
690 (process_init_constructor_record): Make zero-init before NSDMI
693 2014-10-27 Andrew MacLeod <amacleod@redhat.com>
695 * cp-gimplify.c: Adjust include files.
697 2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
700 * cp-objcp-common.c: Do not include new.
701 (cxx_initialize_diagnostics): Move from here to ...
702 * error.c (cxx_initialize_diagnostics): : ... here. Move
703 diagnostics initialization here from init_error.
704 (cxx_pp): Use a real pointer not a macro.
705 (init_error): Just initialize cxx_pp.
706 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer): Do
707 not set maximum line length.
709 2014-10-23 Jonathan Wakely <jwakely@redhat.com>
712 * decl2.c (delete_sanity): Use OPT_Wdelete_incomplete in warning.
714 2014-10-21 Paolo Carlini <paolo.carlini@oracle.com>
716 * parser.c (cp_parser_unary_expression): Add default arguments.
717 (cp_parser_cast_expression, cp_parser_sizeof_operand,
718 cp_parser_omp_atomic): Adjust.
720 2014-10-20 Jason Merrill <jason@redhat.com>
723 * lambda.c (current_nonlambda_function): New.
724 * semantics.c (finish_this_expr): Use it.
725 * cp-tree.h: Declare it.
727 2014-10-17 Alan Modra <amodra@gmail.com>
730 * decl.c (merge_decls): Don't merge section name, comdat group or
731 tls model to newdecl symtab node, instead merge to olddecl.
732 Override existing olddecl section name. Set tls_model for all
733 thread-local vars, not just OMP thread-private ones. Remove
736 2014-10-16 Andrew MacLeod <amacleod@redhat.com>
738 * cp-tree.h: Adjust include files.
740 2014-10-15 Jason Merrill <jason@redhat.com>
743 * pt.c (lookup_template_variable): Call coerce_template_parms.
745 2014-10-15 Paolo Carlini <paolo.carlini@oracle.com>
747 * semantics.c (is_instantiation_of_constexpr, literal_type_p,
748 ensure_literal_type_for_constexpr_object,
749 constexpr_fundef_hasher::equal, constexpr_fundef_hasher::hash,
750 retrieve_constexpr_fundef, is_valid_constexpr_fn,
751 build_anon_member_initialization, build_data_member_initialization,
752 check_constexpr_bind_expr_vars, check_constexpr_ctor_body_1,
753 check_constexpr_ctor_body, sort_constexpr_mem_initializers,
754 build_constexpr_constructor_member_initializers, constexpr_fn_retval,
755 massage_constexpr_body, cx_check_missing_mem_inits,
756 register_constexpr_fundef, explain_invalid_constexpr_fn,
757 constexpr_call_hasher::hash, constexpr_call_hasher::equal,
758 maybe_initialize_constexpr_call_table, get_function_named_in_call,
759 get_nth_callarg, lookup_parameter_binding,
760 cxx_eval_builtin_function_call, adjust_temp_type,
761 cxx_bind_parameters_in_call, push_cx_call_context,
762 pop_cx_call_context, cx_error_context, cxx_eval_call_expression,
763 reduced_constant_expression_p, verify_constant,
764 cxx_eval_unary_expression, cxx_eval_binary_expression,
765 cxx_eval_conditional_expression, cxx_eval_array_reference,
766 cxx_eval_component_reference, cxx_eval_bit_field_ref,
767 cxx_eval_logical_expression, base_field_constructor_elt,
768 cxx_eval_bare_aggregate, cxx_eval_vec_init_1, cxx_eval_vec_init,
769 cxx_fold_indirect_ref, cxx_eval_indirect_ref, non_const_var_error,
770 cxx_eval_trinary_expression, var_in_constexpr_fn,
771 cxx_eval_constant_expression, cxx_eval_outermost_constant_expr,
772 is_sub_constant_expr, cxx_constant_value, maybe_constant_value,
773 maybe_constant_init, potential_constant_expression_1,
774 potential_constant_expression, potential_rvalue_constant_expression,
775 require_potential_constant_expression,
776 require_potential_rvalue_constant_expression): Moved definitions...
777 * constexpr.c: ... here, new file.
778 * Make-lang.in: Update.
779 * config-lang.in: Likewise.
781 2014-10-14 Jason Merrill <jason@redhat.com>
784 * parser.c (struct saved_token_sentinel): New.
785 (cp_parser_statement): Use it.
786 (cp_parser_start_tentative_firewall): New.
787 (cp_parser_end_tentative_firewall): New.
788 (cp_parser_lambda_expression): Use them.
789 (cp_parser_statement_expr): New.
790 (cp_parser_primary_expression): Use it.
792 2014-10-14 DJ Delorie <dj@redhat.com>
794 * typeck.c (cp_common_type): Check for all __intN types, not just
796 * decl.c (grokdeclarator): Likewise.
797 * rtti.c (emit_support_tinfos): Check for all __intN types, not just
799 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
800 for all __intN types, not just __int128.
801 (cp_parser_simple_type_specifier): Likewise.
802 * mangle.c (integer_type_codes): Remove int128-specific codes.
803 * cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
804 __intN was specified.
805 * lex.c (init_reswords): Reserve all __intN keywords.
807 2014-10-14 Marc Glisse <marc.glisse@inria.fr>
809 * typeck.c (cp_build_unary_op) [TRUTH_NOT_EXPR]: Accept float vectors.
811 2014-10-13 H.J. Lu <hongjiu.lu@intel.com>
813 * mangle.c (mangle_conv_op_name_for_type): Cast elements to
815 (print_template_statistics): Cast size and elements to long.
817 2014-10-12 Trevor Saunders <tsaunders@mozilla.com>
819 * cp-gimplify.c, cp-tree.h, decl.c, mangle.c, name-lookup.c,
820 pt.c, semantics.c, tree.c, typeck2.c: Use hash_table instead of
823 2014-10-10 Jason Merrill <jason@redhat.com>
826 * class.c (build_base_path): Preserve rvalueness.
827 * call.c (convert_like_real) [ck_base]: Let convert_to_base handle &/*.
828 * rtti.c (build_dynamic_cast_1): Call convert_to_reference later.
831 * method.c (defaulted_late_check): Call maybe_instantiate_noexcept.
833 * method.c (implicitly_declare_fn): Handle deleted lambda default
834 ctor and copy assop here.
835 * class.c (check_bases_and_members): Not here.
836 (add_implicitly_declared_members): And don't set
837 CLASSTYPE_LAZY_MOVE_ASSIGN.
839 * semantics.c (finish_id_expression): Check for error_mark_node.
841 2014-10-09 Jason Merrill <jason@redhat.com>
844 * semantics.c (outer_var_p): Non-static.
845 (process_outer_var_ref): Split out from finish_id_expression.
846 * pt.c (tsubst_copy_and_build): Call them.
847 * cp-tree.h: Declare them.
849 2014-10-09 Paolo Carlini <paolo.carlini@oracle.com>
851 * semantics.c (check_constexpr_ctor_body_1): New.
852 (check_constexpr_ctor_body): Use it; add bool parameter.
853 (build_data_member_initialization): Handle BIND_EXPR and
854 USING_STMT in the main conditional.
855 (build_constexpr_constructor_member_initializers): Do not
856 handle BIND_EXPR here.
857 (constexpr_fn_retval): Handle BIND_EXPR in the switch.
858 (massage_constexpr_body): Don't do it here.
859 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
860 Adjust check_constexpr_ctor_body call.
861 (cp_parser_compound_statement): Do not pedwarn for compound-statement
862 in constexpr function in C++14 mode.
863 * cp-tree.h (check_constexpr_ctor_body): Update declaration.
865 2014-10-09 Jason Merrill <jason@redhat.com>
868 * parser.c (cp_parser_class_head): push_template_decl for members
872 * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
873 (iterative_hash_template_arg): Likewise.
876 * cp-tree.h (REF_PARENTHESIZED_P): Also allow INDIRECT_REF.
877 * semantics.c (force_paren_expr): And set it.
878 * typeck.c (check_return_expr): And handle it.
880 2014-10-09 Marc Glisse <marc.glisse@inria.fr>
882 * decl.c (grokdeclarator): constexpr only implies const in C++11.
884 2014-10-08 Jason Merrill <jason@redhat.com>
887 * pt.c (tsubst_pack_expansion): Limit simple expansion to type packs.
890 * tree.c (build_cplus_array_type): Look for a type with no
891 typedef-name or attributes.
893 * call.c (call_copy_ctor): New.
894 (build_over_call): Use it to avoid infinite recursion on invalid code.
896 2014-10-07 Jason Merrill <jason@redhat.com>
898 * tree.c (cp_tree_equal) [TRAIT_EXPR]: Use cp_tree_equal for type2.
900 2014-10-06 Edward Smith-Rowland <3dw4rd@verizon.net>
902 * cp/parser.c: Allow [[deprecated]] for C++11. Issue a pedwarn.
904 2014-10-06 Paolo Carlini <paolo.carlini@oracle.com>
907 * semantics.c (check_constexpr_bind_expr_vars): New.
908 (check_constexpr_ctor_body, massage_constexpr_body): Use it.
909 (build_constexpr_constructor_member_initializers): Handle
910 BIND_EXPR in the main conditional.
912 2014-10-02 Mark Wielaard <mjw@redhat.com>
915 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
916 (cp_function_decl_deleted_p): New prototype.
917 * cp-objcp-common.c (cp_function_deleted_p): New function.
919 2014-10-03 Marc Glisse <marc.glisse@inria.fr>
924 * typeck.c (cp_build_binary_op): save_expr after convert to save
925 redundant operations.
926 [TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR]: Handle vectors.
927 (cp_build_unary_op) [TRUTH_NOT_EXPR]: Likewise.
929 2014-10-03 Jason Merrill <jason@redhat.com>
931 * decl.c (start_decl): Complain about static/thread_local vars
932 in constexpr function.
933 (check_for_uninitialized_const_var): Also uninitialized vars.
934 * parser.c (cp_parser_jump_statement): And gotos.
935 (cp_parser_asm_operand_list): And asm.
936 (cp_parser_try_block): And try.
937 * semantics.c (ensure_literal_type_for_constexpr_object): And
940 * semantics.c (constexpr_fn_retval): Ignore declarations in C++14.
941 (var_in_constexpr_fn): New.
942 (cxx_eval_constant_expression): Look into DECL_INITIAL.
943 (potential_constant_expression_1): Allow constexpr-local vars.
946 * tree.c (strip_typedefs): Handle TREE_LIST.
948 2014-10-03 Paolo Carlini <paolo.carlini@oracle.com>
950 * parser.c (cp_parser_assignment_expression,
951 cp_parser_constant_expression): Add default arguments.
952 (cp_parser_primary_expression,
953 cp_parser_postfix_open_square_expression,
954 cp_parser_parenthesized_expression_list,
955 cp_parser_question_colon_clause,
956 cp_parser_expression, cp_parser_constant_expression,
957 cp_parser_label_for_labeled_statement, cp_parser_static_assert,
958 cp_parser_template_argument, cp_parser_enumerator_definition,
959 cp_parser_member_declaration, cp_parser_constant_initializer,
960 cp_parser_noexcept_specification_opt, cp_parser_throw_expression,
961 cp_parser_std_attribute_spec, cp_parser_objc_message_args,
962 cp_parser_objc_class_ivars, cp_parser_omp_clause_collapse,
963 cp_parser_omp_clause_aligned, cp_parser_omp_clause_safelen,
964 cp_parser_omp_clause_simdlen, cp_parser_omp_clause_dist_schedule,
965 cp_parser_omp_for_incr, cp_parser_omp_for_loop_init,
966 cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear): Adjust.
968 2014-10-02 Paolo Carlini <paolo.carlini@oracle.com>
971 * cp-tree.h (struct saved_scope): Add noexcept_operand.
972 (cp_noexcept_operand): Define.
973 * call.c (build_over_call): Use it.
974 * parser.c (cp_parser_unary_expression, [RID_NOEXCEPT]): Likewise.
975 * pt.c (tsubst_copy_and_build, [NOEXCEPT_EXPR]): Likewise.
977 2014-10-01 Jason Merrill <jason@redhat.com>
980 * method.c (constructible_expr): Handle value-init of non-class.
981 * parser.c (cp_parser_trait_expr): Allow pack expansion.
982 * pt.c (tsubst_copy_and_build): Handle pack expansion.
985 * class.c (type_has_non_user_provided_default_constructor): Rename
986 from type_has_user_provided_default_constructor, reverse sense.
987 (default_init_uninitialized_part, explain_non_literal_class): Adjust.
988 (check_bases_and_members): Set TYPE_HAS_COMPLEX_DFLT.
989 * call.c (build_new_method_call_1): Adjust.
991 * decl.c (grok_special_member_properties): Don't set
992 TYPE_HAS_COMPLEX_DFLT.
993 * init.c (build_value_init_noctor): Don't use
994 type_has_user_provided_default_constructor.
996 2014-09-30 Jason Merrill <jason@redhat.com>
998 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_ASSIGNABLE and
999 CPTK_IS_TRIVIALLY_CONSTRUCTIBLE.
1000 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
1001 * parser.c (cp_parser_primary_expression): Likewise.
1002 (cp_parser_trait_expr): Likewise. Handle variadic trait.
1003 * semantics.c (trait_expr_value): Likewise.
1004 (finish_trait_expr): Likewise.
1005 (check_trait_type): Handle variadic trait. Return bool.
1006 * method.c (build_stub_object): Add rvalue reference here.
1007 (locate_fn_flags): Not here.
1008 (check_nontriv, assignable_expr, constructible_expr): New.
1009 (is_trivially_xible): New.
1011 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_COPYABLE.
1012 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
1013 * parser.c (cp_parser_primary_expression): Likewise.
1014 (cp_parser_trait_expr): Likewise.
1015 * semantics.c (trait_expr_value): Likewise.
1016 (finish_trait_expr): Likewise.
1018 * method.c (build_stub_object): Use CONVERT_EXPR.
1019 * tree.c (build_dummy_object): Likewise.
1020 (is_dummy_object): Adjust.
1022 * cp-tree.h (cp_trait_kind): Remove CPTK_IS_CONVERTIBLE_TO.
1023 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
1024 * semantics.c (trait_expr_value): Likewise.
1025 (finish_trait_expr): Likewise.
1026 * parser.c (cp_parser_primary_expression): Likewise.
1027 (cp_parser_trait_expr): Likewise. Remove redundant grokdeclarator.
1029 2014-09-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1032 * error.c (print_instantiation_context): Delete.
1033 * typeck2.c (build_x_arrow): Record location when pushing
1034 template instantiation.
1035 * pt.c (push_tinst_level): Make it a wrapper around ...
1036 (push_tinst_level_loc): ... this. New function. Make excessive
1037 template instantiation depth a fatal error. Record location. Use
1038 bool as return type.
1039 (instantiate_pending_templates): Make excessive
1040 template instantiation depth a fatal error.
1041 (problematic_instantiation_changed): Use bool as return type.
1042 * cp-tree.h (print_instantiation_context): Delete.
1043 (push_tinst_level): Update declaration.
1044 (problematic_instantiation_changed): Likewise.
1045 (push_tinst_level_loc): New.
1047 2014-09-29 Richard Biener <rguenther@suse.de>
1049 * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
1052 2014-09-26 Jason Merrill <jason@redhat.com>
1054 * mangle.c (find_substitution): Use write_abi_tags.
1056 2014-09-25 Marek Polacek <polacek@redhat.com>
1059 * class.c (warn_hidden): Check for FUNCTION_DECL.
1061 2014-09-25 Jakub Jelinek <jakub@redhat.com>
1064 * semantics.c (handle_omp_array_sections_1): Call mark_rvalue_use
1065 on low_bound and length.
1067 2014-09-24 Aldy Hernandez <aldyh@redhat.com>
1069 * class.c, decl.c, optimize.c: Rename all instances of
1070 DECL_ABSTRACT to DECL_ABSTRACT_P.
1072 2014-09-24 Marek Polacek <polacek@redhat.com>
1076 * semantics.c (finish_switch_cond): Call unlowered_expr_type.
1077 * tree.c (bot_manip): Add default case.
1078 * parser.c (cp_parser_primary_expression): Cast the controlling
1079 expression of a switch to an int.
1080 (cp_parser_unqualified_id): Likewise.
1082 2014-09-23 Paolo Carlini <paolo.carlini@oracle.com>
1085 * parser.c (cp_parser_skip_to_closing_square_bracket,
1086 cp_parser_array_designator_p): New.
1087 (cp_parser_initializer_list): Use the latter.
1089 2014-09-22 Jason Merrill <jason@redhat.com>
1091 * semantics.c (finish_non_static_data_member): In diagnostic, give
1092 error at point of use and note at point of declaration.
1097 * lambda.c (maybe_resolve_dummy, lambda_expr_this_capture): Handle
1100 2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
1103 * pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.
1105 2014-09-22 Jason Merrill <jason@redhat.com>
1107 * decl.c (poplevel): Don't warn about unused vars in template scope.
1108 * error.c (dump_decl): Handle variable templates.
1110 2014-09-20 Jason Merrill <jason@redhat.com>
1113 * decl.c (begin_destructor_body): Only clobber the as-base part of
1116 2014-09-19 Jason Merrill <jason@redhat.com>
1119 * mangle.c (write_expression): Use unresolved-name mangling for
1123 * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
1124 after pulling out an element from a CONSTRUCTOR.
1126 2014-09-18 Jakub Jelinek <jakub@redhat.com>
1129 * semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
1130 on type of type dependent expressions, and don't call it if
1131 handle_omp_array_sections has kept TREE_LIST because something
1133 * pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
1134 Use keep_next_level, begin_omp_structured_block and
1135 finish_omp_structured_block instead of push_stmt_list and
1138 2014-09-18 Paolo Carlini <paolo.carlini@oracle.com>
1141 * class.c (finish_struct_1): Do not -Wnon-virtual-dtor warn
1142 for final class types.
1144 2014-09-15 Jason Merrill <jason@redhat.com>
1146 * pt.c (lookup_template_class_1): Splice out abi_tag attribute if
1147 necessary. Call inherit_targ_abi_tags here.
1148 * class.c (check_bases_and_members): Not here.
1149 (inherit_targ_abi_tags): Check CLASS_TYPE_P.
1150 * cp-tree.h: Declare inherit_targ_abi_tags.
1152 2014-09-15 Ville Voutilainen <ville.voutilainen@gmail.com>
1154 Do not diagnose lambda default arguments in c++14 modes.
1155 * parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
1158 2014-09-15 Jakub Jelinek <jakub@redhat.com>
1160 * Make-lang.in (check_g++_parallelize): Change to just an upper bound
1163 2014-09-13 Marek Polacek <polacek@redhat.com>
1166 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: Set
1167 location of a call expression.
1169 2014-09-11 Jason Merrill <jason@redhat.com>
1172 * decl.c (start_decl): Handle specialization of member variable
1174 * pt.c (check_explicit_specialization): Adjust error.
1176 2014-09-11 Paolo Carlini <paolo.carlini@oracle.com>
1179 * typeck2.c (process_init_constructor_record): Do not warn about
1180 missing field initializer if EMPTY_CONSTRUCTOR_P (init).
1182 2014-09-11 Jason Merrill <jason@redhat.com>
1185 * pt.c (tsubst_pack_expansion): Simplify substitution into T....
1186 (tsubst): Don't throw away PACK_EXPANSION_EXTRA_ARGS.
1188 2014-09-10 Jason Merrill <jason@redhat.com>
1191 * decl.c (grokfndecl): Don't set DECL_COMDAT on static inlines.
1192 (duplicate_decls, start_decl): Likewise.
1193 * pt.c (check_explicit_specialization): Likewise.
1194 (push_template_decl_real): Or static templates.
1196 2014-09-08 Jason Merrill <jason@redhat.com>
1198 * typeck.c (build_class_member_access_expr): Move
1199 -Winvalid-offsetof code...
1200 * semantics.c (finish_offsetof): ...here.
1201 * parser.c (cp_parser_builtin_offsetof): Remember the location of
1203 * pt.c (tsubst_copy_and_build) [OFFSETOF_EXPR]: Preserve it.
1206 * pt.c (instantiate_decl): Handle recursive instantiation of
1209 2014-09-05 Jason Merrill <jason@redhat.com>
1212 * semantics.c (potential_constant_expression_1): Handle un-folded
1213 pointer to member constants.
1215 2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de>
1218 * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
1219 newdecl, not olddecl.
1221 2014-09-02 Paolo Carlini <paolo.carlini@oracle.com>
1224 * class.c (check_field_decls): A class of literal type cannot have
1225 volatile non-static data members and base classes.
1226 (explain_non_literal_class): Update.
1228 2014-09-02 Jakub Jelinek <jakub@redhat.com>
1229 Balaji V. Iyer <balaji.v.iyer@intel.com>
1230 Igor Zamyatin <igor.zamyatin@intel.com>
1232 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
1234 * parser.c (cp_parser_cilk_for): New function.
1235 (cp_parser_cilk_grainsize): Likewise.
1236 (cp_parser_statement): Added RID_CILK_FOR case.
1237 (cp_parser_omp_for_cond): Added CILK_FOR check.
1238 (cp_parser_omp_for_loop_init): Change function argument to accept
1239 tree_code instead just a bool flag; change the check to use that
1240 tree_code; check for initialization declaration in case of Cilk_for.
1241 (cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
1242 changed call to cp_parser_omp_for_loop_init according new arguments'
1244 (cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
1245 * pt.c (tsubst_expr): Added CILK_FOR case.
1246 * semantics.c: Include convert.h.
1247 (finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
1248 case; added OMP_CLAUSE__CILK_FOR_COUNT_.
1249 (handle_omp_for_class_iterator): New argument lastp and its usage;
1251 (finish_omp_for): Changed call to handle_omp_for_class_iterator
1252 according new arguments' list; in case of Cilk_for save very first
1253 decl and create empty stmt_list block; use block to build correct
1256 2014-08-31 Jason Merrill <jason@redhat.com>
1259 * optimize.c (cdtor_comdat_group): Just look at the
1260 DECL_ASSEMBLER_NAME of the 'tors.
1262 2014-08-27 Paolo Carlini <paolo.carlini@oracle.com>
1265 * semantics.c (cxx_eval_call_expression): Use STRIP_NOPS on the
1266 result of cxx_eval_constant_expression.
1268 2014-08-26 Jason Merrill <jason@redhat.com>
1271 * pt.c (tsubst_decl) [VAR_DECL]: Copy TLS model.
1272 (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
1273 * semantics.c (finish_id_expression): Don't call TLS wrapper in a
1276 2014-08-25 Jason Merrill <jason@redhat.com>
1278 * pt.c (check_explicit_specialization): Don't complain about
1279 non-template variable.
1280 (template_for_substitution): Allow variable templates.
1281 (check_template_variable): Fix logic for member var template.
1282 * decl.c (start_decl): Don't complain about extra template header
1285 * decl.c (start_decl): Look through member variable template.
1286 * pt.c (tsubst_decl) [VAR_DECL]: Handle member variable templates.
1287 * decl2.c (grokfield): Set DECL_CONTEXT earlier on
1290 2014-08-25 Paolo Carlini <paolo.carlini@oracle.com>
1293 * cp-tree.h (TFF_POINTER): Add.
1294 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): Forward the third
1296 * error.c (dump_type_suffix): Actually print the const and noreturn
1297 attribute when appropriate.
1299 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
1301 * decl.c (compute_array_index_type, grokdeclarator,
1302 undeduced_auto_decl): Change from cxx1y to cxx14.
1303 *lambda.c(add_capture()): Change error message from C++1y to C++14.
1304 * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
1305 cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
1306 cp_parser_decltype, cp_parser_conversion_type_id,
1307 cp_parser_simple_type_specifier, cp_parser_type_id_1,
1308 cp_parser_template_type_arg, cp_parser_std_attribute,
1309 cp_parser_template_declaration_after_export): Ditto.
1310 * pt.c (tsubst): Ditto.
1311 * semantics.c (force_paren_expr, finish_decltype_type): Ditto.
1312 * tree.c: Change comment.
1313 * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
1314 cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
1316 2014-08-23 Jason Merrill <jason@redhat.com>
1318 Allow non-constexpr variable templates.
1319 * decl2.c (note_variable_template_instantiation): New.
1320 * cp-tree.h: Declare it.
1321 * pt.c (instantiate_decl): Call it.
1322 (push_template_decl_real): Allow non-constexpr variable templates.
1323 * semantics.c (finish_id_expression): Mark the variable template
1324 instantiation as used.
1325 * mangle.c (write_mangled_name): Variable template instantiations
1327 * parser.c (cp_parser_init_declarator): Complain about
1328 non-function implicit templates.
1330 2014-08-22 Marek Polacek <polacek@redhat.com>
1333 * parser.c (cp_parser_binary_expression): Check each LHS if it's
1334 preceded with logical not. Adjust call to
1335 warn_logical_not_parentheses.
1337 2014-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1340 * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
1341 declaration shadows a function declaration, unless the former
1342 declares a function, pointer to function or pointer to member
1343 function, because this is a common and valid case in real-world
1345 * cp-tree.h (TYPE_PTRFN_P,TYPE_REFFN_P,TYPE_PTRMEMFUNC_P):
1346 Improve description.
1348 2014-08-22 Jason Merrill <jason@redhat.com>
1351 * class.c (outermost_open_class): Fix logic.
1352 * decl.c (complete_vars): Fix logic.
1354 2014-08-22 Jason Merrill <jason@redhat.com>
1357 * class.c (outermost_open_class): New.
1358 * cp-tree.h: Declare it.
1359 * decl.c (maybe_register_incomplete_var): Use it.
1360 (complete_vars): Handle any constant variable.
1361 * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
1363 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
1366 * cp-array-notation.c (build_array_notation_ref): Added correct
1367 handling of case with incorrect array.
1369 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1372 * error.c (cp_diagnostic_finalizer): Delete.
1373 (init_error): Do not set diagnostic_finalizer here.
1375 2014-08-19 Marek Polacek <polacek@redhat.com>
1378 * call.c (build_new_op_1): Remember the type of arguments for
1379 a comparison. If either operand of a comparison is a boolean
1380 expression, call maybe_warn_bool_compare.
1382 2014-08-19 Jason Merrill <jason@redhat.com>
1384 PR tree-optimization/62091
1385 * decl2.c (decl_needed_p): Return true for virtual functions when
1390 * decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
1393 2014-08-19 Gerald Pfeifer <gerald@pfeifer.com>
1395 * class.c (contains_empty_class_p): Remove.
1397 2014-08-18 Paolo Carlini <paolo.carlini@oracle.com>
1399 * parser.c (cp_parser_expression): Add default arguments.
1400 (cp_parser_primary_expression, cp_parser_postfix_expression,
1401 cp_parser_array_notation, cp_parser_postfix_open_square_expression,
1402 cp_parser_unary_expression, cp_parser_direct_new_declarator,
1403 cp_parser_question_colon_clause, cp_parser_assignment_operator_opt,
1404 cp_parser_lambda_body, cp_parser_expression_statement,
1405 cp_parser_condition, cp_parser_c_for, cp_parser_range_for,
1406 cp_parser_iteration_statement, cp_parser_jump_statement,
1407 cp_parser_decltype_expr, cp_parser_noexcept_specification_opt,
1408 cp_parser_asm_operand_list, cp_parser_objc_message_receiver,
1409 cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement,
1410 cp_parser_omp_var_list_no_open, cp_parser_omp_clause_num_threads,
1411 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
1412 cp_parser_omp_clause_linear, cp_parser_omp_clause_device,
1413 cp_parser_omp_atomic, cp_parser_omp_for_loop_init,
1414 cp_parser_omp_for_loop, cp_parser_omp_declare_reduction_exprs,
1415 cp_parser_transaction_expression): Adjust.
1417 2014-08-15 Jason Merrill <jason@redhat.com>
1420 * pt.c (lookup_template_class_1): Revert recent change.
1421 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Revert recent change.
1424 * pt.c (instantiate_class_template_1): Ignore lambda on
1425 CLASSTYPE_DECL_LIST.
1426 (push_template_decl_real): A lambda is not primary.
1427 (lookup_template_class_1): Don't look for a lambda partial
1429 * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
1430 currently in a function and the lambda living in a function.
1431 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
1433 2014-08-15 Richard Biener <rguenther@suse.de>
1434 Jason Merrill <jason@redhat.com>
1437 * tree.c (build_min_array_type, set_array_type_canon): Split out...
1438 (build_cplus_array_type): ...from here. Only call build_array_type
1441 2014-08-15 Paolo Carlini <paolo.carlini@oracle.com>
1445 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1449 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1450 cv-qualifiers of function types.
1452 2014-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1454 * call.c (build_conditional_expr_1): Use OPT_Wextra in warning.
1456 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1458 * typeck.c (composite_pointer_type, cxx_sizeof_or_alignof_type,
1459 cp_build_array_ref, cp_build_function_call_vec): When a
1460 pedwarn is suppressed under SFINAE, return error_mark_node.
1462 * typeck.c (cxx_sizeof_or_alignof_type): Fix complain &
1463 tf_warning_or_error, where complain is a bool, glitch.
1465 2014-08-14 Ville Voutilainen <ville.voutilainen@gmail.com>
1468 * decl.c (grokdeclarator): Move the check for friend initializers..
1469 * decl2.c (grokfield) ..here. Postpone early return for friends
1470 until after the initializer check.
1472 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1475 * pt.c (coerce_template_parms): Improve error message vs default
1478 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1480 * parser.c (cp_parser_init_declarator): Remove redundant check of
1481 decl_specifiers->type.
1483 2014-08-13 Jason Merrill <jason@redhat.com>
1485 * call.c (build_x_va_arg): Support passing non-POD through ....
1486 (convert_arg_to_ellipsis): Likewise.
1488 2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
1490 * pt.c (lookup_template_variable): Make dependent variable templates
1493 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1495 * parser.c (cp_parser_elaborated_type_specifier): Handle
1496 specially cp_parser_template_id returning a BASELINK.
1498 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
1500 * parser.c (cp_parser_diagnose_invalid_type_name,
1501 cp_parser_make_typename_type): Remove scope parameter.
1502 (cp_parser_parse_and_diagnose_invalid_type_name,
1503 cp_parser_elaborated_type_specifier): Adjust calls.
1505 2014-08-12 Ville Voutilainen <ville.voutilainen@gmail.com>
1507 Reject virt-specifiers on friends and member templates
1508 * friend.c (do_friend): Diagnose virt-specifiers.
1509 * pt.c (push_template_decl_real): Diagnose virt-specifiers.
1511 2014-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1513 * typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
1514 return type to bool; in C++11 for constants give errors, not pedwarns.
1515 * cp-tree.h (check_narrowing): Adjust declaration.
1516 * call.c (convert_like_real): Update calls.
1517 * semantics.c (finish_compound_literal): Likewise.
1519 2014-08-08 Jason Merrill <jason@redhat.com>
1521 * pt.c (lookup_template_class_1): Copy abi_tag.
1523 2014-08-08 Kai Tietz <ktietz@redhat.com>
1525 * semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
1526 that we operate on a true inline.
1528 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1530 * class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
1531 optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
1533 2014-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1536 * decl.c (build_enumerator): Handle class types with conversion
1537 operators via perform_implicit_conversion_flags and
1538 build_expr_type_conversion.
1540 * cvt.c (build_expr_type_conversion): Replace pair of errors
1541 with error + inform.
1543 2014-08-07 Jason Merrill <jason@redhat.com>
1546 * parser.c (c_parse_file): Change sorry to fatal_error.
1549 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
1551 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
1553 * cp-tree.h, pt.c: Use hash_map instead of pointer_map.
1555 2014-08-06 Jason Merrill <jason@redhat.com>
1557 * init.c (build_vec_init): Fix constant initialization of
1559 (build_value_init_noctor): Call maybe_constant_init.
1560 * semantics.c (maybe_constant_init): See through EXPR_STMT and
1564 * init.c (build_vec_init): Reorganize earlier change a bit.
1567 * init.c (build_vec_init): Leave atype an ARRAY_TYPE
1568 if we're just returning an INIT_EXPR.
1570 2014-08-06 Jason Merrill <jason@redhat.com>
1571 Braden Obrzut <admin@maniacsvault.net>
1573 * pt.c (check_explicit_specialization): Don't test
1574 DECL_DECLARED_INLINE_P for a variable template.
1576 2014-08-06 Paolo Carlini <paolo.carlini@oracle.com>
1579 * typeck.c (cp_build_binary_op): Extend to more cases the
1582 2014-08-01 Braden Obrzut <admin@maniacsvault.net>
1584 Implement constexpr variable templates
1585 * decl.c (grokvardecl): Handle specializations of variable templates.
1586 (grokdeclarator): Handle variable template id expressions and NULL_TREE
1587 return from grokvardecl.
1588 * decl2.c (check_member_template): Allow declaration of template member
1590 * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for
1592 * pt.c (check_template_variable): Accept variable temploids at
1594 (push_template_decl_real): The current instantiation of a template
1596 (determine_specialization): Accept variable templates.
1597 (check_explicit_specialization): Handle and check for malformed
1598 variable template specializations.
1599 (lookup_template_variable): New.
1600 (tsubst_decl): Handle variable template specializations.
1601 (do_decl_instantiation): Handle template variables.
1602 (instantiate_decl): Handle template variables.
1603 * semantics.c (finish_template_variable): New.
1604 (finish_id_expression): Instantiate variable templates.
1605 * cp-tree.h (variable_template_p): New.
1607 2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1610 * decl.c (check_redeclaration_no_default_args): New.
1611 (duplicate_decls): Use it, handle default arguments
1612 in redeclarations of function templates.
1614 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1616 * optimize.c, semantics.c: Use hash_map instead of pointer_map.
1618 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
1620 * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
1621 method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
1622 instead of pointer_set.
1624 2014-08-01 Jason Merrill <jason@redhat.com>
1627 * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
1628 init-list for trailing elements.
1629 * typeck2.c (process_init_constructor_array): Likewise.
1631 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1634 * decl.c (duplicate_decls): Handle static member functions too.
1636 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1638 * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
1641 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1644 * parser.c (cp_parser_array_notation): Added check for array_type.
1646 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
1649 * cp-array-notation.c (expand_array_notation_exprs): Handling of
1650 DECL_EXPR improved. Changed handling for INIT_EXPR.
1652 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
1654 * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P.
1656 2014-08-01 Jakub Jelinek <jakub@redhat.com>
1658 * cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
1659 -fsanitize=alignment call ubsan_maybe_instrument_reference
1660 for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
1661 for calls to member functions.
1663 2014-07-31 Marc Glisse <marc.glisse@inria.fr>
1666 * typeck.c (maybe_warn_about_returning_address_of_local): Return
1667 whether it is returning the address of a local variable.
1668 (check_return_expr): Return 0 instead of the address of a local
1671 2014-07-30 Jason Merrill <jason@redhat.com>
1675 * pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
1677 2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1680 * pt.c (unify_arity): Add boolean parameter.
1681 (unify_too_few_arguments): Likewise.
1682 (type_unification_real): Diagnose correctly insufficient
1683 arguments in the presence of trailing variadic parameters;
1684 deducing multiple trailing packs as empty is fine.
1686 2014-07-30 Jason Merrill <jason@redhat.com>
1691 * decl2.c (mark_all_virtuals): New variable.
1692 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1693 (cp_write_global_declarations): Set it and give helpful diagnostic
1694 if it introduces errors.
1695 * class.c (finish_struct_1): Check it.
1699 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
1700 (check_explicit_specialization): Clear it on specializations.
1701 * decl.c (duplicate_decls, start_decl): Likewise.
1702 (grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
1703 * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
1704 linkage after setting the appropriate flags.
1705 * tree.c (decl_linkage): Don't check DECL_COMDAT.
1706 * decl2.c (mark_needed): Mark clones.
1707 (import_export_decl): Not here.
1709 2014-07-25 Edward Smith-Rowland <3dw4rd@verizon.net>
1711 Implement N4051 - Allow typename in a template template parameter
1712 * parser.c (cp_parser_type_parameter_key): New funtion;
1713 (cp_parser_token_is_type_parameter_key): Ditto;
1714 (cp_parser_type_parameter): Look for type-parameter-key for all versions
1715 but pedwarn for less than cxx1z.
1717 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1720 * call.c (standard_conversion): Use resolve_nondeduced_context
1721 for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
1723 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1726 * parser.c (cp_parser_tokens_start_cast_expression): Return -1
1729 2014-07-15 Jason Merrill <jason@redhat.com>
1732 * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
1736 * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
1737 * class.c (finish_struct): Reject invalid definition of
1738 std::initializer_list.
1740 2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
1742 * call.c (convert_like_real): Call print_z_candidate and inform only
1743 if permerror returns true.
1745 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
1747 * class.c (build_clone): Do not clear assembler names of
1749 * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
1750 * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
1751 as a special case return sizeof (struct tree_decl_non_common)
1753 (cp_common_init_ts): Do not initialize NAMESPACE_DECL;
1754 initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
1755 * cp/cp-tree.h (tree_template_decl): New structure.
1756 (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
1757 (union cp_lang_tree_node): Add template_decl.
1758 (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
1760 2014-07-14 Jason Merrill <jason@redhat.com>
1764 * pt.c (instantiate_decl): Don't check defer_ok for local class
1767 2014-07-14 Jakub Jelinek <jakub@redhat.com>
1770 * cp-tree.h (LITERAL_ZERO_P): Define.
1771 * parser.c (cp_parser_parenthesized_expression_list): Add
1772 want_literal_zero_p argument, if true, for literal zeros
1773 insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
1774 (cp_parser_postfix_expression): Adjust
1775 cp_parser_parenthesized_expression_list caller, handle
1776 -Wmemset-transposed-args.
1777 (literal_zeros): New variable.
1779 2014-07-13 Jason Merrill <jason@redhat.com>
1782 * semantics.c (is_instantiation_of_constexpr): Return true for
1783 defaulted functions, too.
1784 (explain_invalid_constexpr_fn): Only use
1785 explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P.
1786 * method.c (explain_implicit_non_constexpr): Pass
1787 DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr.
1790 * decl.c (check_initializer): Don't finish_compound_literal
1791 on erroneous constexpr init.
1794 * tree.c (bot_replace): Only replace a dummy 'this' parm.
1797 * decl.c (create_array_type_for_decl): Only check for auto once.
1800 * call.c (build_list_conv): Don't try to build a list of references.
1802 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
1804 PR C++/60209 - Declaration of user-defined literal operator cause error
1805 * parser.c (cp_parser_operator): Fold treatment of strings
1806 and user-defined string literals. Use the full string parser.
1807 (cp_parser_string_literal): Add flag to not look for literal operator.
1809 2014-07-11 Jason Merrill <jason@redhat.com>
1813 * call.c (build_conditional_expr_1): Avoid reading freed memory.
1815 2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
1818 * call.c (build_user_type_conversion_1): Copy LOOKUP_NO_NARROWING
1820 * decl.c (check_initializer): Don't call check_narrowing here,
1821 set LOOKUP_NO_NARROWING.
1822 * typeck2.c (digest_init_r): Likewise.
1824 2014-07-10 Jason Merrill <jason@redhat.com>
1827 * semantics.c (reduced_constant_expression_p): Handle CONSTRUCTOR.
1831 * decl2.c (mark_all_virtuals): New variable.
1832 (maybe_emit_vtables): Check it instead of flag_devirtualize.
1833 (cp_write_global_declarations): Set it and give helpful diagnostic
1834 if it introduces errors.
1835 * class.c (finish_struct_1): Check it.
1836 * decl.c (grokdeclarator): Clear virtualp after 'virtual auto' error.
1838 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1841 * decl.c (grokdeclarator): Adjust error messages about 'explicit'
1842 outside class declaration, in friend declaration, and neither on
1843 constructor nor conversion operator.
1845 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1849 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
1850 cv-qualifiers of function types.
1852 2014-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
1853 Paolo Carlini <paolo.carlini@oracle.com>
1856 * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
1859 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
1861 * class.c (check_for_override): Wrap the 'final' and 'override'
1862 keywords in %< and %>.
1864 2014-07-06 Marek Polacek <polacek@redhat.com>
1867 * cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
1868 * decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
1869 * typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
1872 2014-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1874 * pt.c (convert_template_argument): Use inform instead of error in
1877 2014-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1882 * parser.c (cp_parser_userdef_string_literal): Take a tree
1884 (cp_parser_string_literal): Don't hack the token stream.
1886 2014-06-30 Jason Merrill <jason@redhat.com>
1890 * decl2.c (maybe_emit_vtables): Mark all vtable entries if
1892 * init.c (build_vtbl_address): Don't mark destructor.
1893 * class.c (finish_struct_1): Add all classes to keyed_classes
1897 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
1900 * mangle.c (decl_mangling_context): Look through a TEMPLATE_DECL.
1902 * decl.c (build_ptrmemfunc_type): Don't give a PMF RECORD_TYPE
1903 TYPE_BINFO or TYPE_LANG_SPECIFIC.
1904 * cp-tree.h (TYPE_PTRMEMFUNC_FLAG): Use TYPE_LANG_FLAG_2.
1905 (TYPE_PTRMEMFUNC_P): Don't expect TYPE_LANG_SPECIFIC.
1906 * typeck.c (build_ptrmemfunc_access_expr): Don't use lookup_member.
1907 * pt.c (unify): Also check whether the argument is a PMF.
1909 2014-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1912 * parser.c (cp_parser_tokens_start_cast_expression): In C++11
1913 a '[' can also start a primary-expression.
1914 (cp_parser_cast_expression): Parse a cast-expression only tentatively
1915 when cp_parser_tokens_start_cast_expression returns -1.
1917 2014-06-30 Jason Merrill <jason@redhat.com>
1920 * pt.c (unify_one_argument): Type/expression mismatch just causes
1923 * semantics.c (simplify_aggr_init_expr): Remove remnants of
1926 2014-06-30 Marek Polacek <polacek@redhat.com>
1928 * cp-gimplify.c (cp_genericize): Don't instrument returns if the
1929 function has no_sanitize_undefined attribute.
1930 * decl.c (compute_array_index_type): Don't instrument VLAs if the
1931 function has no_sanitize_undefined attribute.
1933 2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
1936 * cp-array-notation.c (expand_sec_reduce_builtin):
1937 Check that bultin argument is correct.
1938 * call.c (build_cxx_call): Check for 0 arguments in builtin call.
1940 2014-06-28 Jonathan Wakely <jwakely@redhat.com>
1944 * typeck.c (check_return_expr): Lookup as an rvalue even when the
1945 types aren't the same.
1947 2014-06-27 Jason Merrill <jason@redhat.com>
1950 * error.c (dump_template_bindings): Don't tsubst in a clone.
1952 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1955 * semantics.c (finish_compound_literal): Revert r204228.
1957 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1959 * parser.c (cp_parser_compound_literal_p): New.
1960 (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it.
1962 2014-06-26 Jason Merrill <jason@redhat.com>
1964 * parser.c (cp_parser_for_init_statement): Change range-for error
1967 N3994 Ranged-based for-loops: The Next Generation
1968 * parser.c (cp_lexer_nth_token_is): New.
1969 (cp_parser_for_init_statement): Allow "for (id : init)".
1971 2014-06-26 Teresa Johnson <tejohnson@google.com>
1973 * class.c (dump_class_hierarchy): Use saved dump files.
1974 (dump_vtable): Ditto.
1977 2014-06-26 Adam Butcher <adam@jessamine.co.uk>
1980 * parser.c (cp_parser_elaborated_type_specifier): Only consider template
1981 parameter lists outside of function parameter scope.
1983 2014-06-25 Paolo Carlini <paolo.carlini@oracle.com>
1987 * typeck2.c (process_init_constructor_record): Do not complain about
1988 uninitialized const members, because within aggregate-initialization,
1989 members without explicit initializers are value-initialized.
1991 2014-06-25 Jakub Jelinek <jakub@redhat.com>
1993 * semantics.c (finish_omp_clauses): Make sure
1994 OMP_CLAUSE_LINEAR_STEP has correct type.
1996 2014-06-24 Jan Hubicka <hubicka@ucw.cz>
1998 * class.c (check_methods, create_vtable_ptr, determine_key_method,
1999 add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by
2000 FUNCTION_DECL check.
2001 * cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
2002 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
2003 (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
2004 (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
2006 2014-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2009 * decl.c (grokdeclarator): Do not early check for operator-function-id
2012 2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
2014 * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
2017 2014-06-24 Jakub Jelinek <jakub@redhat.com>
2019 * parser.c (cp_parser_omp_for_loop): For
2020 #pragma omp parallel for simd move lastprivate clause from parallel
2021 to for rather than simd.
2023 2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
2027 * decl.c (grokparms): Accept a single parameter of type 'void'.
2029 2014-06-20 Jason Merrill <jason@redhat.com>
2032 * call.c (add_function_candidate): Avoid special 'this' handling
2033 if we have a ref-qualifier.
2036 * call.c (build_over_call): Call build_this in template path.
2038 2014-06-19 Jason Merrill <jason@redhat.com>
2041 * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
2043 2014-06-18 Jason Merrill <jason@redhat.com>
2046 * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
2047 ref-qualifier handling.
2050 * pt.c (resolve_overloaded_unification): Preserve
2051 ARGUMENT_PACK_EXPLICIT_ARGS.
2053 2014-06-18 Jakub Jelinek <jakub@redhat.com>
2055 * cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
2057 * cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
2059 2014-06-17 Jason Merrill <jason@redhat.com>
2062 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
2064 2014-06-15 Jason Merrill <jason@redhat.com>
2067 * pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
2070 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
2072 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
2074 * decl.c (grokvardecl): Fix pasto in previous patch.
2076 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
2078 * decl.c (duplicate_decls): Use set_decl_tls_model.
2079 (grokdeclarator): Likewise.
2080 * semantics.c (finish_id_expression): Check TLS only for
2082 (finish_omp_threadprivate): Use decl_default_tls_model.
2083 * decl2.c (get_guard): Likewise.
2084 * call.c (make_temporary_var_for_ref_to_temp): Likewise.
2086 2014-06-14 Paolo Carlini <paolo.carlini@oracle.com>
2089 * decl.c (grokparms): Improve error message about void parameters.
2090 * error.c (type_to_string): Fix aka cut off code.
2092 2014-06-12 Jason Merrill <jason@redhat.com>
2094 * call.c (convert_arg_to_ellipsis): Use abi_version_crosses.
2095 * cvt.c (type_promotes_to): Likewise.
2096 * mangle.c (write_type, write_expression): Likewise.
2097 (write_name, write_template_arg): Likewise.
2098 (mangle_decl): Make alias based on flag_abi_compat_version.
2099 Emit -Wabi warning here.
2100 (finish_mangling_internal): Not here. Drop warn parm.
2101 (finish_mangling_get_identifier, finish_mangling): Adjust.
2102 (mangle_type_string, mangle_special_for_type): Adjust.
2103 (mangle_ctor_vtbl_for_type, mangle_thunk): Adjust.
2104 (mangle_guard_variable, mangle_tls_init_fn): Adjust.
2105 (mangle_tls_wrapper_fn, mangle_ref_init_variable): Adjust.
2107 * call.c (build_operator_new_call): Remove -fabi-version=1 support.
2108 * class.c (walk_subobject_offsets, include_empty_classes): Likewise.
2109 (layout_nonempty_base_or_field, end_of_class): Likewise.
2110 (layout_empty_base, build_base_field, layout_class_type): Likewise.
2111 (is_empty_class, add_vcall_offset_vtbl_entries_1): Likewise.
2112 (layout_virtual_bases): Likewise.
2113 * decl.c (compute_array_index_type): Likewise.
2114 * mangle.c (write_mangled_name, write_prefix): Likewise.
2115 (write_template_prefix, write_integer_cst, write_expression): Likewise.
2116 (write_template_arg, write_array_type): Likewise.
2117 * method.c (lazily_declare_fn): Likewise.
2118 * rtti.c (get_pseudo_ti_index): Likewise.
2119 * typeck.c (comp_array_types): Likewise.
2121 2014-06-11 Jan Hubicka <hubicka@ucw.cz>
2123 * vtable-class-hierarchy.c: Update handling for section names
2124 that are no longer trees.
2125 * decl.c (duplicate_decls): Likewise.
2127 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
2130 * parser.c (cp_parser_init_declarator): Actually pass friend_p
2131 to cp_parser_declarator.
2133 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
2136 * parser.c (cp_parser_using_declaration): Handle unscoped enums.
2137 * name-lookup.c (validate_nonmember_using_decl): Adjust error
2140 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
2143 * parser.c (cp_parser_declarator): Add bool parameter.
2144 (cp_parser_direct_declarator): Likewise, use it.
2145 (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
2146 (cp_parser_condition, cp_parser_explicit_instantiation,
2147 cp_parser_init_declarator, cp_parser_type_id_1,
2148 cp_parser_parameter_declaration, cp_parser_exception_declaration,
2149 cp_parser_cache_defarg, cp_parser_objc_class_ivars,
2150 cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
2152 * decl.c (grokdeclarator): Fix handling of friend declared in
2153 namespace scope (g++.dg/parse/friend10.C).
2155 2014-06-10 Jan Hubicka <hubicka@ucw.cz>
2157 * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)
2159 * optimize.c (cdtor_comdat_group): Fix handling of aliases.
2160 (maybe_clone_body): Move symbol across comdat groups.
2161 * method.c (use_thunk): Copy implicit section flag.
2163 2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
2166 * name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
2168 2014-06-07 Jan Hubicka <hubicka@ucw.cz>
2170 * method.c (use_thunk): Use set_decl_section_name.
2171 * optimize.c (maybe_clone_body): Use set_decl_section_name.
2172 * decl.c (duplicate_decls): Likewise.
2173 * vtable-class-hierarchy.c: Likewise.
2175 2014-06-06 Paolo Carlini <paolo.carlini@oracle.com>
2178 * class.c (check_field_decls): In C++11 mode do not reject
2179 static data members and reference-type members in unions.
2181 2014-06-05 Jason Merrill <jason@redhat.com>
2184 * decl.c (check_initializer): Collapse a TREE_LIST here.
2185 * typeck2.c (store_init_value): Not here.
2187 2014-06-05 Richard Biener <rguenther@suse.de>
2188 Paolo Carlini <paolo.carlini@oracle.com>
2191 * cp-gimplify.c (cp_gimplify_expr, [MODIFY_EXPR]): Rework
2192 handling of empty classes.
2194 2014-06-04 Jason Merrill <jason@redhat.com>
2196 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
2197 for noexcept and thread_local, too.
2200 * decl.c (check_initializer): Maybe clear
2201 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2203 2014-06-05 Richard Biener <rguenther@suse.de>
2206 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
2207 warnings for accessing empty classes.
2209 2014-06-05 Marek Polacek <polacek@redhat.com>
2212 * parser.c (cp_parser_binary_expression): Warn when logical not is
2213 used on the left hand side operand of a comparison.
2215 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
2218 * typeck.c (cp_build_modify_expr): Handle array of characters
2219 initialized by a string literal.
2220 * decl.c (check_initializer): Handle parenthesized string literal
2222 * typeck2.c (store_init_value): Remove redundant check.
2224 2014-06-04 Jason Merrill <jason@redhat.com>
2228 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
2229 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
2231 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
2234 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
2237 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2241 * call.c (standard_conversion): Convert nullptr to bool only
2242 in case of direct-initialization.
2243 (convert_like_real): Provide informative error message.
2245 2014-06-03 Marek Polacek <polacek@redhat.com>
2248 * semantics.c (finish_switch_cond): Warn if switch condition has
2251 2014-06-03 Jason Merrill <jason@redhat.com>
2254 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
2255 variable to local_specializations.
2258 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
2260 2014-06-02 Jason Merrill <jason@redhat.com>
2263 * decl.c (reshape_init_class): Handle un-folded
2264 constant-expressions.
2267 * pt.c (pack_deducible_p): Handle canonicalization.
2269 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
2271 * pt.c (tsubst_function_type): Initialize arg_types.
2273 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
2276 * class.c (handle_using_decl): Pass the correct scope to
2277 cp_emit_debug_info_for_using.
2279 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
2283 * search.c (accessible_p): Use current_nonlambda_class_type.
2284 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2286 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
2288 * decl.c: Include builtins.h.
2289 * semantics.c: Likewise.
2291 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
2295 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
2296 * pt.c (tsubst_function_type): Inject the this parameter; do the
2297 substitutions in the order mandated by the DR.
2298 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
2299 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
2300 (static_fn_type): Copy it.
2301 * decl2.c (build_memfn_type, change_return_type,
2302 cp_reconstruct_complex_type): Likewise.
2303 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
2304 * tree.c (strip_typedefs): Likewise.
2305 * typeck.c (merge_types): Likewise.
2307 2014-05-30 Jason Merrill <jason@redhat.com>
2310 * pt.c (instantiate_decl): Check that defer_ok is not set for
2311 local class members.
2314 * pt.c (tsubst_init): Split out from...
2315 (tsubst_expr) [DECL_EXPR]: Here.
2316 (tsubst_copy) [VAR_DECL]: Use it.
2317 * semantics.c (finish_id_expression): Return the decl for static/const.
2319 2014-05-28 Jason Merrill <jason@redhat.com>
2322 * decl.c (cxx_comdat_group): Return a decl.
2323 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
2325 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
2329 * call.c (build_aggr_conv): Ignore passed in flags.
2330 (build_array_conv, build_complex_conv): Likewise.
2332 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2334 * optimize.c (maybe_thunk_body): Use set_comdat_group.
2335 (maybe_clone_body): Likewise.
2336 * decl.c (duplicate_decls): Update code duplicating comdat group;
2337 do not copy symtab pointer; before freeing newdecl remove it
2339 * decl2.c (constrain_visibility): Use set_comdat_group.
2341 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2343 * rtti.c: Include tm_p.h
2344 (emit_tinfo_decl): Force RTTI data to be aligned to required
2347 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
2349 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
2350 ignoring other target adjustments.
2352 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
2354 * semantics.c (finish_omp_clauses): Remove duplicated variable
2357 * parser.c (cp_parser_omp_target): Return bool values.
2359 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2362 * lambda.c (add_capture): Enforce that capture by value requires
2364 * typeck2.c (cxx_incomplete_type_inform): Early return if
2365 TYPE_MAIN_DECL is null.
2367 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
2370 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
2372 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2375 * lambda.c (build_capture_proxy, add_capture): Treat normal
2376 captures and init-captures identically.
2378 2014-05-21 Mark Wielaard <mjw@redhat.com>
2381 * cp-lang.c (cxx_enum_underlying_base_type): New function.
2382 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
2384 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2386 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
2387 * cp-array-notation.c (replace_invariant_exprs): Likewise.
2388 (expand_array_notation): Handle VOID_CST.
2389 * error.c (dump_expr): Likewise.
2390 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
2391 (cxx_pretty_printer::expression): Likewise.
2392 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
2393 * decl.c (register_dtor_fn): Likewise.
2394 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
2395 (build_delete, push_base_cleanups): Likewise.
2396 * mangle.c (write_expression): Likewise.
2397 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
2398 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
2399 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
2400 * tree.c (cp_tree_equal): Likewise.
2401 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
2402 instead of void_zero_node.
2403 * typeck.c (check_return_expr): Likewise.
2404 * typeck2.c (build_functional_cast): Likewise.
2406 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
2409 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
2411 (cp_parser_statement): ...here. Make sure only semicolon can go after
2414 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2419 * typeck2.c (digest_nsdmi_init): New.
2420 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
2421 * init.c (get_nsdmi): Likewise.
2422 * cp-tree.h (digest_nsdmi_init): Declare.
2424 2014-05-20 Jason Merrill <jason@redhat.com>
2426 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
2427 up a virtual function in a dummy object.
2429 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2432 * decl.c (duplicate_decls): Replace pair of warning_at with
2433 warning_at + inform.
2434 (maybe_commonize_var): Likewise.
2436 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2439 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
2440 (tsubst_copy_and_build): Perform recursive substitutions in a
2441 deterministic order.
2443 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2446 * typeck2.c (cxx_incomplete_type_inform): New.
2447 (cxx_incomplete_type_diagnostic): Use it.
2448 * decl.c (grokdeclarator): Check the element type of an
2449 incomplete array type; call the above.
2450 * cp-tree.h (cxx_incomplete_type_inform): Declare.
2452 2014-05-19 Jason Merrill <jason@redhat.com>
2455 * pt.c (tsubst_copy): Don't check at_function_scope_p.
2456 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
2458 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
2460 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
2461 * parser.c (cp_parser_enum_specifier): Likewise.
2463 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
2465 * class.c (sorted_fields_type_new): Adjust.
2466 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
2467 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
2468 * cp-tree.h: Remove usage of variable_size gty attribute.
2469 * decl.c (make_label_decl): Adjust.
2470 (check_goto): Likewise.
2471 (start_preparsed_function): Likewise.
2472 (save_function_data): Likewise.
2473 * lex.c (init_reswords): Likewise.
2474 (retrofit_lang_decl): Likewise.
2475 (cxx_dup_lang_specific_decl): Likewise.
2476 (copy_lang_type): Likewise.
2477 (cxx_make_type): Likewise.
2478 * name-lookup.c (binding_entry_make): Likewise.
2479 (binding_table_construct): Likewise.
2480 (binding_table_new): Likewise.
2481 (cxx_binding_make): Likewise.
2482 (pushdecl_maybe_friend_1): Likewise.
2483 (begin_scope): Likewise.
2484 (push_to_top_level): Likewise.
2485 * parser.c (cp_lexer_alloc): Likewise.
2486 (cp_lexer_new_from_tokens): Likewise.
2487 (cp_token_cache_new): Likewise.
2488 (cp_parser_context_new): Likewise.
2489 (cp_parser_new): Likewise.
2490 (cp_parser_nested_name_specifier_opt): Likewise.
2491 (cp_parser_template_id): Likewise.
2492 * pt.c (maybe_process_partial_specialization): Likewise.
2493 (register_specialization): Likewise.
2494 (add_pending_template): Likewise.
2495 (lookup_template_class_1): Likewise.
2496 (push_tinst_level): Likewise.
2497 * semantics.c (register_constexpr_fundef): Likewise.
2498 (cxx_eval_call_expression): Likewise.
2499 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
2501 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
2504 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
2505 when cp_parser_lookup_name sets ambiguous_decls.
2507 2014-05-15 Jason Merrill <jason@redhat.com>
2509 * call.c (print_conversion_rejection): Use loc consistently.
2511 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2513 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
2514 * call.c (convert_like_real, build_new_method_call_1): Use it.
2515 * decl2.c (grokfield): Likewise.
2516 * init.c (perform_member_init, build_aggr_init, expand_default_init,
2517 build_new_1): Likewise.
2518 * mangle.c (write_expression): Likewise.
2519 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
2521 2014-05-14 Jason Merrill <jason@redhat.com>
2525 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
2526 dropped cv-quals as a bad conversion.
2527 (convert_like_real) [ck_ref_bind]: Explain them.
2528 (compare_ics): Check badness before stripping reference
2529 bindings. Handle comparing bad reference bindings.
2530 * typeck.c (comp_cv_qualification): Add overload that just takes
2532 * cp-tree.h: Declare it.
2534 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
2535 (arg_conversion_rejection, bad_arg_conversion_rejection)
2536 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
2537 (add_function_candidate): Pass actual argument, rather than type, to
2538 bad_arg_conversion_rejection.
2539 (print_conversion_rejection): Explain what's wrong with the conversion.
2540 (print_z_candidates): Say "candidate:" before each candidate.
2541 (splice_viable): Be strict if we see a viable or template candidate.
2542 (build_user_type_conversion_1): Pass false to strict parameter.
2543 (perform_overload_resolution, build_conditional_expr_1): Likewise.
2544 (build_new_op_1, build_new_method_call_1): Likewise.
2545 (build_op_call_1): Pass true to strict parameter.
2547 2014-05-13 Jason Merrill <jason@redhat.com>
2549 * call.c (print_error_for_call_failure): Say "no match" rather
2550 than "ambiguous" if there were no strict matches.
2551 (build_new_method_call_1): Likewise.
2554 * semantics.c (is_this_parameter): Allow capture proxies too.
2556 2014-05-12 Jason Merrill <jason@redhat.com>
2558 * call.c (maybe_print_user_conv_context): New.
2559 (convert_like_real): Use it. Print call context for bad
2560 user-defined conversion.
2561 (build_over_call): Print call context for bad 'this' conversion.
2563 * call.c (convert_like_real): Use inform for identifying the
2566 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
2568 * cvt.c (cp_convert_to_pointer): Don't call error_at if
2569 complain & tf_error is false.
2571 * decl.c (make_unbound_class_template): Prefer inform for
2572 "declared here"-type message.
2574 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
2578 * lambda.c (lambda_expr_this_capture): Add new parameter
2579 add_capture_p controlling whether the functions will try to
2580 capture 'this' via the default capture.
2581 (maybe_resolve_dummy): Likewise.
2582 * cp-tree.h: Adjust prototypes.
2583 * call.c, semantics.c: Change callers of these functions.
2584 * call.c (build_new_method_call_1): Use the actual 'this' that
2585 would be potentially captured for the overload resolution, instead
2586 of the dummy object.
2588 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2590 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
2592 (convert_nontype_argument): Adjust calls.
2593 (coerce_template_parameter_pack): Add missing complain & tf_error
2596 2014-05-09 Jason Merrill <jason@redhat.com>
2600 * call.c (build_conditional_expr_1, conditional_conversion): Handle
2601 non-class lvalues and xvalues that differ only in cv-qualifiers.
2605 * call.c (build_user_type_conversion_1): The copy-init temporary
2609 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
2612 * call.c (build_conditional_expr_1): If overload resolution finds
2613 no match, just say "different types".
2616 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
2619 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
2620 if we didn't find a conversion.
2621 Don't accept a bad conversion too early.
2623 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2626 * typeck.c (convert_for_assignment): Provide an inform for pointers
2627 to incomplete class types.
2629 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2632 * pt.c (convert_nontype_argument): Protect all the error calls
2633 with complain & tf_error.
2635 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
2638 * pt.c (instantiate_decl): Avoid generating the body of a
2641 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2644 * pt.c (maybe_begin_member_template_processing): Use
2645 uses_template_parms.
2647 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
2648 Mike Stump <mikestump@comcast.net>
2649 Richard Sandiford <rdsandiford@googlemail.com>
2651 * call.c: Include wide-int.h.
2652 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2653 (convert_for_arg_passing): Likewise.
2654 * class.c: Include wide-int.h.
2655 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
2656 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
2657 (include_empty_classes): Likewise
2658 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
2659 * cvt.c: Include wide-int.h.
2660 (ignore_overflows): Use wide_int_to_tree.
2661 * decl.c: Include wide-int.h.
2662 (check_array_designated_initializer): Use wide-int interfaces.
2663 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
2664 (finish_enum_value_list): Use signop.
2665 (build_enumerator): Use wide-int interfaces.
2666 * init.c: Include wide-int.h.
2667 (build_new_1): Use wide-int interfaces.
2668 * mangle.c: Include wide-int.h.
2669 (write_integer_cst): Use wide-int interfaces.
2670 (write_array_type): Likewise.
2671 * tree.c: Include wide-int.h.
2672 (cp_tree_equal): Use tree_int_cst_equal.
2673 * typeck2.c: Include wide-int.h.
2674 (process_init_constructor_array): Use wide-int interfaces.
2676 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2679 * decl.c (grokfndecl): Check duplicate_decls return value for
2681 * pt.c (instantiate_decl): A deleted function is defined.
2683 2014-05-02 Jason Merrill <jason@redhat.com>
2685 * decl2.c (vague_linkage_p): Local statics have vague linkage.
2688 * lambda.c (lambda_capture_field_type): Wrap anything dependent
2690 (add_capture): Check for VLA before calling it.
2691 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
2692 just the current one. Make non-static.
2693 * cp-tree.h: Declare it.
2694 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
2695 the operand was static or constant.
2697 2014-05-02 Marek Polacek <polacek@redhat.com>
2699 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
2702 2014-05-01 Marek Polacek <polacek@redhat.com>
2705 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
2706 between label and variable when warning about returning local address.
2708 2014-04-30 Jason Merrill <jason@redhat.com>
2711 * init.c (build_value_init): Don't try to call an array constructor.
2714 * typeck2.c (massage_init_elt): Use maybe_constant_init.
2716 2014-04-30 Marek Polacek <polacek@redhat.com>
2718 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
2719 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
2720 for non-integer types.
2722 2014-04-29 Jason Merrill <jason@redhat.com>
2725 Represent the unevaluated exception specification of an implicitly
2726 declared or deleted function with a simple placeholder, not a list
2728 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
2729 * except.c (unevaluated_noexcept_spec): New.
2730 * class.c (deduce_noexcept_on_destructor): Use it.
2731 * decl.c (check_redeclaration_exception_specification): Call
2732 maybe_instantiate_noexcept.
2733 (duplicate_decls): Call it before merge_types.
2734 (start_preparsed_function): Call maybe_instantiate_noexcept.
2735 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
2736 * init.c (get_nsdmi): Factor out of perform_member_init.
2737 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
2738 (walk_field_subobs): Consider NSDMI for EH spec.
2739 (get_defaulted_eh_spec): New.
2740 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
2741 (defaulted_late_check): Defer EH checking in non-template classes.
2742 (after_nsdmi_defaulted_late_checks): New.
2743 * parser.c (cp_parser_class_specifier_1): Use it.
2744 (unparsed_classes): New macro.
2745 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
2746 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
2747 Remove list-of-functions handling.
2748 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
2749 handling and FN parameter.
2750 * typeck.c (merge_types): Adjust.
2752 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2755 * parser.c (cp_parser_alias_declaration): Check return value of
2758 2014-04-24 Jakub Jelinek <jakub@redhat.com>
2760 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
2761 atomic-clause, allow comma in between atomic-clause and
2764 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
2767 * rtti.c (emit_support_tinfos): Do not iterate on
2768 registered_builtin_types (partial revert).
2770 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
2773 * semantics.c (apply_deduced_return_type): Complete non-void type
2774 before estimating whether the type is aggregate.
2776 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
2779 * rtti.c (emit_support_tinfo_1): New function, extracted from
2780 emit_support_tinfos.
2781 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
2783 2014-04-22 Jakub Jelinek <jakub@redhat.com>
2786 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
2787 fails, don't set OM_PARALLEL_COMBINED and return NULL.
2789 2014-04-18 Jason Merrill <jason@redhat.com>
2792 * call.c (reference_binding): Recurse on user-defined conversion.
2795 * call.c (standard_conversion): Don't try to apply restrict to void.
2797 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
2799 * decl.c (reshape_init_r): Handle a single element of vector type.
2801 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2804 * decl2.c (cplus_decl_attributes): Handle
2805 pointer-to-member-function declarations.
2807 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
2810 * call.c (build_user_type_coversion): Use build_dummy_object
2811 to create the placeholder object for a constructor method call.
2812 (build_special_member_call): Likewise.
2813 (build_over_call): Check for the placeholder object with
2815 (build_new_method_call_1): Likewise. Don't attempt to resolve
2816 a dummy object for a constructor method call.
2818 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
2821 * friend.c (add_friend, make_friend_class): Move repeated friend
2822 warning under Wredundant_decls.
2824 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
2826 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
2827 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2828 (do_class_using_decl): Likewise.
2829 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
2831 2014-04-15 Jakub Jelinek <jakub@redhat.com>
2834 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
2836 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2838 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
2840 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
2842 * pt.c (mark_template_parm): Use template_parm_level_and_index.
2844 2014-04-11 Jason Merrill <jason@redhat.com>
2846 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
2848 (cp_lexer_get_preprocessor_token): Always clear it.
2849 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
2853 * decl.c (reshape_init_r): Handle a single element of class type.
2856 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
2857 built-in operator new.
2859 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2862 * name-lookup.c (parse_using_directive): Return early if the
2863 attribs argument is error_mark_node; use get_attribute_name.
2865 2014-04-11 Jason Merrill <jason@redhat.com>
2869 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
2870 * call.c (struct z_candidate): Add flags field.
2871 (add_candidate): Add flags parm.
2872 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
2873 (add_template_candidate_real): Pass it.
2874 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
2875 * tree.c (build_aggr_init_expr): Copy it.
2876 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
2878 2014-04-10 Richard Biener <rguenther@suse.de>
2879 Jakub Jelinek <jakub@redhat.com>
2882 * error.c (dump_decl) <case FUNCTION_DECL>: If
2883 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
2884 recurse on DECL_ABSTRACT_ORIGIN instead of printing
2887 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
2889 * pt.c (check_template_variable): Check for the return of pedwarn
2890 before emitting a note.
2891 * parser.c (cp_parser_lambda_introducer): Likewise.
2893 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2896 * pt.c (process_template_parm): For an invalid non-type parameter
2897 only set TREE_TYPE to error_mark_node.
2898 (push_inline_template_parms_recursive, comp_template_parms,
2899 redeclare_class_template, coerce_template_template_parm,
2900 coerce_template_template_parms, unify): Use error_operand_p.
2902 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
2904 * class.c (check_bases_and_members): Warn about non-virtual dtors
2905 in public bases only. Check warn_ecpp before complaining about
2906 non-polymorphic bases.
2908 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2910 * decl.c (duplicate_decls): Check for the return of warning_at
2911 before emitting a note.
2912 (warn_misplaced_attr_for_class_type): Likewise.
2913 (check_tag_decl): Likewise.
2915 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
2918 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
2920 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
2923 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
2924 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
2925 instantiating a variable-sized type.
2928 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
2930 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2932 * class.c (find_abi_tags_r): Check for the return of warning
2933 before emitting a note.
2934 (one_inherited_ctor): Likewise.
2936 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
2938 * decl.c (duplicate_decls): Check for the return of permerror
2939 before emitting a note.
2941 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
2943 * class.c (accessible_nvdtor_p): New.
2944 (check_bases): Don't check base destructor here ...
2945 (check_bases_and_members): ... check them here. Trigger on
2946 Wnon-virtual-dtor flag.
2947 (finish_struct_1): Use accessible_nvdtor_p.
2949 2014-04-01 Jason Merrill <jason@redhat.com>
2951 * pt.c (process_partial_specialization): Say "not deducible"
2952 rather than "not used". Use inform.
2955 * pt.c (coerce_template_parms): Check that the pack expansion
2956 pattern works with the first matching parameter.
2958 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
2960 * init.c (perform_member_init): Homogenize uninitialized
2963 2014-04-01 Jason Merrill <jason@redhat.com>
2966 * call.c (build_array_conv): Call complete_type.
2969 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
2970 (picflag_from_initializer): Return it.
2971 (process_init_constructor): Handle it.
2974 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
2975 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
2976 * pt.c (get_template_info): Handle NAMESPACE_DECL.
2977 (most_general_template): Handle more kinds of template.
2978 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
2979 instantiations and specializations.
2981 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
2984 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
2985 COMPONENT_REFs and ARRAY_REFs sooner.
2987 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
2990 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
2991 usage in non-functions with pushed scope.
2993 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
2996 * name-lookup.h (cp_binding_level): New transient field defining_class_p
2997 to indicate whether a scope is in the process of defining a class.
2998 * semantics.c (begin_class_definition): Set defining_class_p.
2999 * name-lookup.c (leave_scope): Reset defining_class_p.
3000 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
3001 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
3002 unwinding to class-defining scope to handle the erroneous definition of
3003 a generic function of an arbitrarily nested class within an enclosing
3006 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
3009 * method.c (walk_field_subobs): Improve the diagnostic
3010 locations for both REFERENCE_TYPEs and non-static const members.
3011 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
3012 instead of %qD to be consistent with the c++11 diagnostic.
3014 2014-03-25 Jason Merrill <jason@redhat.com>
3018 * class.c (build_vtbl_initializer): Handle abstract dtors here.
3019 * search.c (get_pure_virtuals): Not here.
3022 * parser.c (cp_parser_lambda_expression): Don't parse the body of
3023 a lambda in unevaluated context.
3026 * decl.c (create_array_type_for_decl): Complain about array of auto.
3028 2014-03-25 Jakub Jelinek <jakub@redhat.com>
3031 * semantics.c (potential_constant_expression_1): Handle
3034 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
3037 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
3038 introducing an implicit function template parameter within an explicit
3041 2014-03-22 Jason Merrill <jason@redhat.com>
3044 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
3047 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3050 * name-lookup.c (push_class_level_binding_1): Check identifier_p
3051 on the name argument.
3053 2014-03-20 Jakub Jelinek <jakub@redhat.com>
3056 * init.c (build_zero_init_1): Ignore fields with error_mark_node
3059 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
3062 * call.c (build_new_method_call_1): Handle pure virtuals called by
3065 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
3068 * parser.c (cp_parser_member_declaration): Don't allow
3069 finish_fully_implicit_template to consider friend declarations to be
3070 class member templates.
3071 (synthesize_implicit_template_parm): Handling winding back through class
3072 scope to the class being defined in order to inject a template argument
3076 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
3077 function scope as per cp_parser_skip_to_end_of_statement.
3079 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
3082 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
3084 2014-03-14 Jason Merrill <jason@redhat.com>
3088 * search.c (get_pure_virtuals): Handle abstract dtor here.
3089 (dfs_get_pure_virtuals): Not here.
3092 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
3093 abstract class as pure.
3095 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
3098 * pt.c (maybe_process_partial_specialization): Check return value
3099 of check_specialization_namespace.
3101 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
3104 * semantics.c (finish_static_assert): Call cxx_constant_value only
3105 if require_potential_rvalue_constant_expression returns true.
3107 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
3110 * method.c (get_inherited_ctor): New.
3111 * cp-tree.h (get_inherited_ctor): Declare it.
3112 * semantics.c (is_valid_constexpr_fn): Use it.
3114 2014-03-10 Jason Merrill <jason@redhat.com>
3117 * call.c (convert_default_arg): Remove special handling for
3121 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
3122 when deciding whether to call push_template_decl for a member class.
3123 * pt.c (push_template_decl_real): Return after wrong levels error.
3125 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
3128 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
3129 lambda, remove the lambda's own template argument list prior to fetching
3133 * parser.c (cp_parser_parameter_declaration_clause): Move generic
3134 function template unwinding on error into a more general location, ...
3135 (cp_parser_skip_to_end_of_statement): ... here.
3137 2014-03-07 Jason Merrill <jason@redhat.com>
3139 * Make-lang.in (check_g++_parallelize): Split dg.exp.
3141 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
3142 we're in a trailing return type.
3144 * typeck.c (comp_template_parms_position): 'auto' and
3145 'decltype(auto)' are different from real template parms.
3147 * parser.c (cp_parser_using_declaration): Consume the semicolon
3148 after bare parameter pack error.
3150 * cp-tree.h (REF_PARENTHESIZED_P): New.
3151 * semantics.c (force_paren_expr): Set it.
3152 * pt.c (do_auto_deduction): Check it.
3153 (tsubst) [COMPONENT_REF]: Copy it.
3154 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
3156 * decl.c (create_array_type_for_decl): Only warn about invalid
3157 C++1y VLA if flag_iso or warn_vla>0.
3158 (grokdeclarator): Likewise.
3159 * pt.c (tsubst): Likewise.
3160 * semantics.c (finish_decltype_type): Likewise.
3161 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
3162 (cp_build_addr_expr_1): Likewise.
3163 * init.c (build_new_1): Improve diagnostics.
3165 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
3168 * decl.c (check_initializer): Return NULL_TREE after error;
3169 consistently use inform.
3171 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
3173 * decl.c (check_initializer): Remove dead code.
3175 2014-03-06 Marek Polacek <polacek@redhat.com>
3178 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
3179 of checking tree code.
3181 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
3183 * parser.c (cp_lexer_set_source_position): New.
3184 (cp_parser_mem_initializer): Use it.
3185 (cp_parser_postfix_open_square_expression): Likewise.
3186 (cp_parser_parenthesized_expression_list): Likewise.
3187 (cp_parser_new_initializer): Likewise.
3188 (cp_parser_jump_statement): Likewise.
3189 (cp_parser_initializer): Likewise.
3190 (cp_parser_functional_cast): Likewise.
3192 2014-03-05 Jason Merrill <jason@redhat.com>
3195 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
3196 dependent expression.
3199 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
3200 if re-parsing might succeed.
3201 * semantics.c (finish_id_expression): Use of a parameter outside
3202 the function body is a parse error.
3204 * parser.c (cp_parser_mem_initializer): Set input_location
3205 properly for init-list warning.
3206 (cp_parser_postfix_open_square_expression): Likewise.
3207 (cp_parser_parenthesized_expression_list): Likewise.
3208 (cp_parser_new_initializer): Likewise.
3209 (cp_parser_jump_statement): Likewise.
3210 (cp_parser_initializer): Likewise.
3211 (cp_parser_functional_cast): Likewise.
3213 2014-03-04 Jason Merrill <jason@redhat.com>
3216 * typeck2.c (process_init_constructor_record): Set
3217 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
3221 * parser.c (cp_parser_direct_declarator): Set declarator to
3222 cp_error_declarator on invalid qualified-id.
3224 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
3227 * parser.c (cp_parser_using_declaration): Early return when
3228 cp_parser_nested_name_specifier errors out.
3230 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
3233 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
3234 function scope on parse error in function parameter list.
3236 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
3238 * method.c (implicitly_declare_fn): Remove redundant
3239 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
3240 * semantics.c (is_instantiation_of_constexpr): Likewise.
3241 * error.c (dump_function_decl): Likewise.
3243 2014-03-01 Jason Merrill <jason@redhat.com>
3246 * semantics.c (begin_maybe_infinite_loop): Use
3247 fold_non_dependent_expr_sfinae.
3249 2014-02-28 Jason Merrill <jason@redhat.com>
3252 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
3254 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
3257 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
3258 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
3259 * lambda.c (maybe_add_lambda_conv_op): Likewise.
3261 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
3264 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
3267 2014-02-27 Jason Merrill <jason@redhat.com>
3271 * decl2.c (tentative_decl_linkage): Don't mess with functions that
3272 are not yet defined.
3274 2014-02-26 Jason Merrill <jason@redhat.com>
3278 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
3279 * init.c (build_vtbl_address): Do it here.
3285 * pt.c (struct warning_sentinel): New.
3286 (tsubst_copy_and_build): Use it instead of
3287 c_inhibit_evaluation_warnings.
3288 * typeck.c (maybe_warn_about_useless_cast): Remove
3289 c_inhibit_evaluation_warnings check.
3292 * pt.c (get_template_parm_index): New.
3293 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
3294 (process_template_parm): Allow bare packs in template template
3295 parm template parms.
3296 (coerce_template_parameter_pack): Handle fixed template template
3297 parm packs and fixed packs not at the end of the parm list.
3298 (coerce_template_parms): Handle template parm packs not at the end
3300 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
3303 * pt.c (unify): Ignore alias templates when deducing a template
3309 * call.c (reference_binding): Recurse on user-defined conversion.
3310 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3312 2014-02-25 Jason Merrill <jason@redhat.com>
3315 * call.c (reference_binding): Recurse on user-defined conversion.
3316 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
3318 * call.c (print_conversion_rejection): Handle n_arg of -2.
3319 (build_user_type_conversion_1): Pass it.
3322 * decl2.c (no_linkage_error): Handle C++98 semantics.
3323 (reset_type_linkage): Move from decl.c.
3324 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
3325 (bt_reset_linkage_2, reset_decl_linkage): New.
3326 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
3327 (cp_write_global_declarations): Move condition into no_linkage_error.
3328 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
3329 * semantics.c (expand_or_defer_fn_1): Factor out
3330 tentative_decl_linkage.
3331 * cp-tree.h: Adjust.
3333 * decl2.c (finish_static_data_member_decl): Diagnose static data
3334 member in unnamed class.
3335 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
3338 * class.c (clone_function_decl): Call note_vague_linkage_fn for
3339 defaulted virtual dtor.
3343 * pt.c (get_underlying_template): Fix equivalence calculation.
3345 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
3348 * parser.c (function_being_declared_is_template_p): Return false when
3349 processing a template parameter list.
3350 (cp_parser_parameter_declaration_clause): Don't set
3351 auto_is_implicit_function_template_parm_p when processing a
3352 template parameter list.
3354 * parser.c (synthesize_implicit_template_parm): Inject new template
3355 argument list appropriately when a generic member function
3356 of a class template is declared out-of-line.
3359 * parser.c (cp_parser_direct_declarator): Don't save and
3360 restore num_template_parameter_lists around call to
3361 cp_parser_parameter_declaration_list.
3362 (function_being_declared_is_template_p): New predicate.
3363 (cp_parser_parameter_declaration_list): Use
3364 function_being_declared_is_template_p as predicate for
3365 inspecting current function template parameter list length
3366 rather than num_template_parameter_lists.
3368 2014-02-24 Jason Merrill <jason@redhat.com>
3371 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
3372 DECL_EXPR initialize a non-class iterator.
3375 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
3377 2014-02-21 Jason Merrill <jason@redhat.com>
3380 * parser.c (cp_parser_type_name): Always check dependency.
3381 (cp_parser_type_specifier_seq): Call
3382 cp_parser_parse_and_diagnose_invalid_type_name.
3385 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
3388 * parser.c (cp_parser_default_argument): Clear
3389 current_class_ptr/current_class_ref like tsubst_default_argument.
3392 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
3393 than current_binding_level.
3396 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
3399 * parser.c (cp_parser_enum_specifier): Call
3400 check_for_bare_parameter_packs.
3403 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
3407 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
3408 of the partial instantiation, not the most general template.
3409 (maybe_process_partial_specialization): Reassign everything on
3413 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
3414 (check_explicit_specialization): Don't clone.
3417 * pt.c (coerce_template_parms): Bail if argument packing fails.
3420 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
3421 Don't get confused by a CONSTRUCTOR that already has a type.
3424 * call.c (build_array_conv): Don't crash on VLA.
3427 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
3430 * lambda.c (maybe_resolve_dummy): Don't try to capture this
3431 in declaration context.
3435 * pt.c (unify): Only unify if deducible. Handle 0-length list.
3438 * parser.c (cp_parser_direct_declarator): Don't wrap a
3439 type-dependent expression in a NOP_EXPR.
3442 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
3447 * parser.c (cp_parser_template_argument): Restore dereference.
3448 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
3449 (process_partial_specialization): Handle deref.
3452 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
3456 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
3457 implicit_template_scope upon leaving an out-of-line generic member
3458 function definition.
3460 2014-02-20 Kai Tietz <ktietz@redhat.com>
3463 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
3464 valued type argument as error_mark_node.
3467 * semantics.c (finish_fname): Handle error_mark_node.
3469 2014-02-19 Jason Merrill <jason@redhat.com>
3472 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
3473 spec from template context.
3475 2014-02-19 Jakub Jelinek <jakub@redhat.com>
3478 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
3479 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
3482 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
3484 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3487 * semantics.c (ensure_literal_type_for_constexpr_object): Use
3490 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
3493 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
3494 During error recovery allow_non_constant may be false.
3496 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
3499 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
3500 scope whenever a template parameter list has been started, independent
3501 of whether the function call operator was well-formed or not.
3504 * parser.c (cp_parser_member_declaration): Pop fully implicit template
3505 scope for generic friend declarations as well as for non-friends.
3507 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
3510 * method.c (implicitly_declare_fn): A constructor of a class with
3511 virtual base classes isn't constexpr (7.1.5p4).
3513 2014-02-05 Jan Hubicka <hubicka@ucw.cz
3515 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
3517 2014-02-05 Jakub Jelinek <jakub@redhat.com>
3520 * parser.c (cp_parser_omp_declare_reduction): Save and free
3523 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
3527 * tree.c (handle_init_priority_attribute): Call default_conversion on
3528 the attribute argument.
3530 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
3533 * method.c (synthesized_method_walk): If vbases is non-null but
3534 is_empty is true, likewise don't worry about the virtual bases.
3536 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
3539 * typeck2.c (process_init_constructor_record): Just skip unnamed
3542 2014-01-31 Jason Merrill <jason@redhat.com>
3545 * pt.c (mark_decl_instantiated): Call mark_needed.
3548 * decl2.c (handle_tls_init): Handle null init fn.
3551 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
3553 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
3556 * class.c (build_vfield_ref): Early return error_mark_node if
3557 TYPE_VFIELD (type) is null.
3558 (build_base_path): Check return value of build_vfield_ref.
3560 2014-01-31 Jason Merrill <jason@redhat.com>
3563 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
3564 [ck_list]: Check for error_mark_node.
3565 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
3568 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
3569 during partial ordering.
3571 2014-01-31 Marek Polacek <polacek@redhat.com>
3574 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
3576 2014-01-30 Jason Merrill <jason@redhat.com>
3579 * cp-tree.h (struct saved_scope): Add x_local_specializations.
3580 (local_specializations): New macro.
3581 * pt.c (local_specializations): Remove variable.
3583 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
3586 * parser.c (make_string_pack): Use double_int::from_buffer.
3588 2014-01-30 Marek Polacek <polacek@redhat.com>
3591 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
3593 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
3594 with input_location.
3595 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
3598 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3601 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
3603 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3606 * pt.c (lookup_template_class_1): Check start_enum return value
3607 for error_mark_node.
3609 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3611 * decl.c (duplicate_decls, typename_hash, typename_compare):
3612 Use TYPE_IDENTIFIER.
3613 * error.c (dump_type): Likewise.
3614 * mangle.c (dump_substitution_candidates): Likewise.
3616 2014-01-30 Jason Merrill <jason@redhat.com>
3619 * decl2.c (attributes_naming_typedef_ok): New.
3620 * cp-tree.h: Declare it.
3621 * decl.c (grokdeclarator): Check it.
3622 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
3624 2014-01-29 Jason Merrill <jason@redhat.com>
3627 * call.c (add_builtin_candidate): Catch dependent types.
3630 * pt.c (expand_template_argument_pack): Correct
3631 non_default_args_count calculation.
3634 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
3637 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
3638 have a friend template in a class template.
3639 * pt.c (tsubst_friend_function): Look through it.
3640 (push_template_decl_real): A friend member template is
3643 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3646 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
3649 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3652 * pt.c (instantiate_template_1): Check for error_mark_node the second
3655 2014-01-29 Jason Merrill <jason@redhat.com>
3658 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
3659 cdtor_returns_this case.
3662 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
3664 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3667 * semantics.c (finish_omp_reduction_clause): Check type for
3670 2014-01-28 Jason Merrill <jason@redhat.com>
3673 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
3674 (tsubst_copy): Use it if lookup fails.
3677 * pt.c (tsubst_function_type): Make sure we keep the same function
3681 * semantics.c (build_anon_member_initialization): Stop walking
3682 when we run out of COMPONENT_REFs.
3685 * decl.c (lookup_and_check_tag): Ignore template parameters if
3686 scope == ts_current.
3687 * pt.c (check_template_shadow): Don't complain about the injected
3690 * decl.c (duplicate_decls): Tweak.
3693 * mangle.c (write_unqualified_name): Handle operator auto.
3695 2014-01-27 Jason Merrill <jason@redhat.com>
3699 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
3700 list-initialization. A conversion to rvalue ref that involves
3701 an lvalue-rvalue conversion is bad.
3702 (convert_like_real): Give helpful error message.
3705 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
3708 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
3712 * pt.c (template_parm_to_arg): Call convert_from_reference.
3713 (tsubst_template_arg): Don't strip reference refs.
3716 * call.c (build_aggr_conv): Reject value-initialization of reference.
3720 * call.c (convert_like_real): Give helpful error about excess braces
3721 for ck_rvalue of scalar type.
3724 * call.c (reference_binding): Only elide braces if the single
3725 element is reference-related.
3728 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
3732 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
3736 * decl.c (compute_array_index_type): Don't call
3737 maybe_constant_value for a non-integral expression.
3739 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
3741 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
3743 * cp-gimplify.c (cp_genericize): Likewise.
3744 * decl.c (grokfndecl): Likewise.
3745 * parser.c (cp_parser_postfix_expression): Likewise.
3746 (cp_parser_postfix_open_square_expression): Likewise.
3747 (cp_parser_direct_declarator): Likewise.
3748 (is_cilkplus_vector_p): Likewise.
3749 (cp_parser_omp_clause_name): Likewise.
3750 (cp_parser_omp_all_clauses): Likewise.
3751 * pt.c (apply_late_template_attributes): Likewise.
3752 * typeck.c (cp_build_array_ref): Likewise.
3753 (cp_build_compound_expr): Likewise.
3754 (check_return_expr): Likewise.
3756 2014-01-24 Jason Merrill <jason@redhat.com>
3759 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
3764 * typeck2.c (process_init_constructor_array): Don't create
3767 2014-01-24 Jakub Jelinek <jakub@redhat.com>
3769 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
3770 handling for RANGE_ARRAY case.
3772 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
3775 * name-lookup.c (push_using_directive): Use timevar_cond_start.
3777 2014-01-23 Marek Polacek <polacek@redhat.com>
3780 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
3782 2014-01-23 Marek Polacek <polacek@redhat.com>
3785 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
3788 2014-01-23 Jason Merrill <jason@redhat.com>
3791 * cp-tree.h (struct language_function): Add infinite_loop and
3793 (current_function_infinite_loop): New.
3794 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
3795 (break_maybe_infinite_loop): New.
3796 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
3797 (finish_do_stmt, finish_for_cond, finish_for_stmt)
3798 (begin_range_for_stmt): Use them.
3799 * decl.c (finish_function): Don't warn about missing return
3800 if current_function_infinite_loop.
3801 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
3802 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
3804 * call.c (build_op_delete_call): Use make_tree_vector and
3805 release_tree_vector.
3807 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3810 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
3811 nested_name_specifier.
3813 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
3815 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
3816 see if there is an attribute after function decl. If so, then
3818 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
3819 enabled function late parsing.
3820 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
3821 attribute for a SIMD-enabled function.
3822 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
3823 the function is used by SIMD-enabled function (indicated by NULL
3824 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
3825 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
3826 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
3827 vectorlength clause in SIMD-enabled function and #pragma SIMD's
3828 vectorlength clause. Added a new bool parameter to differentiate
3830 (cp_parser_cilk_simd_fn_vector_attrs): New function.
3831 (is_cilkplus_vector_p): Likewise.
3832 (cp_parser_late_parsing_elem_fn_info): Likewise.
3833 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
3834 and "vectorlength" clauses when Cilk Plus is enabled.
3835 (cp_parser_omp_clause_linear): Added a new parameter of type bool
3836 and emit a sorry message when step size is a parameter.
3837 * parser.h (cp_parser::cilk_simd_fn_info): New field.
3838 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
3840 * pt.c (apply_late_template_attributes): Likewise.
3842 2014-01-23 Jakub Jelinek <jakub@redhat.com>
3845 * semantics.c (finish_omp_reduction_clause): Reject
3846 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
3848 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
3851 * parser.c (cp_parser_class_head): Push the class before parsing
3852 the base-clause, pop after it.
3854 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
3856 * decl2.c (cpp_check): Revert prototype change.
3858 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3862 * init.c (build_value_init_noctor): Don't pass error_mark_node to
3865 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
3868 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
3869 only when errorcount == 0.
3871 2014-01-17 Marek Polacek <polacek@redhat.com>
3874 * cvt.c (ocp_convert): Don't segfault on non-existing
3875 ENUM_UNDERLYING_TYPE.
3877 2014-01-16 Jason Merrill <jason@redhat.com>
3880 * tree.c (bot_manip): Update the location of builtin_LINE and
3883 2014-01-14 Jason Merrill <jason@redhat.com>
3886 * typeck2.c (massage_init_elt): New.
3887 (process_init_constructor_record)
3888 (process_init_constructor_union): Use it.
3889 (process_init_constructor_array): Use it. Use RANGE_EXPR.
3890 (split_nonconstant_init_1): Handle it.
3891 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
3893 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
3896 * parser.c (cp_parser_postfix_expression): Added a new if-statement
3897 and replaced an existing if-statement with else-if statement.
3898 Changed an existing error message wording to match the one from the C
3901 2014-01-08 Jason Merrill <jason@redhat.com>
3904 * class.c (abi_tag_data): Add tags field.
3905 (check_abi_tags): Initialize it.
3906 (find_abi_tags_r): Support collecting missing tags.
3907 (mark_type_abi_tags): Don't look at template args.
3908 (inherit_targ_abi_tags): New.
3909 (check_bases_and_members): Use it.
3910 * cp-tree.h (ABI_TAG_IMPLICIT): New.
3911 * mangle.c (write_abi_tags): Check it.
3913 2014-01-07 Jason Merrill <jason@redhat.com>
3916 * pt.c (num_innermost_template_parms): New.
3917 (get_underlying_template): Use it.
3920 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
3922 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3924 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
3925 the letter of 20.11.6 about Base and Derived naming the same
3926 class type modulo cv-qualifiers.
3928 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
3931 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
3932 function as unimplemented for generic lambdas with varargs.
3935 * parser.c (cp_parser_template_parameter): Early out with
3936 error_mark_node if parameter declaration was not parsed.
3939 * parser.c (cp_parser_lambda_expression): Save/reset/restore
3940 auto_is_implicit_function_template_parm_p around lambda body.
3943 * parser.c (cp_parser_init_declarator): Undo fully implicit
3944 template parameter list when declarator is not a function.
3946 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
3949 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
3951 2014-01-03 Tobias Burnus <burnus@net-b.de>
3954 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
3956 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3960 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
3961 as include_std to perform_koenig_lookup.
3962 (cp_parser_postfix_expression): Adjust.
3963 * pt.c (tsubst_copy_and_build): Likewise.
3964 * semantics.c (perform_koenig_lookup): Remove bool parameter.
3965 (omp_reduction_lookup): Adjust.
3966 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
3967 (lookup_arg_dependent): Likewise.
3968 (lookup_function_nonclass): Adjust.
3969 * name-lookup.h: Adjust declaration.
3970 * cp-tree.h: Likewise.
3972 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3975 * parser.c (cp_parser_userdef_numeric_literal): Mention
3976 -fext-numeric-literals in the message.
3978 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3981 * call.c (build_conditional_expr_1): Check the return value of
3984 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3986 * call.c (convert_like_real): Check complain.
3988 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3991 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
3994 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3996 Update copyright years
3998 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
4000 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
4001 the standard form for the copyright notice.
4003 Copyright (C) 2014 Free Software Foundation, Inc.
4005 Copying and distribution of this file, with or without modification,
4006 are permitted in any medium without royalty provided the copyright
4007 notice and this notice are preserved.