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