1 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
3 * call.c: Remove comment documenting the long-deleted
4 function build_method_call.
6 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
9 * typeck.c (cp_build_binary_op): Warn when comparing an address
10 of a reference against NULL.
12 2015-06-12 Jason Merrill <jason@redhat.com>
15 * pt.c (tsubst_decl) [VAR_DECL]: Mark namespace-scope
16 variables as DECL_NOT_REALLY_EXTERN.
18 2015-06-11 Jason Merrill <jason@redhat.com>
21 * constexpr.c (potential_constant_expression_1): Handle a
22 DECL_EXPR of TYPE_DECL.
25 * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
28 2015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
30 * decl.c (cxx_init_decl_processing): Register the main
31 translation unit through the new debug hook.
33 2015-06-10 Jason Merrill <jason@redhat.com>
36 * cp-tree.h (TEMPLATE_DECL_COMPLEX_ALIAS_P): New.
37 * pt.c (push_template_decl_real): Set it.
38 (dependent_alias_template_spec_p): Use it.
39 (dependent_type_p_r): Use dependent_alias_template_spec_p.
40 (uses_all_template_parms_data, uses_all_template_parms_r)
41 (complex_alias_template_p): New.
42 (get_template_parm_index): Handle BOUND_TEMPLATE_TEMPLATE_PARM.
44 2015-06-09 Jason Merrill <jason@redhat.com>
48 * typeck2.c (digest_init_r): Replace previous change with
52 * semantics.c (process_outer_var_ref): Make sure the value is
53 actually constant before returning it.
54 * typeck.c (cp_build_array_ref): Allow subscripting non-lvalue
57 2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
60 * typeck2.c (digest_nsdmi_init): On aggregates use reshape_init.
61 * init.c (expand_default_init): Likewise.
63 2015-06-09 Jason Merrill <jason@redhat.com>
66 * tree.c (replace_placeholders_r): Handle placeholders for an
68 * typeck2.c (store_init_value): Only replace_placeholders for
69 objects of class type.
71 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
73 * call.c : Adjust include files.
75 * constexpr.c : Likewise.
76 * cp-array-notation.c : Likewise.
77 * cp-cilkplus.c : Likewise.
78 * cp-gimplify.c : Likewise.
79 * cp-lang.c : Likewise.
80 * cp-objcp-common.c : Likewise.
81 * cp-tree.h : Likewise.
82 * cp-ubsan.c : Likewise.
88 * except.c : Likewise.
90 * friend.c : Likewise.
92 * lambda.c : Likewise.
94 * mangle.c : Likewise.
95 * method.c : Likewise.
96 * name-lookup.c : Likewise.
97 * optimize.c : Likewise.
98 * parser.c : Likewise.
100 * ptree.c : Likewise.
103 * search.c : Likewise.
104 * semantics.c : Likewise.
106 * typeck.c : Likewise.
107 * typeck2.c : Likewise.
108 * vtable-class-hierarchy.c : Likewise.
110 2015-06-05 Jason Merrill <jason@redhat.com>
113 * pt.c (argument_pack_element_is_expansion_p): Return 2 if
114 the expansion has extra args.
115 (use_pack_expansion_extra_args_p): Return true in that case.
118 * pt.c (type_dependent_expression_p): EXPR_PACK_EXPANSION is
119 dependent even if it has a type.
121 2015-06-05 Aldy Hernandez <aldyh@redhat.com>
123 * cp-objcp-common.c: Adjust comment for
124 cxx_warn_unused_global_decl.
125 * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Remove
126 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): New.
127 * cp-tree.h (note_mangling_alias): Protoize.
128 (cp_write_global_declarations): Remove.
129 (cxx_post_compilation_parsing_cleanups): Protoize.
130 * decl.c (wrapup_globals_for_namespace): Remove use of DATA
132 * decl2.c (mangling_aliases): New global.
133 (build_java_method_aliases): New. Adapted from
134 collect_candidates_for_java_method_aliases.
135 (collect_candidates_for_java_method_aliases): Remove.
136 (build_java_method_aliases): Remove.
137 (generate_mangling_aliases): New.
138 (note_mangling_alias): New. Moved from mangle_decl.
139 (locus_at_end_of_parsing): New global.
140 (c_parse_final_cleanups): Rename from
141 cp_write_global_declarations.
142 Use locus_at_end_of_parsing.
143 Call generate_mangling_aliases.
144 Rename call to collect_candidates_for_java_method_aliases into
145 build_java_method_aliases.
146 Remove call to finalize_compilation_unit.
147 Move vtable handling into cxx_post_compilation_parsing_cleanups.
148 Do not call check_global_declarations or
149 emit_debug_global_declarations.
150 (cxx_post_compilation_parsing_cleanups): New.
151 * mangle.c (mangle_decl): Move code to note_mangling_alias.
152 * name-lookup.c (do_namespace_alias): Call early_global_decl.
154 2015-06-05 Nathan Sidwell <nathan@acm.org>
157 * parser.c (cp_parser_cache_defarg): Continue looking for
158 declarators when scanning a potential template argument list of an
161 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
163 * call.c: Adjust includes for restructured coretypes.h.
165 * constexpr.c: Likewise.
166 * cp-array-notation.c: Likewise.
167 * cp-gimplify.c: Likewise.
168 * cp-lang.c: Likewise.
169 * cp-objcp-common.c: Likewise.
170 * cp-tree.h: Likewise.
171 * cp-ubsan.c: Likewise.
177 * except.c: Likewise.
179 * friend.c: Likewise.
181 * lambda.c: Likewise.
183 * mangle.c: Likewise.
184 * method.c: Likewise.
185 * name-lookup.c: Likewise.
186 * optimize.c: Likewise.
187 * parser.c: Likewise.
192 * search.c: Likewise.
193 * semantics.c: Likewise.
195 * typeck.c: Likewise.
196 * typeck2.c: Likewise.
197 * vtable-class-hierarchy.c: Likewise.
199 2015-06-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
203 * cp-tree.h (get_guard_cond): Adjust declaration
204 * decl.c (expand_static_init): Use atomic load acquire
205 and adjust call to get_guard_cond.
206 * decl2.c (build_atomic_load_byte): New function.
207 (get_guard_cond): Handle thread_safety.
208 (one_static_initialization_or_destruction): Adjust call to
211 2015-06-03 Jason Merrill <jason@redhat.com>
214 * mangle.c (mangle_decl): Always SET_IDENTIFIER_GLOBAL_VALUE.
215 (write_CV_qualifiers_for_type): Set G.need_abi_warning.
216 (decl_implicit_alias_p): Split out from maybe_remove_implicit_alias.
217 * cp-tree.h (DECL_REALLY_EXTERN): Handle null DECL_LANG_SPECIFIC.
219 2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
220 Paolo Carlini <paolo.carlini@oracle.com>
223 * typeck.c (invalid_nonstatic_memfn_p): Add location_t parameter and
224 use it in the diagnostic.
225 (decay_conversion): Adjust call.
226 * semantics.c (finish_decltype_type): Likewise.
227 * call.c (resolve_args, build_new_op_1,
228 perform_implicit_conversion_flags): Adjust calls.
229 * cvt.c (ocp_convert, convert_to_void): Likewise.
230 * cp-tree.h (invalid_nonstatic_memfn_p): Update declaration.
232 2015-06-03 Paolo Carlini <paolo.carlini@oracle.com>
234 * decl.c (check_tag_decl): Use declspecs->locations as locations in
235 error_at and warning_at calls.
237 2015-06-03 Marek Polacek <polacek@redhat.com>
240 * cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
241 (cp_genericize_r): Don't instrument static initializers.
242 (cp_genericize_tree): Initialize wtd.no_sanitize_p.
244 2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
246 * decl.c (start_function): Call plugin before parsing.
247 (finish_function): Call plugin after parsing.
249 2015-06-02 Patrick Palka <patrick@parcs.ath.cx>
251 * cp-tree.h (init_error): Remove declaration.
252 * error.c (scratch_pretty_printer): Rename to ...
253 (actual_pretty_printer): ... this.
254 (cxx_pp): Constify and update accordingly.
255 (init_error): Remove definition.
256 * lex.c (cxx_init): Do not call init_error.
258 2015-06-02 Paolo Carlini <paolo.carlini@oracle.com>
261 * parser.c (cp_parser_mem_initializer): Allow for decltype-specifier.
263 2015-06-01 Jason Merrill <jason@redhat.com>
266 * decl2.c (mark_used): Don't always instantiate constexpr fns.
267 * constexpr.c (cxx_eval_call_expression): Instantiate them here.
270 * mangle.c (attr_strcmp): New.
271 (write_CV_qualifiers_for_type): Also write out attributes that
272 affect type identity.
273 (write_type): Strip all attributes after writing qualifiers.
275 2015-05-31 Jason Merrill <jason@redhat.com>
277 * constexpr.c (cxx_eval_indirect_ref): Try folding first.
280 * constexpr.c (cxx_eval_constant_expression): Treat a placeholder
281 with the wrong type as non-constant.
283 2015-05-27 Jason Merrill <jason@redhat.com>
285 * decl.c (check_redeclaration_exception_specification): Depend on
286 -Wsystem-headers rather than -pedantic.
288 * decl.c (warn_extern_redeclared_static): Use the location of
289 newdecl in diagnostics, not input_location.
290 (validate_constexpr_redeclaration): Likewise.
291 (check_redeclaration_no_default_args): Likewise.
292 (duplicate_decls): Likewise.
293 (check_redeclaration_exception_specification): Likewise.
294 Change second diagnostic to inform.
296 2015-05-24 Nathan Sidwell <nathan@acm.org>
299 * decl.c (build_enumerator): Don't silently convert scoped enums.
301 2015-05-24 Jan Hubicka <hubicka@ucw.cz>
304 * mangle.c (mangle_decl): Mangle anonymous namespace types as
307 2015-05-23 Nathan Sidwell <nathan@acm.org>
310 * pt.c (lookup_template_class_1): Copy may_alias attribute too.
312 2015-05-22 Jim Wilson <jim.wilson@linaro.org>
314 * Make-lang.in (check_g++_parallelize): Update comment.
316 2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
319 * decl.c (grokdeclarator): Use the correct location in error
320 messages about 'explicit'.
322 2015-05-22 Marek Polacek <polacek@redhat.com>
323 Edward Smith-Rowland <3dw4rd@verizon.net>
326 * cp-tree.h (build_enumerator): Update declaration.
327 * decl.c (build_enumerator): Add attributes parameter. Call
328 cplus_decl_attributes.
329 * init.c (constant_value_1): Pass tf_none to mark_used.
330 * parser.c (cp_parser_enumerator_definition): Parse attributes and
331 pass them down to build_enumerator.
332 * pt.c (tsubst_enum): Pass decl attributes to build_enumerator.
333 * semantics.c (finish_id_expression): Don't warn_deprecated_use here.
335 2015-05-21 Nathan Sidwell <nathan@acm.org>
338 * decl2.c (change_return_type): Propagate FUNCTION_REF_QUALIFIED.
340 2015-05-21 Marek Polacek <polacek@redhat.com>
342 * typeck.c (warn_args_num): Don't print "declare here" for builtins.
344 2015-05-20 Jason Merrill <jason@redhat.com>
346 * pt.c (tsubst_decl) [VAR_DECL]: SET_DECL_IMPLICIT_INSTANTIATION
347 before register_specialization.
349 * decl.c (grok_op_properties): Don't complain about size_t
350 placement delete here.
351 * call.c (second_parm_is_size_t): Split out from...
352 (non_placement_deallocation_fn_p): ...here.
353 (build_op_delete_call): Warn about size_t placement delete with
356 2015-05-19 Nathan Sidwell <nathan@acm.org>
359 * typeck.c (finish_class_member_access_expr): Diagnose failed
360 lookup of enum class member.
362 2015-05-19 Jakub Jelinek <jakub@redhat.com>
365 * parser.c (cp_parser_omp_for_loop): Don't add
366 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
367 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
368 (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
371 2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
373 * typeck.c (composite_pointer_type): Use std::swap instead of explicit
376 2015-05-18 Jason Merrill <jason@redhat.com>
378 * pt.c (retrieve_specialization): Make sure our arguments have
379 gone through strip_typedefs.
381 * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
382 (determine_specialization): Call coerce_template_parms.
385 * pt.c (type_unification_real): Check convertibility here.
386 (unify_one_argument): Not here.
388 * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo.
389 (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype.
390 [TREE_LIST]: Fix no-change case.
392 * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.
394 2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
397 * error.c (cp_diagnostic_starter): Use diagnostic_location
399 (cp_print_error_function): Likewise.
400 (cp_printer): Replace locus pointer with accessor function.
402 2015-05-12 David Malcolm <dmalcolm@redhat.com>
404 * parser.c (cp_parser_selection_statement): Add location and
405 guard_kind arguments to calls to
406 cp_parser_implicitly_scoped_statement.
407 (cp_parser_iteration_statement): Likewise for calls to
408 cp_parser_already_scoped_statement.
409 (cp_parser_implicitly_scoped_statement): Add "guard_loc" and
410 "guard_kind" params; use them to warn for misleading
412 (cp_parser_already_scoped_statement): Likewise.
414 2015-05-11 Jan Hubicka <hubicka@ucw.cz>
416 * class.c (fixup_type_variants): Do not copy TYPE_METHODS
417 (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant.
418 * semantics.c (finish_member_declaration): Likewise.
419 * method.c (lazily_declare_fn): Allways add method to main variant list.
421 2015-05-09 Aldy Hernandez <aldyh@redhat.com>
424 * decl2.c (note_mangling_alias): Declare arguments as unused.
426 2015-05-08 Jason Merrill <jason@redhat.com>
428 * cp-gimplify.c, parser.c: Adjust to -Wc++11-compat replacing
431 2015-05-08 Jason Merrill <jason@redhat.com>
433 * decl2.c (mangling_aliases): New variable.
434 (note_mangling_alias, generate_mangling_aliases): New.
435 (cp_write_global_declarations): Call generate_mangling_aliases.
436 (generate_mangling_alias): Split out from...
437 * mangle.c (mangle_decl): ...here.
438 * cp-tree.h: Declare note_mangling_alias.
440 2015-05-08 Aldy Hernandez <aldyh@redhat.com>
442 * decl2.c (collect_candidates_for_java_method_aliases): Remove.
443 (build_java_method_aliases): Adapt to use create_same_body_alias
444 instead of assemble_alias. Move variable declarations to
445 definition and tidy up.
446 (cp_write_global_declarations): Call build_java_method_aliases
447 instead of collecting candidates first.
449 2015-05-07 Jason Merrill <jason@redhat.com>
452 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion.
453 (cp_parser_std_attribute_spec): Handle alignas pack expansion.
454 * decl2.c (is_late_template_attribute): An attribute exp is dependent.
455 * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion.
456 (apply_late_template_attributes): Handle attribute pack expansion.
458 2015-05-07 Marek Polacek <polacek@redhat.com>
461 * typeck.c (cp_build_binary_op): Warn when left shifting a negative
464 2015-05-07 Jason Merrill <jason@redhat.com>
468 * typeck2.c (digest_init_r): Fix single element list.
470 2015-05-05 Jason Merrill <jason@redhat.com>
472 * cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and
473 MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a
475 (cp_genericize_data): Add try_block field.
476 (cp_genericize_tree): Initialize it.
477 * except.c (expand_end_catch_block): Set TREE_NO_WARNING on
480 * constexpr.c (potential_constant_expression_1) [AT_ENCODE_EXPR]:
483 * semantics.c (finish_call_expr): Check complain.
485 * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
486 maybe-in-charge constructor.
488 * decl.c (start_decl): Don't push the plain VAR_DECL for a
495 * call.c (convert_like_real): Check value-initialization before
497 * typeck2.c (process_init_constructor_record): Don't set
498 CONSTRUCTOR_IS_DIRECT_INIT.
499 (process_init_constructor_array): Likewise.
500 * init.c (build_vec_init): Likewise.
502 2015-05-05 David Malcolm <dmalcolm@redhat.com>
504 * parser.c (cp_parser_asm_definition): Only test for
505 error_mark_node if "outputs" was just set. Likewise for "inputs".
507 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com>
508 Jakub Jelinek <jakub@redhat.com>
511 * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't
512 result in an actual error.
514 2015-05-01 Paolo Carlini <paolo.carlini@oracle.com>
515 Prathamesh Kulharni <prathamesh.kulkarni@linaro.org>
518 * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
521 2015-04-30 David Malcolm <dmalcolm@redhat.com>
523 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove spurious
526 2015-04-29 Jason Merrill <jason@redhat.com>
529 * tree.c (apply_identity_attributes): Fix handling of classes.
531 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
533 * parser.c (cp_parser_oacc_enter_exit_data): Use
534 OMP_STANDALONE_CLAUSES.
536 2015-04-29 Paolo Carlini <paolo.carlini@oracle.com>
539 * init.c (perform_member_init): Handle references for -Winit-self.
541 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
543 * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
544 OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
546 2015-04-28 Jason Merrill <jason@redhat.com>
549 * constexpr.c (cxx_eval_store_expression): Don't try to actually
550 store an empty class.
553 * constexpr.c (cxx_eval_builtin_function_call): Fix
554 __builtin_constant_p.
557 * tree.c (strip_typedefs): Add remove_attributes parm.
558 (strip_typedefs_expr): Likewise.
559 (apply_identity_attributes): New subroutine of strip_typedefs.
560 * pt.c (canonicalize_type_argument): Let strip_typedefs handle attrs.
561 (convert_nontype_argument, unify): Likewise.
565 * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
567 2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
569 * class.c (layout_class_type): Remove check if
570 PCC_BITFIELD_TYPE_MATTERS is defined.
572 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
574 * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus.
576 2015-04-24 Jason Merrill <jason@redhat.com>
579 * typeck.c (structural_comptypes): Don't check TYPE_REF_CAN_ALIAS_ALL.
581 * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
582 Remove obsolete code.
585 2015-04-23 Jason Merrill <jason@redhat.com>
588 * pt.c (check_explicit_specialization): Don't
589 SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
591 * decl.c (grokvardecl): Revert earlier fix.
593 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com>
596 * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
597 suppresses the diagnostic.
599 2015-04-20 Ville Voutilainen <ville.voutilainen@gmail.com>
601 Reject trailing return type for an operator auto().
602 * decl.c (grokdeclarator): Reject trailing return types for
603 all conversion operators, don't handle conversion operators
604 in the previous checks that deal with auto.
606 2015-04-20 Ilya Verbin <ilya.verbin@intel.com>
608 * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
610 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
612 * class.c (resolve_address_of_overloaded_function, instantiate_type):
613 Rename tsubst_flags_t parameter flags -> complain.
615 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
617 * call.c (build_op_delete_call, build_over_call): Check mark_used
619 * class.c (resolve_address_of_overloaded_function): Likewise.
620 * decl.c (cxx_maybe_build_cleanup): Likewise.
621 * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
622 tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
623 * rtti.c (build_dynamic_cast_1): Likewise.
624 * semantics.c (process_outer_var_ref): Likewise.
625 * typeck.c (build_class_member_access_expr,
626 cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
628 2015-04-15 Jason Merrill <jason@redhat.com>
630 * constexpr.c (cxx_eval_store_expression): Ignore clobbers.
631 (build_constexpr_constructor_member_initializers): Loop to find
633 * decl.c (start_preparsed_function): Clobber the object at the
634 beginning of a constructor.
636 * decl.c (grokmethod): Only set DECL_COMDAT if TREE_PUBLIC is set.
637 * method.c (implicitly_declare_fn): Likewise.
638 * decl2.c (vague_linkage_p): Check TREE_PUBLIC first.
640 * decl2.c (determine_visibility): Use get_template_info.
642 2015-04-15 Jason Merrill <jason@redhat.com>
643 Marek Polacek <polacek@redhat.com>
646 * lambda.c (lambda_expr_this_capture): In unevaluated context go
647 through the normal loop, just don't capture.
648 (maybe_resolve_dummy): Handle null return.
650 2015-04-15 Paolo Carlini <paolo.carlini@oracle.com>
652 * call.c (enforce_access): Emit error + inform.
654 2015-04-15 Marek Polacek <polacek@redhat.com>
656 * constexpr.c (use_new_call): Remove #define.
657 (lookup_parameter_binding): Remove function.
658 (cxx_bind_parameters_in_call): Remove unused code.
659 (cxx_eval_call_expression): Likewise.
660 (cxx_eval_constant_expression): Likewise.
662 2015-04-14 Mikhail Maltsev <maltsevm@gmail.com>
664 * tree.c (replace_placeholders_t): Remove unused type.
665 (replace_placeholders): Remove unused pset.
667 2015-04-14 Jason Merrill <jason@redhat.com>
669 * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
672 * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
675 * name-lookup.c (do_class_using_decl): Complain about specifying
676 the current class even if there are dependent bases.
678 2015-04-14 David Krauss <david_work@me.com>
681 * decl.c (grokdeclarator): Do not flag friends with deduced return.
683 2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
684 Jason Merrill <jason@redhat.com>
687 * parser.c (cp_parser_class_name): Add enum_ok parameter.
688 (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
689 (cp_parser_diagnose_invalid_type_name): Don't assume a template is
692 2015-04-12 Jakub Jelinek <jakub@redhat.com>
695 * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
696 don't fold if op01 isn't divisible by TYPE_SIZE_UNIT. Convert
697 the expression to the original type at the end.
699 2015-04-09 Jakub Jelinek <jakub@redhat.com>
702 * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
706 * tree.c (build_cplus_array_type): Layout type before variants are
707 set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
710 2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
713 * lambda.c (add_capture): Use dependent_type_p for capture by
716 2015-04-02 Marek Polacek <polacek@redhat.com>
719 * constexpr.c (cxx_eval_pointer_plus_expression): Call
720 cxx_eval_constant_expression on the first operand.
722 2015-04-01 Jason Merrill <jason@redhat.com>
725 * decl.c (make_typename_type): Handle seeing a variable template.
727 2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
730 * pt.c (instantiating_current_function_p): New.
731 * name-lookup.c (pushdecl_maybe_friend_1): Use it.
732 * cp-tree.h (instantiating_current_function_p): Declare.
734 2015-04-01 Jason Merrill <jason@redhat.com>
737 * decl.c (grokvardecl): Don't call check_explicit_specialization
738 for non-template members of a class template.
740 2015-04-01 Marek Polacek <polacek@redhat.com>
743 * class.c (finish_struct): Require that the second field of a
744 user-defined initializer_list be of size type.
746 2015-03-31 Marek Polacek <polacek@redhat.com>
749 * tree.c (build_cplus_array_type): Use dependent_type_p rather than
750 checking for constness.
752 2015-03-30 Marek Polacek <polacek@redhat.com>
755 * constexpr.c (cxx_fold_indirect_ref): Don't perform the
756 *(&A[i] p+ j) => A[i + j] transformation here.
757 (cxx_eval_pointer_plus_expression): New function.
758 (cxx_eval_constant_expression): Use it here.
760 2015-03-27 Tobias Burnus <burnus@net-b.de>
763 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
764 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
765 cp_parser_omp_declare): Don't show error for skipped omp pragmas with
768 2015-03-27 Marek Polacek <polacek@redhat.com>
771 * semantics.c (finish_switch_cond): If the unlowered type is not an
772 enum, use the type of the condition.
774 2015-03-27 Jason Merrill <jason@redhat.com>
777 * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
780 2015-03-26 Mikhail Maltsev <maltsevm@gmail.com>
783 * init.c (build_vec_init): Fix initializing aggregates
784 with empty init list.
786 2015-03-26 Jason Merrill <jason@redhat.com>
789 * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
791 2015-03-25 Marek Polacek <polacek@redhat.com>
794 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
795 on an anonymous namespace.
797 2015-03-25 Marek Polacek <polacek@redhat.com>
800 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
802 2015-03-24 Jason Merrill <jason@redhat.com>
805 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
806 * parser.c (cp_parser_namespace_definition): Don't set it.
807 * name-lookup.c (handle_namespace_attrs): Check
808 DECL_NAMESPACE_ASSOCIATIONS instead.
811 * pt.c (get_mostly_instantiated_function_type): Just return the
812 type of the partially instantiated template in DECL_TI_TEMPLATE.
814 2015-03-20 Marek Polacek <polacek@redhat.com>
817 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
820 2015-03-20 Marek Polacek <polacek@redhat.com>
823 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
826 2015-03-19 Jason Merrill <jason@redhat.com>
829 Automatically propagate ABI tags to variables and functions
830 from their (return) type.
831 * class.c (check_tag): Handle variables and functions.
832 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
833 (mark_or_check_tags): Likewise.
834 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
835 (check_abi_tags): Add single argument overload for decls.
836 Handle inheriting tags for decls.
837 * mangle.c (write_mangled_name): Call it.
838 (mangle_return_type_p): Split out from write_encoding.
839 (unmangled_name_p): Split out from write_mangled_name.
840 (write_mangled_name): Ignore abi_tag on namespace.
841 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
842 * parser.c (cp_parser_namespace_definition): Set it.
843 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
844 about abi_tag attribute on non-inline namespace.
845 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
846 (handle_abi_tag_attribute): Allow tags on variables.
848 2015-03-19 Jakub Jelinek <jakub@redhat.com>
850 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
851 attribute for DECL_EXTERNAL VAR_DECLs.
853 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
856 * call.c (build_over_call): Pass the tsubst_flags_t argument to
858 * decl2.c (mark_used): Inline the require_deduced_type call and
859 guard the error call.
861 2015-03-16 Jason Merrill <jason@redhat.com>
864 * parser.c (cp_parser_template_name): Call strip_using_decl.
866 2015-03-16 Marek Polacek <polacek@redhat.com>
870 * decl.c (grokdeclarator): Allow volatile and constexpr together.
872 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
875 * decl.c (check_default_argument): Don't call
876 maybe_warn_zero_as_null_pointer_constant.
878 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
880 * cp-gimplify.c (simple_empty_class_p): New.
881 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
882 the code for empty class copies into simple_empty_class_p, and
883 adapt it to handle COMPOUND_EXPRs.
885 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
888 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
889 only if the location of newdecl doesn't match the location of olddecl.
891 2015-03-10 Jakub Jelinek <jakub@redhat.com>
894 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
897 2015-03-10 Jason Merrill <jason@redhat.com>
901 * pt.c (dependent_type_p_r): Check both class and alias template args.
903 2015-03-10 Jakub Jelinek <jakub@redhat.com>
906 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
907 before preparing arguments to warn_logical_not_parentheses.
908 Use maybe_constant_value on rhs.
910 2015-03-09 Jason Merrill <jason@redhat.com>
913 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
915 2015-03-09 Jakub Jelinek <jakub@redhat.com>
918 * parser.c (cp_parser_binary_expression): Don't warn for
919 !!x == y or !b == y where b is bool.
921 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
923 * ptree.c (cxx_print_lambda_node): New.
924 (cxx_print_xnode): Handle LAMBDA_EXPR.
926 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
929 * constexpr.c (cxx_eval_constant_expression): Remove assert in
930 RESULT_DECL handling.
932 2015-02-26 Marek Polacek <polacek@redhat.com>
935 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
936 a RETURN_EXPR if its operand is null.
938 2015-02-25 Jason Merrill <jason@redhat.com>
941 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
943 (constrain_visibility_for_template): Handle reference arguments.
946 * decl.c (start_preparsed_function): Use create_artificial_label
949 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
950 Jakub Jelinek <jakub@redhat.com>
953 * constexpr.c (check_constexpr_bind_expr_vars): Allow
954 implicit typedefs for lambda types.
956 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
959 * decl.c (lookup_and_check_tag): Use strip_using_decl.
961 2015-02-13 Jason Merrill <jason@redhat.com>
964 * pt.c (template_args_equal): Look through conversions here.
965 * tree.c (cp_tree_equal): Not here.
967 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
970 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
971 pragma_external context.
973 2015-02-13 Jason Merrill <jason@redhat.com>
976 * call.c (reference_binding): Don't look for bad conversion
979 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
982 * decl.c (make_typename_type): Pass tsubst_flags_t argument
983 to lookup_template_class.
985 2015-02-13 Jakub Jelinek <jakub@redhat.com>
988 * decl.c (start_preparsed_function): Use void_type_node instead
989 of NULL_TREE as LABEL_DECL type.
991 2015-02-12 Jason Merrill <jason@redhat.com>
994 * mangle.c (write_mangled_name): Fix test for variable template
997 * decl.c (begin_destructor_body): Condition clobber on
1000 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
1003 * parser.c (lookup_literal_operator): Return all candidates.
1004 (cp_parser_userdef_char_literal): Simplify error handling.
1005 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
1006 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
1007 Also give higher priority to standard string UDL operator.
1009 2015-02-12 Jakub Jelinek <jakub@redhat.com>
1012 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
1013 * decl.c (poplevel): If functionbody, try not to create an extra
1014 BLOCK for function body and use subblocks as that, if it is non-NULL
1015 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
1016 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
1019 * except.c (check_noexcept_r): Return NULL for internal
1022 2015-02-10 Jason Merrill <jason@redhat.com>
1025 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
1027 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
1030 * method.c (use_thunk): Do not check for stdarg thunks.
1032 2015-02-06 Jason Merrill <jason@redhat.com>
1035 * init.c (build_vec_init): Handle default-initialized array with
1036 constexpr default constructor.
1038 2015-02-04 Jakub Jelinek <jakub@redhat.com>
1042 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
1044 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
1047 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
1048 for generated expressions.
1050 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
1053 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
1056 2015-02-02 Jason Merrill <jason@redhat.com>
1058 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
1060 2015-01-30 Joseph Myers <joseph@codesourcery.com>
1062 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
1063 changed to pass input_location as first argument.
1065 2015-01-29 Jakub Jelinek <jakub@redhat.com>
1068 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
1071 2015-01-29 Jason Merrill <jason@redhat.com>
1074 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
1075 erroneous return statement.
1078 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
1081 2015-01-27 Caroline Tice <cmtice@google.com>
1083 Committing VTV Cywin/Ming patch for Patrick Wollgast
1084 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
1085 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
1087 2015-01-27 Jason Merrill <jason@redhat.com>
1090 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
1091 current_function_decl.
1094 * pt.c (finish_template_variable): Move from semantics.c.
1095 Handle multiple template arg levels. Handle coercion here.
1096 (lookup_template_variable): Not here.
1098 2015-01-23 Jason Merrill <jason@redhat.com>
1102 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
1103 that has been completely split out.
1106 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
1110 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
1113 2015-01-21 Jason Merrill <jason@redhat.com>
1116 * constexpr.c (cxx_eval_constant_expression): Only shortcut
1117 constant CONSTRUCTORs.
1120 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
1121 give a hard error in a template instantiation.
1123 2015-01-21 Richard Biener <rguenther@suse.de>
1126 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
1127 for builtins the user declared correctly.
1129 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
1132 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
1133 TREE_TYPE (elt) == error_mark_node.
1135 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
1137 PR tree-optimization/62053
1138 * tree.c (build_cplus_array_type): Layout type after variants are set.
1140 2015-01-15 Jakub Jelinek <jakub@redhat.com>
1142 * cp-gimplify.c (cp_genericize_r): Call
1143 cp_ubsan_maybe_instrument_member_call for member calls.
1144 (cp_ubsan_check_member_access_r): New function.
1145 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
1146 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
1147 cp_ubsan_instrument_member_accesses,
1148 cp_ubsan_maybe_instrument_downcast,
1149 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
1150 * cp-ubsan.c: New file.
1151 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
1152 * constexpr.c (cxx_eval_call_expression): Return void_node
1154 (potential_constant_expression_1): Return true for
1155 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
1156 * typeck.c (build_class_member_access_expr): Provide locus
1158 (build_static_cast_1): Instrument downcasts.
1159 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
1160 add ubsan instrumentation for virtual_access.
1161 * call.c: Include internal-fn.h.
1162 (set_flags_from_callee): Handle internal calls.
1164 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
1167 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
1168 and function templates, declared only in the class.
1169 * decl.c (duplicate_decls): Reveal hidden friend functions or
1170 function templates, if they are redeclared outside the class.
1172 2015-01-15 Jason Merrill <jason@redhat.com>
1175 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
1178 * constexpr.c (potential_constant_expression_1): Handle reference
1181 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
1182 James Norris <jnorris@codesourcery.com>
1183 Cesar Philippidis <cesar@codesourcery.com>
1184 Ilmir Usmanov <i.usmanov@samsung.com>
1185 Jakub Jelinek <jakub@redhat.com>
1187 * parser.c: Include "gomp-constants.h".
1188 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
1189 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1190 Use OMP_CLAUSE_SET_MAP_KIND.
1191 (cp_parser_omp_construct, cp_parser_pragma): Handle
1192 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
1193 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
1194 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
1195 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
1196 "create", "delete", "deviceptr", "host", "num_gangs",
1197 "num_workers", "present", "present_or_copy", "pcopy",
1198 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
1199 "present_or_create", "pcreate", "vector_length", "wait".
1200 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
1201 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
1202 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
1203 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
1204 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
1205 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
1206 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
1207 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
1208 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
1209 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
1210 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
1211 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
1212 (cp_parser_oacc_parallel, cp_parser_oacc_update)
1213 (cp_parser_oacc_wait): New functions.
1214 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
1215 (finish_oacc_parallel): New prototypes.
1216 * semantics.c: Include "gomp-constants.h".
1217 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
1218 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
1219 OMP_CLAUSE_SET_MAP_KIND.
1220 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
1221 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
1222 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1223 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
1226 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
1229 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
1230 self-initialization.
1232 2015-01-13 Jason Merrill <jason@redhat.com>
1236 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1237 pointer expressions.
1238 (cxx_eval_increment_expression): Likewise.
1241 * pt.c (coerce_template_parameter_pack): Return NULL for a
1242 zero-length fixed parameter pack with a pack expansion arg.
1245 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
1247 2015-01-12 Jason Merrill <jason@redhat.com>
1250 * constexpr.c (cxx_eval_call_expression): A call to a void
1251 function doesn't need to return a value.
1253 2015-01-09 Michael Collison <michael.collison@linaro.org>
1255 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
1256 input.h, alias.h, symtab.h, options.h, fold-const.h,
1257 wide-int.h, and inchash.h due to flattening of tree.h.
1259 * constexpr.c: Ditto.
1260 * cp-array-notation.c: Ditto.
1261 * cp-gimplify.c: Ditto.
1263 * cp-objcp-common.c: Ditto.
1276 * name-lookup.c: Ditto.
1277 * optimize.c: Ditto.
1284 * semantics.c: Ditto.
1289 2015-01-08 Jason Merrill <jason@redhat.com>
1291 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
1292 * decl.c (compute_array_index_type): Likewise.
1293 * init.c (build_vec_init): Likewise.
1294 * typeck.c (cp_build_binary_op): Likewise.
1296 2015-01-08 Jason Merrill <jason@redhat.com>
1298 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
1299 whether an initializer-list is too big for a VLA.
1300 (throw_bad_array_length): Remove.
1301 * cp-tree.h: Remove prototype.
1303 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
1306 * decl.c (grokfndecl): Add bool parameter.
1307 (grokdeclarator): Adjust calls.
1308 (start_decl): Don't set DECL_DELETED_FN here.
1310 2015-01-06 Jason Merrill <jason@redhat.com>
1312 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
1316 * pt.c (type_dependent_expression_p): Handle variable templates.
1317 * constexpr.c (potential_constant_expression_1): Use it.
1320 * semantics.c (finish_offsetof): Handle templates here.
1321 * parser.c (cp_parser_builtin_offsetof): Not here.
1324 * semantics.c (process_outer_var_ref): Diagnose lambda in local
1327 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
1330 * class.c (check_field_decls): Make copy assignment operators
1331 complex only in c++98 mode.
1333 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
1336 * class.c (check_for_override): Warn when a virtual function is an
1337 override not marked override.
1339 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
1341 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
1343 (get_basefndecls): Adjust.
1345 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1347 Update copyright years.
1349 2015-01-05 Marek Polacek <polacek@redhat.com>
1352 * typeck.c (cp_build_array_ref): Pass loc down to
1353 warn_array_subscript_with_type_char.
1356 Copyright (C) 2015 Free Software Foundation, Inc.
1358 Copying and distribution of this file, with or without modification,
1359 are permitted in any medium without royalty provided the copyright
1360 notice and this notice are preserved.