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