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