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