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