* config/i386/i386.h (TARGET_SUPPORTS_WIDE_INT): New define.
[official-gcc.git] / gcc / cp / ChangeLog
blob65cb5bee27b6d47b8576700e17cb73f2e6b2e221
1 2015-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
2             Prathamesh Kulharni  <prathamesh.kulkarni@linaro.org>
4         PR c++/65858
5         * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
6         false.
8 2015-04-30  David Malcolm  <dmalcolm@redhat.com>
10         * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove spurious
11         trailing semicolon.
13 2015-04-29  Jason Merrill  <jason@redhat.com>
15         PR c++/50800
16         * tree.c (apply_identity_attributes): Fix handling of classes.
18 2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
20         * parser.c (cp_parser_oacc_enter_exit_data): Use
21         OMP_STANDALONE_CLAUSES.
23 2015-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
25         PR c++/64667
26         * init.c (perform_member_init): Handle references for -Winit-self.
28 2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
30         * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
31         OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
33 2015-04-28  Jason Merrill  <jason@redhat.com>
35         PR c++/65896
36         * constexpr.c (cxx_eval_store_expression): Don't try to actually
37         store an empty class.
39         PR c++/65656
40         * constexpr.c (cxx_eval_builtin_function_call): Fix
41         __builtin_constant_p.
43         PR c++/50800
44         * tree.c (strip_typedefs): Add remove_attributes parm.
45         (strip_typedefs_expr): Likewise.
46         (apply_identity_attributes): New subroutine of strip_typedefs.
47         * pt.c (canonicalize_type_argument): Let strip_typedefs handle attrs.
48         (convert_nontype_argument, unify): Likewise.
49         * cp-tree.h: Adjust.
51         PR c++/65734
52         * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
54 2015-04-27  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
56         * class.c (layout_class_type): Remove check if
57         PCC_BITFIELD_TYPE_MATTERS is defined.
59 2015-04-27  Jim Wilson  <jim.wilson@linaro.org>
61         * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus.
63 2015-04-24  Jason Merrill  <jason@redhat.com>
65         PR c++/50800
66         * typeck.c (structural_comptypes): Don't check TYPE_REF_CAN_ALIAS_ALL.
68         * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
69         Remove obsolete code.
70         [NE_EXPR]: Likewise.
72 2015-04-23  Jason Merrill  <jason@redhat.com>
74         PR c++/65646
75         * pt.c (check_explicit_specialization): Don't
76         SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
77         headers.
78         * decl.c (grokvardecl): Revert earlier fix.
80 2015-04-20  Paolo Carlini  <paolo.carlini@oracle.com>
82         PR c++/65801
83         * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
84         suppresses the diagnostic.
86 2015-04-20  Ville Voutilainen  <ville.voutilainen@gmail.com>
88         Reject trailing return type for an operator auto().
89         * decl.c (grokdeclarator): Reject trailing return types for
90         all conversion operators, don't handle conversion operators
91         in the previous checks that deal with auto.
93 2015-04-20  Ilya Verbin  <ilya.verbin@intel.com>
95         * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
97 2015-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
99         * class.c (resolve_address_of_overloaded_function, instantiate_type):
100         Rename tsubst_flags_t parameter flags -> complain.
102 2015-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
104         * call.c (build_op_delete_call, build_over_call): Check mark_used
105         return value.
106         * class.c (resolve_address_of_overloaded_function): Likewise.
107         * decl.c (cxx_maybe_build_cleanup): Likewise.
108         * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
109         tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
110         * rtti.c (build_dynamic_cast_1): Likewise.
111         * semantics.c (process_outer_var_ref): Likewise.
112         * typeck.c (build_class_member_access_expr,
113         cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
115 2015-04-15  Jason Merrill  <jason@redhat.com>
117         * constexpr.c (cxx_eval_store_expression): Ignore clobbers.
118         (build_constexpr_constructor_member_initializers): Loop to find
119         the BIND_EXPR.
120         * decl.c (start_preparsed_function): Clobber the object at the
121         beginning of a constructor.
123         * decl.c (grokmethod): Only set DECL_COMDAT if TREE_PUBLIC is set.
124         * method.c (implicitly_declare_fn): Likewise.
125         * decl2.c (vague_linkage_p): Check TREE_PUBLIC first.
127         * decl2.c (determine_visibility): Use get_template_info.
129 2015-04-15  Jason Merrill  <jason@redhat.com>
130             Marek Polacek  <polacek@redhat.com>
132         PR c++/65727
133         * lambda.c (lambda_expr_this_capture): In unevaluated context go
134         through the normal loop, just don't capture.
135         (maybe_resolve_dummy): Handle null return.
137 2015-04-15  Paolo Carlini  <paolo.carlini@oracle.com>
139         * call.c (enforce_access): Emit error + inform.
141 2015-04-15  Marek Polacek  <polacek@redhat.com>
143         * constexpr.c (use_new_call): Remove #define.
144         (lookup_parameter_binding): Remove function.
145         (cxx_bind_parameters_in_call): Remove unused code.
146         (cxx_eval_call_expression): Likewise.
147         (cxx_eval_constant_expression): Likewise.
149 2015-04-14  Mikhail Maltsev  <maltsevm@gmail.com>
151         * tree.c (replace_placeholders_t): Remove unused type.
152         (replace_placeholders): Remove unused pset.
154 2015-04-14  Jason Merrill  <jason@redhat.com>
156         * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
158         PR c++/65695
159         * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
161         PR c++/65721
162         * name-lookup.c (do_class_using_decl): Complain about specifying
163         the current class even if there are dependent bases.
165 2015-04-14  David Krauss  <david_work@me.com>
167         PR c++/59766
168         * decl.c (grokdeclarator): Do not flag friends with deduced return.
170 2015-04-14  Momchil Velikov  <momchil.velikov@gmail.com>
171             Jason Merrill  <jason@redhat.com>
173         PR c++/60994
174         * parser.c (cp_parser_class_name): Add enum_ok parameter.
175         (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
176         (cp_parser_diagnose_invalid_type_name): Don't assume a template is
177         a class template.
179 2015-04-12  Jakub Jelinek  <jakub@redhat.com>
181         PR c++/65736
182         * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
183         don't fold if op01 isn't divisible by TYPE_SIZE_UNIT.  Convert
184         the expression to the original type at the end.
186 2015-04-09  Jakub Jelinek  <jakub@redhat.com>
188         PR c++/65690
189         * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
190         TYPE_USER_ALIGN.
192         PR c++/65690
193         * tree.c (build_cplus_array_type): Layout type before variants are
194         set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
195         variant.
197 2015-04-03  Paolo Carlini  <paolo.carlini@oracle.com>
199         PR c++/64085
200         * lambda.c (add_capture): Use dependent_type_p for capture by
201         reference too.
203 2015-04-02  Marek Polacek  <polacek@redhat.com>
205         PR c++/65642
206         * constexpr.c (cxx_eval_pointer_plus_expression): Call
207         cxx_eval_constant_expression on the first operand.
209 2015-04-01  Jason Merrill  <jason@redhat.com>
211         PR c++/65625
212         * decl.c (make_typename_type): Handle seeing a variable template.
214 2015-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
216         PR c++/56100
217         * pt.c (instantiating_current_function_p): New.
218         * name-lookup.c (pushdecl_maybe_friend_1): Use it.
219         * cp-tree.h (instantiating_current_function_p): Declare.
221 2015-04-01  Jason Merrill  <jason@redhat.com>
223         PR c++/65646
224         * decl.c (grokvardecl): Don't call check_explicit_specialization
225         for non-template members of a class template.
227 2015-04-01  Marek Polacek  <polacek@redhat.com>
229         PR c++/65554
230         * class.c (finish_struct): Require that the second field of a
231         user-defined initializer_list be of size type.
233 2015-03-31  Marek Polacek  <polacek@redhat.com>
235         PR c++/65390
236         * tree.c (build_cplus_array_type): Use dependent_type_p rather than
237         checking for constness.
239 2015-03-30  Marek Polacek  <polacek@redhat.com>
241         PR c++/65398
242         * constexpr.c (cxx_fold_indirect_ref): Don't perform the
243          *(&A[i] p+ j) => A[i + j] transformation here.
244         (cxx_eval_pointer_plus_expression): New function.
245         (cxx_eval_constant_expression): Use it here.
247 2015-03-27  Tobias Burnus  <burnus@net-b.de>
249         PR c/65586
250         * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
251         cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
252         cp_parser_omp_declare): Don't show error for skipped omp pragmas with
253         -fopenmp-simd.
255 2015-03-27  Marek Polacek  <polacek@redhat.com>
257         PR c++/65556
258         * semantics.c (finish_switch_cond): If the unlowered type is not an
259         enum, use the type of the condition.
261 2015-03-27  Jason Merrill  <jason@redhat.com>
263         PR c++/65509
264         * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
265         constants.
267 2015-03-26  Mikhail Maltsev  <maltsevm@gmail.com>
269         PR c++/65154
270         * init.c (build_vec_init): Fix initializing aggregates
271         with empty init list.
273 2015-03-26  Jason Merrill  <jason@redhat.com>
275         PR c++/65525
276         * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
278 2015-03-25  Marek Polacek  <polacek@redhat.com>
280         PR c++/65558
281         * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
282         on an anonymous namespace.
284 2015-03-25  Marek Polacek  <polacek@redhat.com>
286         PR c++/61670
287         * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
289 2015-03-24  Jason Merrill  <jason@redhat.com>
291         PR c++/65046
292         * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
293         * parser.c (cp_parser_namespace_definition): Don't set it.
294         * name-lookup.c (handle_namespace_attrs): Check
295         DECL_NAMESPACE_ASSOCIATIONS instead.
297         PR c++/65498
298         * pt.c (get_mostly_instantiated_function_type): Just return the
299         type of the partially instantiated template in DECL_TI_TEMPLATE.
301 2015-03-20  Marek Polacek  <polacek@redhat.com>
303         PR c++/65398
304         * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
305         A[i + j].
307 2015-03-20  Marek Polacek  <polacek@redhat.com>
309         PR c++/65072
310         * typeck.c (lookup_anon_field): Make sure we're dealing with the main
311         variant.
313 2015-03-19  Jason Merrill  <jason@redhat.com>
315         PR c++/65046
316         Automatically propagate ABI tags to variables and functions
317         from their (return) type.
318         * class.c (check_tag): Handle variables and functions.
319         (mark_or_check_attr_tags): Split out from find_abi_tags_r.
320         (mark_or_check_tags): Likewise.
321         (mark_abi_tags): Use it.  Rename from mark_type_abi_tags.
322         (check_abi_tags): Add single argument overload for decls.
323         Handle inheriting tags for decls.
324         * mangle.c (write_mangled_name): Call it.
325         (mangle_return_type_p): Split out from write_encoding.
326         (unmangled_name_p): Split out from write_mangled_name.
327         (write_mangled_name): Ignore abi_tag on namespace.
328         * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
329         * parser.c (cp_parser_namespace_definition): Set it.
330         * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
331         about abi_tag attribute on non-inline namespace.
332         * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
333         (handle_abi_tag_attribute): Allow tags on variables.
335 2015-03-19  Jakub Jelinek  <jakub@redhat.com>
337         * decl2.c (cplus_decl_attributes): Also add "omp declare target"
338         attribute for DECL_EXTERNAL VAR_DECLs.
340 2015-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
342         PR c++/65340
343         * call.c (build_over_call): Pass the tsubst_flags_t argument to
344         mark_used.
345         * decl2.c (mark_used): Inline the require_deduced_type call and
346         guard the error call.
348 2015-03-16  Jason Merrill  <jason@redhat.com>
350         PR c++/65061
351         * parser.c (cp_parser_template_name): Call strip_using_decl.
353 2015-03-16  Marek Polacek  <polacek@redhat.com>
355         DR 1688
356         PR c++/65327
357         * decl.c (grokdeclarator): Allow volatile and constexpr together.
359 2015-03-12  Paolo Carlini  <paolo.carlini@oracle.com>
361         PR c++/65323
362         * decl.c (check_default_argument): Don't call
363         maybe_warn_zero_as_null_pointer_constant.
365 2015-03-11  Aldy Hernandez  <aldyh@redhat.com>
367         * cp-gimplify.c (simple_empty_class_p): New.
368         * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR.  Abstract
369         the code for empty class copies into simple_empty_class_p, and
370         adapt it to handle COMPOUND_EXPRs.
372 2015-03-10  Paolo Carlini  <paolo.carlini@oracle.com>
374         PR c++/65370
375         * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
376         only if the location of newdecl doesn't match the location of olddecl.
378 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
380         PR c++/65127
381         * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
382         is not a PARM_DECL.
384 2015-03-10  Jason Merrill  <jason@redhat.com>
386         PR c++/65333
387         DR 1558
388         * pt.c (dependent_type_p_r): Check both class and alias template args.
390 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
392         PR c/65120
393         * parser.c (cp_parser_binary_expression): Check for tcc_comparison
394         before preparing arguments to warn_logical_not_parentheses.
395         Use maybe_constant_value on rhs.
397 2015-03-09  Jason Merrill  <jason@redhat.com>
399         PR c++/65339
400         * call.c: Don't call maybe_resolve_dummy when calling a constructor.
402 2015-03-09  Jakub Jelinek  <jakub@redhat.com>
404         PR c/65120
405         * parser.c (cp_parser_binary_expression): Don't warn for
406         !!x == y or !b == y where b is bool.
408 2015-03-06  Aldy Hernandez  <aldyh@redhat.com>
410         * ptree.c (cxx_print_lambda_node): New.
411         (cxx_print_xnode): Handle LAMBDA_EXPR.
413 2015-03-03  Aldy Hernandez  <aldyh@redhat.com>
415         PR c++/65295
416         * constexpr.c (cxx_eval_constant_expression): Remove assert in
417         RESULT_DECL handling.
419 2015-02-26  Marek Polacek  <polacek@redhat.com>
421         PR c++/65202
422         * constexpr.c (cxx_eval_constant_expression): Don't evaluate
423         a RETURN_EXPR if its operand is null.
425 2015-02-25  Jason Merrill  <jason@redhat.com>
427         PR c++/65209
428         * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
429         DECL_COMDAT.
430         (constrain_visibility_for_template): Handle reference arguments.
432         PR debug/58315
433         * decl.c (start_preparsed_function): Use create_artificial_label
434         for cdtor_label.
436 2015-02-17  Paolo Carlini  <paolo.carlini@oracle.com>
437             Jakub Jelinek  <jakub@redhat.com>
439         PR c++/65075
440         * constexpr.c (check_constexpr_bind_expr_vars): Allow
441         implicit typedefs for lambda types.
443 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
445         PR c++/60894
446         * decl.c (lookup_and_check_tag): Use strip_using_decl.
448 2015-02-13  Jason Merrill  <jason@redhat.com>
450         PR c++/65054
451         * pt.c (template_args_equal): Look through conversions here.
452         * tree.c (cp_tree_equal): Not here.
454 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
456         PR c++/60211
457         * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
458         pragma_external context.
460 2015-02-13  Jason Merrill  <jason@redhat.com>
462         PR c++/65051
463         * call.c (reference_binding): Don't look for bad conversion
464         if TO is incomplete.
466 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
468         PR c++/64970
469         * decl.c (make_typename_type): Pass tsubst_flags_t argument
470         to lookup_template_class.
472 2015-02-13  Jakub Jelinek  <jakub@redhat.com>
474         PR ipa/65034
475         * decl.c (start_preparsed_function): Use void_type_node instead
476         of NULL_TREE as LABEL_DECL type.
478 2015-02-12  Jason Merrill  <jason@redhat.com>
480         PR c++/64898
481         * mangle.c (write_mangled_name): Fix test for variable template
482         instantiation.
484         * decl.c (begin_destructor_body): Condition clobber on
485         -flifetime-dse.
487 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
489         PR c++/64959
490         * parser.c (lookup_literal_operator): Return all candidates.
491         (cp_parser_userdef_char_literal): Simplify error handling.
492         (cp_parser_userdef_numeric_literal):  Pass tf_warning_or_error.
493         (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
494         Also give higher priority to standard string UDL operator.
496 2015-02-12  Jakub Jelinek  <jakub@redhat.com>
498         PR debug/55541
499         * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
500         * decl.c (poplevel): If functionbody, try not to create an extra
501         BLOCK for function body and use subblocks as that, if it is non-NULL
502         and doesn't have siblings.  Set BLOCK_OUTER_CURLY_BRACE_P flag.
503         (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
505         PR sanitizer/64984
506         * except.c (check_noexcept_r): Return NULL for internal
507         calls.
509 2015-02-10  Jason Merrill  <jason@redhat.com>
511         PR c++/64994
512         * constexpr.c (cxx_eval_call_expression): Walk the clone list.
514 2015-02-10  Jan Hubicka  <hubicka@ucw.cz>
516         PR ipa/64982
517         * method.c (use_thunk): Do not check for stdarg thunks.
519 2015-02-06  Jason Merrill  <jason@redhat.com>
521         PR c++/64899
522         * init.c (build_vec_init): Handle default-initialized array with
523         constexpr default constructor.
525 2015-02-04  Jakub Jelinek  <jakub@redhat.com>
527         PR c/64824
528         PR c/64868
529         * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
531 2015-02-03  Paolo Carlini  <paolo.carlini@oracle.com>
533         PR c++/64877
534         * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
535         for generated expressions.
537 2015-02-02  Ville Voutilainen  <ville.voutilainen@gmail.com>
539         PR c++/64901
540         * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
541         DECL_OVERRIDE_P.
543 2015-02-02  Jason Merrill  <jason@redhat.com>
545         * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
547 2015-01-30  Joseph Myers  <joseph@codesourcery.com>
549         * class.c, except.c, parser.c, pt.c: All callers of fatal_error
550         changed to pass input_location as first argument.
552 2015-01-29  Jakub Jelinek  <jakub@redhat.com>
554         PR c++/64717
555         * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
556         into SAVE_EXPR.
558 2015-01-29  Jason Merrill  <jason@redhat.com>
560         PR c++/49508
561         * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
562         erroneous return statement.
564         PR c++/64521
565         * repo.c (repo_emit_p): It's OK for a clone to be extern at this
566         point.
568 2015-01-27  Caroline Tice  <cmtice@google.com>
570         Committing VTV Cywin/Ming patch for Patrick Wollgast
571         * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
572         check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
574 2015-01-27  Jason Merrill  <jason@redhat.com>
576         PR c++/58597
577         * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
578         current_function_decl.
580         PR c++/63889
581         * pt.c (finish_template_variable): Move from semantics.c.
582         Handle multiple template arg levels.  Handle coercion here.
583         (lookup_template_variable): Not here.
585 2015-01-23  Jason Merrill  <jason@redhat.com>
587         PR c++/64314
588         PR c++/57510
589         * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
590         that has been completely split out.
592         PR c++/64701
593         * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
594         statement codes.
596         PR c++/64727
597         * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
598         of CONST_DECL.
600 2015-01-21  Jason Merrill  <jason@redhat.com>
602         PR c++/64603
603         * constexpr.c (cxx_eval_constant_expression): Only shortcut
604         constant CONSTRUCTORs.
606         PR c++/64647
607         * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
608         give a hard error in a template instantiation.
610 2015-01-21  Richard Biener  <rguenther@suse.de>
612         PR middle-end/64313
613         * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
614         for builtins the user declared correctly.
616 2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
618         PR c++/58614
619         * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
620         TREE_TYPE (elt) == error_mark_node.
622 2015-01-15  Jan Hubicka  <hubicka@ucw.cz>
624         PR tree-optimization/62053
625         * tree.c (build_cplus_array_type): Layout type after variants are set.
627 2015-01-15  Jakub Jelinek  <jakub@redhat.com>
629         * cp-gimplify.c (cp_genericize_r): Call
630         cp_ubsan_maybe_instrument_member_call for member calls.
631         (cp_ubsan_check_member_access_r): New function.
632         (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
633         * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
634         cp_ubsan_instrument_member_accesses,
635         cp_ubsan_maybe_instrument_downcast,
636         cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
637         * cp-ubsan.c: New file.
638         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
639         * constexpr.c (cxx_eval_call_expression): Return void_node
640         for IFN_UBSAN_VPTR.
641         (potential_constant_expression_1): Return true for
642         UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
643         * typeck.c (build_class_member_access_expr): Provide locus
644         for COMPONENT_REFs.
645         (build_static_cast_1): Instrument downcasts.
646         * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
647         add ubsan instrumentation for virtual_access.
648         * call.c: Include internal-fn.h.
649         (set_flags_from_callee): Handle internal calls.
651 2015-01-15  Momchil Velikov  <momchil.velikov@gmail.com>
653         PR c++/59366
654         * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
655         and function templates, declared only in the class.
656         * decl.c (duplicate_decls): Reveal hidden friend functions or
657         function templates, if they are redeclared outside the class.
659 2015-01-15  Jason Merrill  <jason@redhat.com>
661         PR c++/64356
662         * constexpr.c (cxx_eval_binary_expression): Fix pasto.
664         PR c++/63283
665         * constexpr.c (potential_constant_expression_1): Handle reference
666         args in templates.
668 2015-01-15  Thomas Schwinge  <thomas@codesourcery.com>
669             James Norris  <jnorris@codesourcery.com>
670             Cesar Philippidis  <cesar@codesourcery.com>
671             Ilmir Usmanov  <i.usmanov@samsung.com>
672             Jakub Jelinek  <jakub@redhat.com>
674         * parser.c: Include "gomp-constants.h".
675         (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
676         omp_clause_map_kind.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
677         Use OMP_CLAUSE_SET_MAP_KIND.
678         (cp_parser_omp_construct, cp_parser_pragma): Handle
679         PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
680         PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
681         PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
682         (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
683         "create", "delete", "deviceptr", "host", "num_gangs",
684         "num_workers", "present", "present_or_copy", "pcopy",
685         "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
686         "present_or_create", "pcreate", "vector_length", "wait".
687         (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
688         (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
689         (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
690         (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
691         (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
692         (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
693         (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
694         (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
695         (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
696         (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
697         (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
698         (cp_parser_oacc_kernels, cp_parser_oacc_loop)
699         (cp_parser_oacc_parallel, cp_parser_oacc_update)
700         (cp_parser_oacc_wait): New functions.
701         * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
702         (finish_oacc_parallel): New prototypes.
703         * semantics.c: Include "gomp-constants.h".
704         (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR.  Use
705         GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
706         OMP_CLAUSE_SET_MAP_KIND.
707         (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
708         OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
709         Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
710         (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
711         functions.
713 2015-01-14  Paolo Carlini  <paolo.carlini@oracle.com>
715         PR c++/58671
716         * decl2.c (var_defined_without_dynamic_init): Handle gracefully
717         self-initialization.
719 2015-01-13  Jason Merrill  <jason@redhat.com>
721         PR c++/64356
722         PR libstdc++/58777
723         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
724         pointer expressions.
725         (cxx_eval_increment_expression): Likewise.
727         PR c++/64514
728         * pt.c (coerce_template_parameter_pack): Return NULL for a
729         zero-length fixed parameter pack with a pack expansion arg.
731         PR c++/64520
732         * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
734 2015-01-12  Jason Merrill  <jason@redhat.com>
736         PR c++/64547
737         * constexpr.c (cxx_eval_call_expression): A call to a void
738         function doesn't need to return a value.
740 2015-01-09  Michael Collison  <michael.collison@linaro.org>
742         * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
743         input.h, alias.h, symtab.h, options.h, fold-const.h,
744         wide-int.h, and inchash.h due to flattening of tree.h.
745         * class.c: Ditto.
746         * constexpr.c: Ditto.
747         * cp-array-notation.c: Ditto.
748         * cp-gimplify.c: Ditto.
749         * cp-lang.c: Ditto.
750         * cp-objcp-common.c: Ditto.
751         * cvt.c: Ditto.
752         * decl2.c: Ditto.
753         * decl.c: Ditto.
754         * dump.c: Ditto.
755         * error.c: Ditto.
756         * except.c: Ditto.
757         * expr.c: Ditto.
758         * friend.c: Ditto.
759         * init.c: Ditto.
760         * lambda.c: Ditto.
761         * lex.c: Ditto.
762         * mangle.c: Ditto.
763         * name-lookup.c: Ditto.
764         * optimize.c: Ditto.
765         * parser.c: Ditto.
766         * pt.c: Ditto.
767         * ptree.c: Ditto.
768         * repo.c: Ditto.
769         * rtti.c: Ditto.
770         * search.c: Ditto.
771         * semantics.c: Ditto.
772         * tree.c: Ditto.
773         * typeck2.c: Ditto.
774         * typeck.c: Ditto.
776 2015-01-08  Jason Merrill  <jason@redhat.com>
778         * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
779         * decl.c (compute_array_index_type): Likewise.
780         * init.c (build_vec_init): Likewise.
781         * typeck.c (cp_build_binary_op): Likewise.
783 2015-01-08  Jason Merrill  <jason@redhat.com>
785         * init.c (build_vec_init): Call ubsan_instrument_bounds to check
786         whether an initializer-list is too big for a VLA.
787         (throw_bad_array_length): Remove.
788         * cp-tree.h: Remove prototype.
790 2015-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
792         PR c++/60753
793         * decl.c (grokfndecl): Add bool parameter.
794         (grokdeclarator): Adjust calls.
795         (start_decl): Don't set DECL_DELETED_FN here.
797 2015-01-06  Jason Merrill  <jason@redhat.com>
799         * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
800         template-ids.
802         PR c++/64455
803         * pt.c (type_dependent_expression_p): Handle variable templates.
804         * constexpr.c (potential_constant_expression_1): Use it.
806         PR c++/64487
807         * semantics.c (finish_offsetof): Handle templates here.
808         * parser.c (cp_parser_builtin_offsetof): Not here.
810         PR c++/64496
811         * semantics.c (process_outer_var_ref): Diagnose lambda in local
812         class NSDMI.
814 2015-01-06  Ville Voutilainen  <ville.voutilainen@gmail.com>
816         PR c++/64489
817         * class.c (check_field_decls): Make copy assignment operators
818         complex only in c++98 mode.
820 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
822         PR c++/31397
823         * class.c (check_for_override): Warn when a virtual function is an
824         override not marked override.
826 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
828         * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
829         hold base_fndecls.
830         (get_basefndecls): Adjust.
832 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
834         Update copyright years.
836 2015-01-05  Marek Polacek  <polacek@redhat.com>
838         PR c/64423
839         * typeck.c (cp_build_array_ref): Pass loc down to
840         warn_array_subscript_with_type_char.
843 Copyright (C) 2015 Free Software Foundation, Inc.
845 Copying and distribution of this file, with or without modification,
846 are permitted in any medium without royalty provided the copyright
847 notice and this notice are preserved.