Makefile.in: Don't cat ../stage_current if it does not exist.
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2016-06-28  Jakub Jelinek  <jakub@redhat.com>
2
3         * Make-lang.in: Don't cat ../stage_current if it does not exist.
4
5 2016-06-24  Jason Merrill  <jason@redhat.com>
6
7         P0145R2: Refining Expression Order for C++.
8         * typeck.c (cp_build_modify_expr): Leave COMPOUND_EXPR on LHS.
9
10         * tree.c (get_target_expr_sfinae): Handle bit-fields.
11         (build_target_expr): Call mark_rvalue_use.
12
13 2016-06-24  Jakub Jelinek  <jakub@redhat.com>
14
15         * call.c (magic_varargs_p): Return 3 for __builtin_*_overflow_p.
16         (build_over_call): For magic == 3, do no conversion only on 3rd
17         argument.
18
19 2016-06-23  Andi Kleen  <ak@linux.intel.com>
20
21         * Make-lang.in: Add support for autofdo.
22
23 2016-06-21  Jason Merrill  <jason@redhat.com>
24
25         * constraint.cc (constraints_satisfied_p): Keep as many levels of
26         args as our template has levels of parms.
27
28         * pt.c (template_parm_outer_level, uses_outer_template_parms): New.
29         (type_dependent_expression_p): Use uses_outer_template_parms.
30
31 2016-06-20  David Malcolm  <dmalcolm@redhat.com>
32
33         * parser.c (cp_parser_string_literal): Convert non-standard
34         concatenation error to directly use a rich_location, and
35         use that to add the location of the first literal to the
36         diagnostic.
37
38 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
39
40         * decl.c (validate_constexpr_redeclaration): Change pair of errors
41         to error + inform.
42         * error.c (dump_function_decl): Save the constexpr specifier too.
43
44 2016-06-17  Jakub Jelinek  <jakub@redhat.com>
45
46         * tree.c (builtin_valid_in_constant_expr_p): Test for
47         DECL_BUILT_IN_CLASS equal to BUILT_IN_NORMAL instead of just
48         DECL_BUILT_IN.
49         (bot_manip): Likewise.
50         * call.c (magic_varargs_p): Likewise.
51
52 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
53
54         * decl.c (grokfndecl): Change pair of errors to error + inform.
55
56 2016-06-17  Jason Merrill  <jason@redhat.com>
57
58         PR c++/71209
59         * typeck.c (finish_class_member_access_expr): Avoid "not a base"
60         warning when there are dependent bases.
61
62 2016-06-17  Jakub Jelinek  <jakub@redhat.com>
63
64         * semantics.c (handle_omp_array_sections_1): Don't ICE when
65         processing_template_decl when checking for bitfields and unions.
66         Look through REFERENCE_REF_P as base of COMPONENT_REF.
67         (finish_omp_clauses): Look through REFERENCE_REF_P even for
68         array sections with COMPONENT_REF bases.
69
70 2016-06-16  Jakub Jelinek  <jakub@redhat.com>
71
72         * parser.c (cp_parser_omp_var_list_no_open): Call
73         convert_from_reference before cp_parser_postfix_dot_deref_expression.
74         * semantics.c (finish_omp_clauses): Don't ICE when
75         processing_template_decl when checking for bitfields and unions.
76         Look through REFERENCE_REF_P as base of COMPONENT_REF.
77
78 2016-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
79
80         * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and
81         "%qF" in warning_at instead of "%q+F" in warning.
82         (check_redeclaration_exception_specification): Likewise in pedwarn
83         (and error, inform, for consistency).
84         * call.c (joust): Likewise.
85
86 2016-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
87
88         PR c++/70202
89         * decl.c (xref_basetypes): Revert r117839 changes; add fix-up
90         code at the end of the for loop; also revert r159637 changes,
91         add back the gcc_assert.
92         * cp-tree.h (xref_basetypes): Adjust declaration.
93         * parser.c (cp_parser_class_head): Adjust xref_basetypes call.
94
95 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
96
97         * search.c: Include spellcheck-tree.h rather than spellcheck.h.
98
99 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
100
101         * typeck.c: Include "gcc-rich-location.h".
102         (finish_class_member_access_expr): Simplify fixit code by
103         using gcc_rich_location::add_fixit_misspelled_id.
104
105 2016-06-14  Jason Merrill  <jason@redhat.com>
106
107         P0145R2: Refining Expression Order for C++.
108         * cp-tree.h (CALL_EXPR_OPERATOR_SYNTAX, CALL_EXPR_ORDERED_ARGS)
109         (CALL_EXPR_REVERSE_ARGS): New.
110         * call.c (build_new_op_1): Set them.
111         (extract_call_expr, op_is_ordered): New.
112         (build_over_call): Set CALL_EXPR_ORDERED_ARGS.
113         * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Handle new flags.
114         * pt.c (tsubst_copy_and_build): Copy new flags.
115         * semantics.c (simplify_aggr_init_expr): Likewise.
116         * tree.c (build_aggr_init_expr): Likewise.
117         (build_min_non_dep_op_overload): Likewise.
118
119 2016-06-14  Jakub Jelinek  <jakub@redhat.com>
120
121         PR c++/71528
122         * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
123         olddecl vars, preserve their TREE_READONLY bit.
124
125         PR c++/71516
126         * decl.c (complete_vars): Handle gracefully type == error_mark_node.
127
128 2016-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
129
130         * typeck2.c (digest_init_r): Use EXPR_LOC_OR_LOC on init.
131
132 2016-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
133
134         * decl.c (grokdeclarator): Fix typo in pedwarn text.
135
136 2016-06-10  Thomas Schwinge  <thomas@codesourcery.com>
137
138         PR c/71381
139         * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
140         Loosen checking.
141
142 2016-06-09  Paolo Carlini  <paolo.carlini@oracle.com>
143
144         PR c++/71465
145         Revert:
146         2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
147
148         PR c++/70202
149         * parser.c (cp_parser_class_head): When xref_basetypes fails and
150         emits an error do not zero the type.
151
152 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
153
154         * decl.c (maybe_deduce_size_from_array_init): Use
155         DECL_SOURCE_LOCATION in error_at.
156         (layout_var_decl): Likewise.
157         (check_array_initializer): Likewise.
158         (check_initializer): Likewise.
159         (duplicate_decls, check_elaborated_type_specifier): Tidy.
160
161 2016-06-08  Martin Sebor  <msebor@redhat.com>
162             Jakub Jelinek  <jakub@redhat.com>
163
164         PR c++/70507
165         PR c/68120
166         * constexpr.c: Include gimple-fold.h.
167         (cxx_eval_internal_function): New function.
168         (cxx_eval_call_expression): Call it.
169         (potential_constant_expression_1): Handle integer arithmetic
170         overflow built-ins.
171         * tree.c (builtin_valid_in_constant_expr_p): Handle
172         BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
173
174 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
175
176         * pt.c (tsubst, case TYPENAME_TYPE): Don't delay checking the
177         return value of tsubst_aggr_type for error_mark_node.
178
179 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
180
181         PR c++/71442
182         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
183
184 2016-06-06  Jakub Jelinek  <jakub@redhat.com>
185             Patrick Palka  <ppalka@gcc.gnu.org>
186
187         PR c++/70847
188         PR c++/71330
189         PR c++/71393
190         * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
191         right after cp_fold call if cp_fold has returned the same stmt
192         already in some earlier cp_fold_r call.
193         (cp_fold_function): Add pset automatic variable, pass its address
194         to cp_walk_tree.
195
196 2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
197
198         PR c++/70202
199         * parser.c (cp_parser_class_head): When xref_basetypes fails and
200         emits an error do not zero the type.
201
202 2016-06-03  Patrick Palka  <ppalka@gcc.gnu.org>
203
204         PR c++/27100
205         * decl.c (duplicate_decls): Properly copy the
206         DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
207         DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
208
209 2016-06-03  Chung-Lin Tang  <cltang@codesourcery.com>
210
211         * semantics.c (finish_omp_clauses): Mark OpenACC reduction
212         arguments as addressable when async clause exists.
213
214 2016-06-02  Jan Hubicka  <jh@suse.cz>
215
216         * cp-gimplify.c (genericize_continue_stmt): Force addition of
217         predict stmt.
218
219 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
220
221         * decl.c (xref_tag_1): Change pairs of errors to error + inform.
222         (start_enum): Likewise.
223         * parser.c (cp_parser_class_head): Likewise.
224
225 2016-06-02  Jakub Jelinek  <jakub@redhat.com>
226
227         PR c++/71372
228         * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
229         is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
230         and TREE_THIS_VOLATILE flags.  For ARRAY_REF and ARRAY_RANGE_REF, copy
231         over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
232         to the newly built tree.
233
234 2016-05-31  Jason Merrill  <jason@redhat.com>
235
236         * pt.c (instantiate_decl): Avoid recalculation.
237
238         PR c++/60095
239         PR c++/69515
240         PR c++/69009
241         * pt.c (instantiate_template_1): Don't put the partial
242         specialization in DECL_TI_TEMPLATE.
243         (partial_specialization_p, impartial_args): Remove.
244         (regenerate_decl_from_template): Add args parm.
245         (instantiate_decl): Look up the partial specialization again.
246
247         PR c++/71227
248         * pt.c (check_explicit_specialization): Give better diagnostic about
249         specializing a hidden friend.
250
251 2016-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
252
253         PR c++/71248
254         * decl.c (check_static_variable_definition): Use DECL_SOURCE_LOCATION
255         to obtain correct locations; avoid redundant diagnostics on
256         out-of-class definitions.
257
258 2016-05-30  Martin Sebor  <msebor@redhat.com>
259
260         PR c++/71306
261         * init.c (warn_placement_new_too_small): Handle placement new arguments
262         that are elements of arrays more carefully.  Remove a pointless loop.
263
264 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
265
266         PR c++/71349
267         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
268         when combined with target construct.
269         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
270         to cp_parser_omp_all_clauses.
271
272 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
273
274         PR c++/71238
275         * lex.c (unqualified_name_lookup_error): Take a location too.
276         (unqualified_fn_lookup_error): Take a cp_expr.
277         * cp-tree.h (unqualified_name_lookup_error,
278         unqualified_fn_lookup_error): Adjust declarations.
279         * semantics.c (perform_koenig_lookup): Adjust
280         unqualified_fn_lookup_error call, pass the location of
281         the identifier too as part of a cp_expr.
282
283 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
284
285         PR c++/71099
286         * parser.c (cp_parser_function_specifier_opt): Use current_class_type
287         to improve the diagnostic about wrong uses of 'virtual'.
288
289 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
290
291         PR c++/71105
292         * lambda.c (maybe_add_lambda_conv_op): Early return also when
293         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
294
295 2016-05-28  Ville Voutilainen  <ville.voutilainen@gmail.com>
296
297         Revert:
298         PR c++/69855
299         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
300         decls into the global scope after stripping template bits
301         and setting DECL_ANTICIPATED.
302
303 2016-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
304
305         PR c++/60385
306         * name-lookup.c (push_namespace): Return bool, false when pushdecl
307         fails.
308         * name-lookup.h (push_namespace): Adjust declaration.
309         * parser.c (cp_parser_namespace_definition): Check push_namespace
310         return value.
311
312 2016-05-27  Ville Voutilainen  <ville.voutilainen@gmail.com>
313
314         PR c++/69855
315         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
316         decls into the global scope after stripping template bits
317         and setting DECL_ANTICIPATED.
318
319 2016-05-26  Jakub Jelinek  <jakub@redhat.com>
320
321         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
322         if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
323
324 2016-05-26  Patrick Palka  <ppalka@gcc.gnu.org>
325
326         PR c++/70822
327         PR c++/70106
328         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
329         SCOPE_REFs too.
330         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
331         on the qualified_id then propagate it to the resulting
332         expression.
333         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
334         too.
335         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
336         its REF_PARENTHESIZED_P flag.
337
338 2016-05-25  Jason Merrill  <jason@redhat.com>
339
340         PR c++/71173
341         PR c++/70522
342         * cp-tree.h (enum tag_types): Add scope_type.
343         * parser.c (cp_parser_class_name): Use scope_type.
344         (prefer_type_arg): Handle scope_type.
345         (cp_parser_lookup_name): Use prefer_type_arg.
346         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
347         int prefer_type, use lookup_flags.
348         * name-lookup.h: Adjust.
349
350 2016-05-24  Cesar Philippidis  <cesar@codesourcery.com>
351
352         * parser.c (cp_parser_oacc_declare): Add support for
353         GOMP_MAP_FIRSTPRIVATE_POINTER.
354         * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
355         argument with enum c_omp_region_type ort.  Don't privatize OpenACC
356         non-static members.
357         (handle_omp_array_sections): Replace bool is_omp argument with enum
358         c_omp_region_type ort.  Update call to handle_omp_array_sections_1.
359         (finish_omp_clauses): Add specific errors and warning messages for
360         OpenACC.  Use firsrtprivate pointers for OpenACC subarrays.  Update
361         call to handle_omp_array_sections.
362
363 2016-05-24  Jason Merrill  <jason@redhat.com>
364
365         PR c++/70584
366         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
367         returns a decl.
368         (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
369
370 2016-05-24  Martin Sebor  <msebor@redhat.com>
371
372         PR c++/71147
373         * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
374         * pt.c (instantiate_class_template_1): Try to complete the element
375         type of a flexible array member.
376         (can_complete_type_without_circularity): Handle arrays of unknown bound.
377         * typeck.c (complete_type): Also complete the type of the elements of
378         arrays with an unspecified bound.
379
380 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
381
382         PR c++/69872
383         * typeck2.c (check_narrowing): Check pedwarn return value.
384
385 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
386
387         PR c++/71257
388         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
389         For OMP_CLAUSE_LINEAR_REF don't require type to be
390         integral or pointer.
391
392 2016-05-24  Richard Biener  <rguenther@suse.de>
393
394         PR middle-end/70434
395         PR c/69504
396         * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
397         * constexpr.c (cxx_eval_array_reference): Handle indexed
398         vectors.
399         * typeck.c (cp_build_array_ref): Adjust.
400
401 2016-05-23  Jason Merrill  <jason@redhat.com>
402
403         PR c++/70344
404         * constexpr.c (cxx_eval_call_expression): Check for
405         fun == current_function_decl again.
406
407         PR c++/70584
408         * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
409         maybe_undo_parenthesized_ref.
410
411         PR c++/70735
412         * pt.c (tsubst_copy): Just return a local variable from
413         non-template context.  Don't call rest_of_decl_compilation for
414         duplicated static locals.
415         (tsubst_decl): Set DECL_CONTEXT of local static from another
416         function.
417
418 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
419
420         PR c++/70972
421         * method.c (forward_parm): Use cp_build_reference_type.
422
423 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
424
425         PR c++/69095
426         * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
427
428 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
429
430         * pt.c (check_for_bare_parameter_packs): Improve error message
431         location for expressions.
432
433 2016-05-20  Nathan Sidwell  <nathan@acm.org>
434
435         * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
436         ... goto.
437         (cxx_eval_call_expression): Fix comment grammar.
438
439 2016-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
440
441         PR c++/70572
442         * decl.c (cp_finish_decl): Check do_auto_deduction return value
443         and return immediately in case of erroneous code.
444
445 2016-05-19  Marek Polacek  <polacek@redhat.com>
446
447         PR c++/71075
448         * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
449
450 2016-05-19  Jason Merrill  <jason@redhat.com>
451
452         PR c++/10200
453         * pt.c (fn_type_unification): Add outer template args if needed.
454         (type_unification_real): Handle getting full args.
455
456 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
457
458         PR c++/71184
459         * parser.c (cp_parser_operator): For array new/delete, check that
460         cp_parser_require returned a non-NULL token before dereferencing
461         it.
462
463 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
464
465         * decl.c (finish_enum_value_list): Use the specified mode.
466
467 2016-05-18  Jason Merrill  <jason@redhat.com>
468
469         * pt.c (value_dependent_expression_p): Tweak new cases to better
470         match the wording in the standard.
471
472 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
473
474         PR c++/69793
475         * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
476         when the previous cp_lexer_peek_token returns CPP_EOF.
477
478 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
479
480         PR c++/70466
481         * call.c (convert_like_real): Check that we are actually converting
482         from an init list.
483
484 2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>
485
486         * decl.c (grokdeclarator): Remove errmsg and use of
487         targetm.invalid_return_type.
488         (grokparms): Remove errmsg and use of
489         targetm.invalid_parameter_type.
490
491 2016-05-13  Jason Merrill  <jason@redhat.com>
492
493         PR c++/10200
494         PR c++/69753
495         * pt.c (tsubst_decl): Use uses_template_parms.
496         (instantiate_template_1): Handle non-dependent calls in templates.
497         (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
498         (type_dependent_expression_p): Only consider innermost template args.
499         (dependent_template_arg_p): Check enclosing class of a template here.
500         (dependent_template_p): Not here.
501         (type_dependent_object_expression_p): New.
502         * typeck.c (finish_class_member_access_expr): Use it.
503         * parser.c (cp_parser_postfix_expression): Use it.
504         (cp_parser_postfix_dot_deref_expression): Use it.  Use comptypes
505         to detect the current instantiation.
506         (cp_parser_lookup_name): Really implement DR 141.
507         * search.c (lookup_field_r): Prefer a dependent using-declaration.
508         (any_dependent_bases_p): Split out from...
509         * name-lookup.c (do_class_using_decl): ...here.
510         * call.c (build_new_method_call_1): Use it.
511         * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
512         * tree.c (non_static_member_function_p): Remove.
513         * typeck2.c (build_x_arrow): Use dependent_scope_p.
514
515         * parser.c (cp_parser_postfix_dot_deref_expression): Use
516         complete_type_or_else for unknown_type_node, too.
517
518 2016-05-12  Marek Polacek  <polacek@redhat.com>
519
520         PR c/70756
521         * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
522         * cp-tree.h (cp_build_modify_expr): Update declaration.
523         (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
524         overloads.
525         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
526         cp_build_modify_expr.
527         * decl2.c (set_guard): Likewise.
528         (handle_tls_init): Likewise.
529         * init.c (perform_member_init): Likewise.
530         (expand_virtual_init): Likewise.
531         (build_new_1): Likewise.
532         (build_vec_delete_1): Likewise.
533         (get_temp_regvar): Likewise.
534         (build_vec_init): Likewise.
535         * method.c (do_build_copy_assign): Likewise.
536         (assignable_expr): Likewise.
537         * semantics.c (finish_omp_for): Likewise.
538         * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
539         cp_pointer_int_sum.
540         (cp_pointer_int_sum): Add location parameter.  Pass it down to
541         pointer_int_sum.
542         (pointer_diff): Add location parameter.  Use it.
543         (build_modify_expr): Pass location down to cp_build_modify_expr.
544         (cp_build_modify_expr): Add location parameter.  Use it.
545         (build_x_modify_expr): Pass location down to cp_build_modify_expr.
546         * typeck2.c (cxx_incomplete_type_diagnostic,
547         cxx_incomplete_type_error): Add location parameter.
548
549 2016-05-11  Marek Polacek  <polacek@redhat.com>
550
551         PR c++/71024
552         * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
553
554 2016-05-05  Jakub Jelinek  <jakub@redhat.com>
555
556         * parser.c (cp_parser_selection_statement): For RID_SWITCH,
557         pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
558
559 2016-05-04  Marek Polacek  <polacek@redhat.com>
560
561         * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
562         with OPT_Wdangling_else.
563
564 2016-05-03  Martin Sebor  <msebor@redhat.com>
565
566         PR c++/66561
567         * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
568         BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
569
570 2016-05-03  Marek Polacek  <polacek@redhat.com>
571
572         PR c/70859
573         * call.c (build_cxx_call): Pass location and vNULL down to
574         check_builtin_function_arguments.
575
576 2016-05-03  Richard Biener  <rguenther@suse.de>
577
578         * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
579         the checksum from the previous stage.
580
581 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
582
583         PR c++/62314
584         * typeck.c (finish_class_member_access_expr): When
585         giving a hint about a possibly-misspelled member name,
586         add a fix-it replacement hint.
587
588 2016-05-02  Cesar Philippidis  <cesar@codesourcery.com>
589
590         * cp-tree.h (finish_omp_clauses): Update prototype.
591         * parser.c (cp_parser_oacc_all_clauses): Update call to
592         finish_omp_clauses.
593         (cp_parser_omp_all_clauses): Likewise.
594         (cp_parser_omp_for_loop): Likewise.
595         (cp_omp_split_clauses): Likewise.
596         (cp_parser_oacc_cache): Likewise.
597         (cp_parser_oacc_loop): Likewise.
598         (cp_parser_omp_declare_target):
599         (cp_parser_cilk_simd_all_clauses): Likewise.
600         (cp_parser_cilk_for): Likewise.
601         * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
602         arguments with enum c_omp_region_type ort.
603         (tsubst_omp_clauses): Update calls to finish_omp_clauses.
604         (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
605         (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
606         (tsubst_expr): Update calls to tsubst_omp_clauses.
607         * semantics.c (finish_omp_clauses): Replace bool arguments
608         allow_fields, declare_simd, and is_cilk with bitmask ort.
609         (finish_omp_for): Update call to finish_omp_clauses.
610
611 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
612
613         PR c++/62314
614         * parser.c (cp_parser_class_head): Capture the start location;
615         use it to emit a fix-it insertion hint when complaining
616         about missing "template <> " in explicit specializations.
617
618 2016-05-02  Richard Sandiford  <richard.sandiford@arm.com>
619
620         * init.c (build_new_1): Use shift operators instead of wi:: shifts.
621
622 2016-05-02  Richard Biener  <rguenther@suse.de>
623
624         * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
625         anonymous VLAs.
626
627 2016-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
628
629         PR c++/66644
630         * class.c (check_field_decl): Remove final int* parameter, change
631         the return type to bool; fix logic in order not to reject multiple
632         initialized fields in anonymous struct.
633         (check_field_decls): Adjust call.
634
635 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
636
637         PR middle-end/70626
638         * parser.c (cp_parser_oacc_loop): Don't augment mask with
639         OACC_LOOP_CLAUSE_MASK.
640         (cp_parser_oacc_kernels_parallel): Update call to
641         c_oacc_split_loop_clauses.
642
643 2016-04-28  Jason Merrill  <jason@redhat.com>
644
645         Implement C++17 [[nodiscard]] attribute.
646         PR c++/38172
647         PR c++/54379
648         * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
649         * tree.c (handle_nodiscard_attribute): New.
650         (cxx_attribute_table): Add [[nodiscard]].
651         * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
652         (maybe_warn_nodiscard): New.
653         (convert_to_void): Call it.
654
655         * cvt.c (cp_get_callee): New.
656         * constexpr.c (get_function_named_in_call): Use it.
657         * cxx-pretty-print.c (postfix_expression): Use it.
658         * except.c (check_noexcept_r): Use it.
659         * method.c (check_nontriv): Use it.
660         * tree.c (build_aggr_init_expr): Use it.
661         * cp-tree.h: Declare it.
662
663 2015-04-27  Ryan Burn  <contact@rnburn.com>
664             Jeff Law  <law@redhat.com>
665
666         PR c++/69024
667         PR c++/68997
668         * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
669         instead of cilk_detect_spawn_and_unwrap.
670         * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
671         (find_spawn): New.
672         (cilk_cp_detect_spawn_and_unwrap): New.
673         * lambda.c: Include cp-cilkplus.h.
674         * parser.c: Include cp-cilkplus.h.
675         * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
676         * cp-cilkpus.h: New file.
677
678 2016-04-27  Nathan Sidwell  <nathan@acm.org>
679
680         * constexpr.c (get_fundef_copy): Use the original function for
681         non-recursive evaluations.
682         (save_fundef_copy): Always expect a slot to be available.
683
684 2016-04-27  Bernd Schmidt  <bschmidt@redhat.com>
685
686         * parser.c (cp_parser_postfix_expression): Call
687         warn_for_memset instead of warning directly here.
688
689 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
690
691         PR c++/70241
692         * decl.c (build_enumerator): Set current_access_specifier when
693         declaring an enumerator belonging to an in-class enumeration.
694         * parser.c (cp_parser_check_access_in_redecleration): Also
695         consider in-class enumerations.
696
697 2016-04-26  Marek Polacek  <polacek@redhat.com>
698
699         PR c++/70744
700         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
701         instead of stabilize_reference.
702         (build_over_call): Likewise.
703         * cp-tree.h (cp_stabilize_reference): Declare.
704         * tree.c (cp_stabilize_reference): New function.
705         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
706         stabilize_reference.
707         (unary_complex_lvalue): Likewise.
708         (cp_build_modify_expr): Likewise.
709
710 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
711
712         PR bootstrap/70704
713         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
714         just flag_checking.
715
716 2016-04-25  Jason Merrill  <jason@redhat.com>
717
718         * tree.c (std_attribute_table): New.
719         (init_tree): Register it.
720
721 2016-04-22  Jason Merrill  <jason@redhat.com>
722
723         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
724
725 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
726
727         * name-lookup.c (free_saved_scope): New free list of saved_scope
728         structures.
729         (push_to_top_level): Attempt to reuse a saved_scope struct
730         from free_saved_scope instead of allocating a new one each time.
731         (pop_from_top_level_1): Chain the now-unused saved_scope structure
732         onto free_saved_scope.
733
734 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
735
736         PR c++/70540
737         * semantics.c (process_outer_var_ref): Unconditionally return
738         error_mark_node when mark_used returns false.
739
740 2016-04-21  Marek Polacek  <polacek@redhat.com>
741
742         PR c++/70513
743         * parser.c (cp_parser_enum_specifier): Check and possibly error for
744         extra qualification.
745
746 2016-04-20  Nathan Sidwell  <nathan@acm.org>
747
748         PR c++/55635
749         * init.c (build_vec_delete_1): Protect operator delete call in try
750         finally.
751         (build_delete): Likewise.
752         * optimize.c (build_delete_destructor_body): Likewise.
753
754 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
755
756         PR c++/69363
757         * cp-tree.h (finish_omp_clauses): Add new default argument.
758         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
759         instead of c_finish_cilk_clauses.
760         * semantics.c (finish_omp_clauses): Add new argument.  Allow
761         floating-point variables in the linear clause for Cilk Plus.
762
763 2016-04-20  Nathan Sidwell  <nathan@acm.org>
764
765         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
766         TARGET_EXPR.
767
768 2016-04-19  Jason Merrill  <jason@redhat.com>
769
770         PR c++/66543
771         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
772         * pt.c (make_pack_expansion): Call mark_exp_read.
773         * semantics.c (finish_id_expression): Call mark_type_use in
774         unevaluated context.
775
776         DR 2137
777         * call.c (implicit_conversion): If we choose a copy constructor
778         for list-initialization from the same type, the conversion is an
779         exact match.
780
781         * constexpr.c (breaks): Handle EXIT_EXPR.
782         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
783         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
784         of COMPOUND_EXPR.
785
786         PR c++/68206
787         PR c++/68530
788         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
789         and GOTO_EXPR.
790
791         * pt.c (tsubst_expr): Remove shadowing declaration.
792         (tsubst_pack_expansion): Add assert.
793
794         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
795
796         PR c++/70522
797         * name-lookup.c (qualified_lookup_using_namespace): Look through
798         hidden names.
799
800 2016-04-18  Michael Matz  <matz@suse.de>
801
802         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
803         (layout_class_type): Ditto.
804         (build_base_field): Use SET_DECL_ALIGN.
805         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
806         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
807         (record_unknown_type): Use SET_TYPE_ALIGN.
808         (cxx_init_decl_processing): Ditto.
809         (copy_type_enum): Ditto.
810         (grokfndecl): Use SET_DECL_ALIGN.
811         (copy_type_enum): Use SET_TYPE_ALIGN.
812         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
813         (tsubst): Ditto.
814         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
815         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
816         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
817         * rtti.c (emit_tinfo_decl): Ditto.
818
819 2016-04-18  Jason Merrill  <jason@redhat.com>
820
821         PR c++/70690
822         PR c++/70528
823         * class.c (type_maybe_constexpr_default_constructor): New.
824         (type_has_constexpr_default_constructor): Revert.
825
826 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
827
828         PR target/1078
829
830         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
831         (handle_com_interface_attribute): Delete.
832
833 2016-04-15  Jason Merrill  <jason@redhat.com>
834
835         PR c++/70685
836         * constexpr.c (get_fundef_copy): Handle null *slot.
837
838         PR c++/70505
839         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
840         unknown_type_node, too.
841
842 2016-04-15  Jason Merrill  <jason@redhat.com>
843             Nathan Sidwell  <nathan@acm.org>
844
845         PR c++/70594
846         * constexpr.c (constexpr_call_table): Preserve in GC.
847         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
848         (fundef_copies_table): Preserve in GC. Change to pointer to
849         tree->tree hash.
850         (maybe_initialize_fundef_copies_table): Adjust.
851         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
852         (save_fundef_copy): Adjust for a TREE_LIST.
853         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
854         (fini_constexpr): New.
855         * cp-tree.h (fini_constexpr): Declare.
856         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
857
858 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
859
860         PR c/70436
861         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
862         where needed.
863         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
864         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
865         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
866         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
867         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
868         cp_parser_statement.
869         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
870         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
871         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
872         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
873         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
874         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
875         cp_parser_omp_taskloop, cp_parser_omp_construct,
876         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
877         Add IF_P argument, pass it down where needed.
878         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
879         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
880         calls.
881
882 2016-04-14  Jason Merrill  <jason@redhat.com>
883
884         PR c++/70494
885         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
886         * typeck2.c (split_nonconstant_init_1): Use it.
887
888         PR c++/70528
889         * class.c (type_has_constexpr_default_constructor): Return true
890         for an implicitly declared constructor.
891
892         PR c++/70622
893         * parser.c (cp_parser_init_declarator): Add auto_result parm.
894         (cp_parser_simple_declaration): Pass it.
895         (strip_declarator_types): New.
896
897         PR c++/70543
898         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
899         initializer also makes the variable value-dependent.
900
901         PR c++/70648
902         * constexpr.c (cxx_eval_store_expression): Also copy
903         CONSTRUCTOR_NO_IMPLICIT_ZERO.
904
905 2016-04-14  Martin Sebor  <msebor@redhat.com>
906
907         PR c++/69517
908         PR c++/70019
909         PR c++/70588
910         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
911
912 2016-04-14  Jason Merrill  <jason@redhat.com>
913
914         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
915         parameter ABI change.
916
917 2016-04-13  Martin Sebor  <msebor@redhat.com>
918
919         PR c++/69517
920         PR c++/70019
921         PR c++/70588
922         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
923         functions.
924         * decl.c (check_initializer, cp_finish_decl): Call them.
925         (reshape_init_r): Reject incompletely braced intializer-lists
926         for VLAs.
927         * init.c (throw_bad_array_length, build_vla_check)
928         (build_vla_size_check, build_vla_init_check): Define new functions.
929         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
930         to detect a VLA.
931         (store_init_value): Same.
932
933 2016-04-13  Jason Merrill  <jason@redhat.com>
934
935         Warn about empty parameter ABI with -Wabi=9.
936         * call.c (empty_class_msg, mark_for_abi_warning)
937         (warn_empty_class_abi): New.
938         (build_call_a): Use them.
939         * decl.c (store_parm_decls): Use mark_for_abi_warning.
940         * error.c (pp_format_to_string): New.
941
942         Pass empty class parameters like C.
943         * call.c (pass_as_empty_struct, empty_class_arg): New.
944         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
945         (build_call_a): Use empty_class_arg.
946         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
947         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
948
949 2016-04-13  Jason Merrill  <jason@redhat.com>
950
951         PR c++/70627
952         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
953
954 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
955
956         PR c++/70635
957         * pt.c (resolve_typename_type): Fix typos in infinite recursion
958         avoidance mechanism.
959
960 2016-04-13  Jason Merrill  <jason@redhat.com>
961
962         PR c++/70634
963         * pt.c (instantiation_dependent_uneval_expression_p): Split out
964         from instantiation_dependent_expression_p.
965         (value_dependent_expression_p): Use it for unevaluated operands.
966         (instantiation_dependent_r): Don't check value-dependence.
967         (instantiation_dependent_expression_p): Check
968         value-dependence of the expression as a whole.
969         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
970         * semantics.c (finish_decltype_type): Use it.
971
972         * constexpr.c (potential_nondependent_constant_expression): New.
973         (potential_nondependent_static_init_expression): New.
974         (maybe_constant_value_1, fold_non_dependent_expr)
975         (maybe_constant_init): Use them.
976         * pt.c (instantiate_non_dependent_expr_sfinae)
977         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
978         them.
979         * cp-tree.h: Declare them.
980
981 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
982
983         PR c++/70594
984         * decl.c (pop_labels_1): Removed.
985         (note_label, sort_labels): New functions.
986         (pop_labels): During named_labels traversal, just push the slot
987         pointers into a vector, then qsort it by DECL_UID and only then
988         call pop_label and chain it into BLOCK_VARS.
989
990 2016-04-13  Jason Merrill  <jason@redhat.com>
991
992         PR c++/70615
993         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
994         (cp_gimplify_expr): Not here.
995
996 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
997
998         PR c++/70610
999         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
1000         recurse into it.
1001         * typeck.c (build_x_conditional_expr): Unconditionally remember
1002         that the result is an lvalue or xvalue.
1003
1004 2016-04-12  Jason Merrill  <jason@redhat.com>
1005
1006         * class.c (is_really_empty_class): A zero-length array is empty.
1007         An unnamed bit-field doesn't make a class non-empty.
1008
1009 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
1010
1011         PR c++/68722
1012         * parser.c (cp_parser_cache_defarg): When file ends in default
1013         argument simply return error_mark_node.
1014
1015 2016-04-12  Nathan Sidwell  <nathan@acm.org>
1016
1017         PR c++/70501
1018         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1019         similarly to PMF.
1020
1021 2016-04-11  Jason Merrill  <jason@redhat.com>
1022
1023         * mangle.c (decl_is_template_id): The template itself counts as a
1024         template-id.
1025
1026 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
1027
1028         PR c++/70590
1029         PR c++/70452
1030         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1031         on the result if it's not a CONSTRUCTOR.
1032
1033 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
1034
1035         PR c++/70452
1036         * constexpr.c (find_constructor): New function.
1037         (unshare_constructor): New function.
1038         (cxx_eval_call_expression): Use unshare_constructor instead of
1039         unshare_expr.
1040         (find_array_ctor_elt): Likewise.
1041         (cxx_eval_vec_init_1): Likewise.
1042         (cxx_eval_store_expression): Likewise.
1043         (cxx_eval_constant_expression): Likewise.
1044
1045 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
1046
1047         PR c/70436
1048         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1049         potentially generating a future -Wparentheses warning in its
1050         callers.
1051
1052 2016-04-06  Jason Merrill  <jason@redhat.com>
1053
1054         * class.c (check_abi_tags): Fix function template handling.
1055
1056 2016-04-05  Nathan Sidwell  <nathan@acm.org>
1057
1058         PR c++/70512
1059         * class.c (fixup_may_alias): New.
1060         (fixup_attribute_variants): Call it.
1061
1062 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1063
1064         PR c++/70452
1065         * constexpr.c (struct fundef_copy): New struct.
1066         (struct fundef_copies_table_t): New struct.
1067         (fundef_copies_table): New static variable.
1068         (maybe_initialize_fundef_copies_table): New static function.
1069         (get_fundef_copy): New static function.
1070         (save_fundef_copy): New static function.
1071         (cxx_eval_call_expression): Use get_fundef_copy, and
1072         save_fundef_copy.
1073         (constexpr_call_table): Add "deletable" GTY marker.
1074
1075 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1076
1077         PR c++/70452
1078         * cp-tree.h (class cache_map): Remove.
1079         * constexpr.c (cv_cache): Change type to
1080         GTY((deletable)) hash_map<tree, tree> *.
1081         (maybe_constant_value): Adjust following the change to cv_cache.
1082         (clear_cv_cache): New static function.
1083         (clear_cv_and_fold_caches): Use it.
1084         * cp-gimplify.c (fold_cache): Change type to
1085         GTY((deletable)) hash_map<tree, tree> *.
1086         (clear_fold_cache): Adjust following the change to fold_cache.
1087         (cp_fold): Likewise.
1088
1089 2016-04-02  Martin Sebor  <msebor@redhat.com>
1090
1091         PR c++/67376
1092         PR c++/70170
1093         PR c++/70172
1094         PR c++/70228
1095         * constexpr.c (diag_array_subscript): New function.
1096         (cxx_eval_array_reference): Detect out of bounds array indices.
1097
1098 2016-04-01  Jason Merrill  <jason@redhat.com>
1099
1100         PR c++/70449
1101         PR c++/70344
1102         * pt.c (instantiate_decl): A function isn't fully defined if
1103         DECL_INITIAL is error_mark_node.
1104         * constexpr.c (cxx_eval_call_expression): Likewise.
1105
1106 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
1107             Marek Polacek  <polacek@redhat.com>
1108
1109         PR c++/70488
1110         * init.c (warn_placement_new_too_small): Test whether
1111         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
1112
1113 2016-04-01  Nathan Sidwell  <nathan@acm.org>
1114
1115         PR c++/68475
1116         * decl.c (check_redeclaration_exception_specification): Check
1117         regardless of -fno-exceptions.
1118         * typeck2.c (merge_exception_specifiers): Relax assert by checking
1119         flag_exceptions too.
1120
1121 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1122
1123         * decl.c (start_preparsed_function): Remove unnecessary bracing.
1124         (finish_destructor_body): Don't emit operator delete here.
1125
1126 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1127
1128         PR c++/70393
1129         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
1130         elements in field order.
1131
1132 2016-03-31  Marek Polacek  <polacek@redhat.com>
1133
1134         PR c/70297
1135         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1136
1137 2016-03-31  Richard Biener  <rguenther@suse.de>
1138
1139         PR c++/70430
1140         * typeck.c (cp_build_binary_op): Fix operand order of vector
1141         conditional in truth op handling.
1142
1143 2016-03-29  Jason Merrill  <jason@redhat.com>
1144
1145         PR c++/70353
1146         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1147         in constexpr functions.
1148
1149 2016-03-28  Jason Merrill  <jason@redhat.com>
1150
1151         PR c++/70422
1152         PR c++/64266
1153         PR c++/70353
1154         * decl.c, pt.c, constexpr.c: Revert last patch.
1155
1156 2016-03-25  Jason Merrill  <jason@redhat.com>
1157             Martin LiÅ¡ka  <mliska@suse.cz>
1158
1159         PR c++/64266
1160         PR c++/70353
1161         Core issue 1962
1162         * decl.c (cp_fname_init): Decay the initializer to pointer.
1163         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
1164         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1165         Don't call cp_finish_decl.
1166         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
1167         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
1168         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
1169         Handle DECL_VALUE_EXPR.
1170
1171 2016-03-24  Jason Merrill  <jason@redhat.com>
1172
1173         PR c++/70386
1174         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1175
1176         PR c++/70323
1177         * constexpr.c (cxx_eval_call_expression): Don't cache result if
1178         *overflow_p.
1179
1180 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
1181
1182         PR c++/62212
1183         * tree.c (build_cplus_array_type): Determine type-dependentess
1184         with uses_template_parms instead of with dependent_type_p.
1185
1186 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1187
1188         PR c++/70347
1189         * typeck.c (process_init_constructor_union): If the initializer
1190         is empty, use the union's NSDMI if it has one.
1191
1192 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1193
1194         PR c++/70332
1195         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1196         NSDMI that's part of an aggregrate initialization.
1197
1198 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
1199
1200         PR c++/70001
1201         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1202         for 1..max even for multi-dimensional arrays.  Call unshare_expr
1203         on it.
1204
1205         PR c++/70323
1206         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1207         on TREE_OVERFLOW constants.
1208
1209         PR c++/70376
1210         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
1211         for OMP_TASKLOOP here.
1212         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
1213         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
1214
1215 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
1216             Jason Merrill  <jason@redhat.com>
1217             Jakub Jelinek  <jakub@redhat.com>
1218
1219         PR c++/69315
1220         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1221         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1222         (finish_function): Don't set or test them.
1223         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
1224
1225 2016-03-23  Jason Merrill  <jason@redhat.com>
1226
1227         PR c++/70344
1228         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1229
1230 2016-03-23  Marek Polacek  <polacek@redhat.com>
1231
1232         PR c++/69884
1233         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1234
1235 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
1236
1237         * call.c (build_conditional_expr_1): Always use original
1238         condition type for vector type checks and build.
1239
1240 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1241
1242         PR c++/70096
1243         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1244
1245 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1246
1247         PR c++/70204
1248         * constexpr.c (non_const_var_error): Check
1249         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1250
1251 2016-03-21  Richard Henderson  <rth@redhat.com>
1252
1253         PR c++/70273
1254         * decl.c (notice_forced_label_r): New.
1255         (cp_finish_decl): Use it.
1256
1257 2016-03-21  Jason Merrill  <jason@redhat.com>
1258
1259         PR c++/70285
1260         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1261
1262 2016-03-18  Jason Merrill  <jason@redhat.com>
1263
1264         PR c++/70139
1265         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1266
1267         PR c++/70147
1268         * class.c (vptr_via_virtual_p): New.
1269         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1270         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1271         a vptr from any virtual base in a not-in-charge 'structor.
1272
1273         * decl.c (build_clobber_this): Factor out of
1274         start_preparsed_function and begin_destructor_body.  Handle
1275         virtual bases better.
1276
1277         * class.c (build_if_in_charge): Split out from build_base_path.
1278         * init.c (expand_virtual_init, expand_default_init): Use it.
1279         * call.c (build_special_member_call): Use it.
1280
1281 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1282
1283         PR c++/70267
1284         * init.c (build_new_1): Complain and return error_mark_node
1285         if alloc_fn is not _Jv_AllocObject function returning pointer.
1286
1287 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1288
1289         PR c++/70205
1290         * search.c (adjust_result_of_qualified_name_lookup): Don't
1291         update the BASELINK_BINFO of DECL if the second call
1292         to lookup_base fails.
1293
1294 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1295
1296         PR c++/70218
1297         * parser.c (cp_parser_lambda_expression): Move call to
1298         pop_deferring_access_checks ahead of the call to
1299         cp_parser_end_tentative_firewall.
1300
1301 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1302
1303         PR c++/70144
1304         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1305         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1306         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1307         varargs.
1308         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1309         if magic_varargs_p == 1, call decay_conversion
1310         instead of mark_type_use.  Don't store error_mark_node arguments to
1311         argarray, instead return error_mark_node.
1312
1313         PR c++/70272
1314         * decl.c (begin_destructor_body): Don't insert clobber if
1315         is_empty_class (current_class_type).
1316
1317 2016-03-17  Marek Polacek  <polacek@redhat.com>
1318
1319         PR c++/70194
1320         * typeck.c (warn_for_null_address): New function.
1321         (cp_build_binary_op): Call it.
1322
1323 2016-03-16  Jason Merrill  <jason@redhat.com>
1324
1325         PR c++/70259
1326         * decl.c (start_preparsed_function): Don't clobber an empty base.
1327
1328 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1329
1330         PR c++/70147
1331         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1332         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1333
1334         PR c++/70147
1335         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1336         set in_base_initializer.
1337
1338 2016-03-15  Marek Polacek  <polacek@redhat.com>
1339
1340         PR c++/70209
1341         * tree.c (strip_typedefs): Call strip_typedefs again on the
1342         DECL_ORIGINAL_TYPE result.
1343
1344 2016-03-15  Jason Merrill  <jason@redhat.com>
1345
1346         PR c++/70095
1347         * pt.c (instantiate_decl): Fix call to variable_template_p.
1348
1349         PR c++/70141
1350         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1351
1352 2016-03-14  Casey Carter  <casey@carter.net>
1353             Jason Merrill  <jason@redhat.com>
1354
1355         P0184R0: Generalizing the Range-Based For Loop
1356         * parser.c (cp_convert_range_for): Set the type of __end separately.
1357         (cp_parser_perform_range_for_lookup): Allow different begin/end
1358         types if they are comparable.
1359
1360 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1361
1362         PR c++/70106
1363         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1364         processing_template_decl and EXPR is a SCOPE_REF.
1365
1366 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1367             Jakub Jelinek  <jakub@redhat.com>
1368
1369         PR c++/70001
1370         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1371         return value from cxx_eval_constant_expression from earlier
1372         elements if it is valid constant initializer requiring no
1373         relocations.
1374
1375 2016-03-10  Marek Polacek  <polacek@redhat.com>
1376
1377         PR c++/70153
1378         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1379
1380 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1381
1382         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1383         when calling c_finish_omp_clauses.
1384
1385 2016-03-08  Jason Merrill  <jason@redhat.com>
1386
1387         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1388         diagnostic for use of "concept".
1389         (cp_parser_requires_clause_opt): And "requires".
1390         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1391         (cp_parser_explicit_template_declaration): Adjust.
1392         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1393
1394         P0036R0: Unary Folds and Empty Parameter Packs
1395         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1396
1397 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1398
1399         PR c++/70135
1400         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1401         even after the last iteration of the loop.
1402
1403         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1404
1405 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1406
1407         PR c++/66786
1408         * pt.c (get_template_info): Handle PARM_DECL.
1409         (template_class_depth): Check DECL_P instead of
1410         VAR_OR_FUNCTION_DECL_P.
1411
1412 2016-03-05  Jason Merrill  <jason@redhat.com>
1413
1414         PR c++/67364
1415         * constexpr.c (cxx_eval_store_expression): Replace
1416         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1417
1418 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1419
1420         PR c++/66786
1421         * pt.c (template_class_depth): Given a lambda type, iterate
1422         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1423         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1424         CP_DECL_CONTEXT.
1425
1426 2016-03-04  Jason Merrill  <jason@redhat.com>
1427
1428         PR c++/69203
1429         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1430         * init.c (build_vec_delete_1): Set it.
1431         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1432
1433 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1434
1435         * decl.c (start_preparsed_function): Don't emit start clobber at the
1436         start of constructor clones.
1437
1438         PR c++/70035
1439         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1440         * decl.c (start_preparsed_function): Call
1441         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1442         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1443         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1444
1445 2016-03-04  Jason Merrill  <jason@redhat.com>
1446
1447         PR c++/67364
1448         * constexpr.c (cxx_eval_component_reference): Further tweak.
1449
1450         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1451         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1452         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1453         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1454
1455         PR c++/70067
1456         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1457         same type.
1458
1459 2016-03-03  Jason Merrill  <jason@redhat.com>
1460
1461         * method.c (synthesized_method_walk): operator= can also be constexpr.
1462
1463         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1464         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1465
1466         PR c++/67164
1467         * pt.c (copy_template_args): New.
1468         (tsubst_pack_expansion): Use it.
1469
1470         * call.c (build_aggr_conv): Use get_nsdmi.
1471
1472         PR c++/51406
1473         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1474
1475         PR c++/67364
1476         * constexpr.c (cxx_eval_component_reference): Just return an empty
1477         CONSTRUCTOR for an empty class.
1478
1479 2016-03-01  Jason Merrill  <jason@redhat.com>
1480
1481         PR c++/70036
1482         * parser.c (cp_parser_requires_clause): Call
1483         check_for_bare_parameter_packs.
1484
1485         PR c++/51489
1486         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1487         the operands.
1488
1489         PR c++/69995
1490         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1491         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1492         [TARGET_EXPR]: Unshare init.
1493
1494 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1495
1496         PR c++/68948
1497         PR c++/69961
1498         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1499         constructor call.
1500
1501 2016-02-28  Jason Merrill  <jason@redhat.com>
1502
1503         PR c++/69995
1504         * constexpr.c (cxx_eval_store_expression): Unshare init.
1505
1506 2016-02-26  Jason Merrill  <jason@redhat.com>
1507
1508         PR c++/69958
1509         * pt.c (make_argument_pack): New.
1510         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1511         (tsubst_copy_and_build): Likewise.
1512
1513 2016-02-25  Jason Merrill  <jason@redhat.com>
1514
1515         PR c++/69889
1516         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1517         * tree.c (build_aggr_init_expr): Set it.
1518         * semantics.c (simplify_aggr_init_expr): Check it.
1519         * cp-gimplify.c (cp_genericize_r): Don't walk into
1520         a call/aggr_init from a thunk.
1521
1522         PR c++/69842
1523         * method.c (forward_parm): Handle parameter packs.
1524         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1525
1526         PR c++/67364
1527         * constexpr.c (cxx_eval_component_reference): Don't complain about
1528         unevaluated empty classes.
1529
1530         PR c++/68049
1531         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1532
1533 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1534
1535         PR c++/69736
1536         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1537         (maybe_undo_parenthesized_ref): Declare.
1538         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1539         check_return_expr.
1540         (finish_call_expr): Use it.
1541         * typeck.c (check_return_expr): Use it.
1542         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1543         REF_PARENTHESIZED_P flag.
1544
1545 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1546
1547         PR c++/69922
1548         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1549         Avoid folding it.
1550         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1551         tests.
1552         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1553         unless they are folded into INTEGER_CST, error_mark_node or some
1554         comparison with NULL, avoid folding them and use either the original
1555         comparison or non-folded comparison of folded arguments.
1556         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1557         comparison, don't fold the comparison right away.
1558
1559 2016-02-24  Jason Merrill  <jason@redhat.com>
1560
1561         PR c++/69323
1562         * friend.c (make_friend_class): Likewise.
1563         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1564
1565 2016-02-24  Jason Merrill  <jason@redhat.com>
1566
1567         PR c++/69323
1568         * pt.c (instantiate_class_template_1): Set
1569         processing_template_decl before substituting friend_type.
1570
1571 016-02-24  Martin Sebor  <msebor@redhat.com>
1572
1573         PR c++/69912
1574         * tree.c (build_ctor_subob_ref): Compare types' main variants
1575         instead of the types as they are.
1576
1577 2016-02-24  Jason Merrill  <jason@redhat.com>
1578
1579         * decl.c (start_preparsed_function): Condition ctor clobber on
1580         flag_lifetime_dse > 1.
1581
1582         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1583
1584 2016-02-19  Jason Merrill  <jason@redhat.com>
1585
1586         PR c++/69743
1587         * call.c (remaining_arguments): No longer static.
1588         * cp-tree.h: Declare it.
1589         * pt.c (more_specialized_fn): Use it.
1590
1591 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1592             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1593
1594         * Make-lang.in: Invoke gperf with -L C++.
1595         * cfns.gperf: Remove prototypes for hash and libc_name_p
1596         inlines.
1597         * cfns.h: Regenerated.
1598         * except.c (nothrow_libfn_p): Adjust.
1599
1600 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1601
1602         PR c++/69850
1603         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1604         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1605
1606 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1607
1608         PR c++/68948
1609         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1610         call here.
1611         * semantics.c (finish_call_expr): Don't assume a constructor
1612         call is dependent if only the "this" pointer is dependent.  When
1613         building a constructor call, always use a dummy object.
1614
1615 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1616
1617         PR c++/69850
1618         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1619         condition.
1620         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1621         operators if folding preserved the binop, just with different
1622         arguments.
1623
1624         PR c++/67767
1625         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1626         attr_spec is always single element chain, chain all the attributes
1627         properly together in the right order.
1628
1629 2016-02-18  Jason Merrill  <jason@redhat.com>
1630
1631         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1632         mangle_decl.
1633         (mangle_decl): Call maybe_check_abi_tags for function scope.
1634         (mangle_guard_variable): Call maybe_check_abi_tags here.
1635         (write_guarded_var_name): Not here.
1636
1637 2016-02-17  Jason Merrill  <jason@redhat.com>
1638
1639         PR c++/65985
1640         * constexpr.c (build_constexpr_constructor_member_initializers):
1641         Handle an additional STATEMENT_LIST.
1642
1643         PR c++/68585
1644         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1645
1646         PR c++/68679
1647         * decl2.c (reset_type_linkage_2): Look through member templates.
1648
1649 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1650
1651         PR c++/69850
1652         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1653
1654 2016-02-17  Jason Merrill  <jason@redhat.com>
1655
1656         PR c++/69842
1657         * method.c (forward_parm): Split out from...
1658         (add_one_base_init): ...here.
1659         * lambda.c (maybe_add_lambda_conv_op): Use it.
1660
1661 2016-02-16  Jason Merrill  <jason@redhat.com>
1662
1663         PR c++/10200
1664         PR c++/69753
1665         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1666         tree.c, typeck2.c: Revert earlier changes.
1667         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1668         non-type templates after -> or .
1669
1670 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1671
1672         PR c/69835
1673         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1674
1675 2016-02-16  Jason Merrill  <jason@redhat.com>
1676
1677         PR c++/69657
1678         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1679         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1680         * name-lookup.h: Adjust.
1681
1682 2016-02-16  James Norris  <jnorris@codesourcery.com>
1683
1684         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1685         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1686
1687 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1688
1689         PR c++/69658
1690         * init.c (expand_default_init): Only call reshape_init
1691         in the direct-initialization from an initializer list case.
1692
1693 2016-02-15  Jason Merrill  <jason@redhat.com>
1694
1695         PR c++/69753
1696         * semantics.c (finish_call_expr): Implicit 'this' does not make
1697         the call dependent.
1698         * search.c (any_dependent_bases_p): Split out...
1699         * name-lookup.c (do_class_using_decl): ...from here.
1700         * call.c (build_new_method_call_1): Don't complain about missing object
1701         if there are dependent bases.  Tweak error.
1702         * tree.c (non_static_member_function_p): Remove.
1703         * pt.c (type_dependent_expression_p): A member template of a
1704         dependent type is dependent.
1705         * cp-tree.h: Adjust.
1706
1707         PR c++/68890
1708         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1709
1710 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1711
1712         PR c++/69098
1713         * pt.c (lookup_and_finish_template_variable): New function,
1714         extracted from ...
1715         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1716         (tsubst_qualified_id): Consider that EXPR might be a variable
1717         template.
1718         * typeck.c (check_template_keyword): Don't emit an error
1719         if DECL is a variable template.
1720
1721 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1722
1723         * error.c: Spelling fixes - behaviour -> behavior and
1724         neighbour -> neighbor.
1725         * decl.c: Likewise.
1726         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1727         diagnostics.
1728         * init.c (build_delete): Likewise.
1729
1730 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1731
1732         PR c/69768
1733         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1734         arguments for -Waddress warning.  Fix up formatting.
1735
1736 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1737
1738         PR c++/68726
1739         * pt.c (lookup_template_class_1): Check tsubst return value for
1740         error_mark_node.
1741
1742 2016-02-10  Jason Merrill  <jason@redhat.com>
1743
1744         PR c++/68926
1745         * pt.c (resolve_nondeduced_context): Add complain parm.
1746         (do_auto_deduction): Pass it.
1747         * cvt.c (convert_to_void): Likewise.
1748         * decl.c (cp_finish_decl): Likewise.
1749         * init.c (build_new): Likewise.
1750         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1751         * semantics.c (finish_decltype_type): Likewise.
1752         * typeck.c (decay_conversion): Likewise.
1753         * cp-tree.h: Adjust declaration.
1754         * call.c (standard_conversion): Add complain parm, pass it along.
1755         (implicit_conversion): Pass it.
1756
1757         PR c++/69657
1758         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1759         (lookup_name_real_1): Likewise.
1760         (remove_hidden_names): Handle non-functions too.
1761
1762         PR c++/10200
1763         * parser.c (cp_parser_lookup_name): When looking for a template
1764         after . or ->, only consider class templates.
1765         (cp_parser_postfix_dot_deref_expression): Handle the current
1766         instantiation.  Remember a dependent object expression.
1767         * typeck2.c (build_x_arrow): Handle the current instantiation.
1768
1769         * ptree.c (debug_tree): Implement for cp_expr.
1770
1771 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1772
1773         PR c++/69139
1774         * parser.c (cp_parser_simple_type_specifier): Make the check
1775         for disambiguating between an 'auto' placeholder and an implicit
1776         template parameter more robust.
1777
1778 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1779
1780         PR c++/69283
1781         PR c++/67835
1782         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1783         setting its TREE_USED flag.
1784
1785 2016-02-08  Jason Merrill  <jason@redhat.com>
1786
1787         PR c++/69657
1788         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1789         built-ins alone.
1790
1791 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1792
1793         PR c++/59627
1794         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1795         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1796
1797 2016-02-08  Marek Polacek  <polacek@redhat.com>
1798
1799         PR c++/69688
1800         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1801         Call clear_fold_cache.
1802         * cp-tree.h: Adjust declaration.
1803         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1804         rather than clear_cv_cache and clear_fold_cache.
1805         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1806
1807 2016-02-08  Jason Merrill  <jason@redhat.com>
1808
1809         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1810         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1811         (ocp_convert): Use *_maybe_fold.
1812         (cp_convert_to_pointer): Add dofold parameter.
1813         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1814
1815 2016-02-05  Martin Sebor  <msebor@redhat.com>
1816
1817         PR c++/69662
1818         * init.c (find_field_init): New function.
1819         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1820         at ends of structures special.
1821
1822 2016-02-05  Jason Merrill  <jason@redhat.com>
1823
1824         PR c++/68948
1825         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1826         make sure we've seen_error().
1827
1828 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1829
1830         PR c++/68948
1831         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1832         if lookup_fnfields returns NULL_TREE and the name being looked
1833         up has the form A::A.
1834
1835 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1836
1837         * constexpr.c (cxx_eval_binary_expression): Fold equality
1838         comparisons involving PTRMEM_CSTs.
1839
1840 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1841
1842         * class.c (find_flexarrays): Don't declare dom variable.
1843         (diagnose_flexarray): Likewise.
1844
1845 2016-02-02  Martain Sebor  <msebor@redhat.com>
1846
1847         PR c++/69251
1848         PR c++/69253
1849         PR c++/69290
1850         PR c++/69277
1851         PR c++/69349
1852         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1853         of a flexible array member for equality to null.
1854         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1855         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1856         (check_flexarrays): Same.
1857         * decl.c (compute_array_index_type): Avoid special case for flexible
1858         array members.
1859         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1860         array members.
1861         * error.c (dump_type_suffix): Revert changes introduced in r231665
1862         and rendered unnecessary by the changes above.
1863         * pt.c (tsubst):  Same.
1864         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1865         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1866         (process_init_constructor_array): Same.
1867         (process_init_constructor_record): Same.
1868
1869 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1870
1871         PR c++/69056
1872         * pt.c (try_one_overload): Handle comparing argument packs so
1873         that there is no conflict if we deduced more arguments of an
1874         argument pack than were explicitly specified.
1875
1876 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1877             Jason Merrill  <jason@redhat.com>
1878
1879         PR c++/68763
1880         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1881         function type if nothing is changing.
1882
1883 2016-01-31  Jason Merrill  <jason@redhat.com>
1884
1885         PR c++/69009
1886         * pt.c (partial_specialization_p, impartial_args): New.
1887         (instantiate_decl): Call impartial_args.
1888
1889         * mangle.c (maybe_check_abi_tags): New.
1890         (write_guarded_var_name): Call it.
1891         (mangle_ref_init_variable): Call check_abi_tags.
1892
1893         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1894         between template and instantiation.
1895
1896 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1897
1898         PR debug/66869
1899         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1900         function declarations.
1901
1902 2016-01-29  Marek Polacek  <polacek@redhat.com>
1903
1904         PR c++/69509
1905         PR c++/69516
1906         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1907         out of bound" error earlier.
1908         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1909         commentary.
1910
1911 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1912
1913         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1914         structure, update free_binding_level before the structure's
1915         level_chain field gets cleared, not after.
1916
1917 2016-01-28  Jason Merrill  <jason@redhat.com>
1918
1919         PR c++/67407
1920         * search.c (dfs_walk_once, dfs_walk_once_r)
1921         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1922         hash_set instead of BINFO_MARKED.
1923         (dfs_unmark_r): Remove.
1924
1925 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1926
1927         PR c++/24208
1928         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1929         (cp_lexer_debugging_p): Use it.
1930         (cp_lexer_start_debugging): Likewise.
1931         (cp_lexer_stop_debugging): Likewise.
1932
1933 2016-01-27  Marek Polacek  <polacek@redhat.com>
1934
1935         PR c/68062
1936         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1937         needed.  Add -Wsign-compare warning.
1938
1939 2016-01-27  Ryan Burn  <contact@rnburn.com>
1940
1941         PR cilkplus/69267
1942         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1943         superfluous post_p argument in call to
1944         cilk_gimplify_call_params_in_spawned_fn.
1945
1946 2016-01-27  Marek Polacek  <polacek@redhat.com>
1947
1948         PR c++/69379
1949         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1950         wrapped in NOP_EXPRs.
1951
1952 2016-01-27  Martin Sebor  <msebor@redhat.com>
1953
1954         PR c++/69317
1955         * mangle.c (mangle_decl): Reference the correct (saved) version
1956         of the ABI in -Wabi diagnostics.
1957
1958 2016-01-27  Marek Polacek  <polacek@redhat.com>
1959
1960         PR c++/69496
1961         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1962         elements of the array.
1963
1964 2016-01-26  Jason Merrill  <jason@redhat.com>
1965
1966         PR c++/68949
1967         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1968         (cxx_eval_call_expression): Don't look through clones.
1969         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1970         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1971         maybe-in-charge *tor.
1972
1973 2016-01-26  Jason Merrill  <jason@redhat.com>
1974
1975         PR c++/68782
1976         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1977         and TREE_SIDE_EFFECTS.
1978         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1979         verify_constructor_flags.
1980
1981 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1982
1983         PR c++/68357
1984         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1985         return error_mark_node instead of building trees with error_mark_node
1986         operands.
1987
1988 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1989
1990         PR other/69006
1991         * error.c (print_instantiation_partial_context_line): Add missing
1992         newlines from output for the t == NULL case.
1993         (print_instantiation_partial_context): Remove call to pp_newline.
1994
1995 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1996
1997         Revert:
1998         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1999
2000         PR c++/11858
2001         PR c++/24663
2002         PR c++/24664
2003         * decl.c (grokdeclarator): Don't decay array parameter type to
2004         a pointer type if it's dependent.
2005         (grokparms): Invoke strip_top_quals instead of directly invoking
2006         cp_build_qualified_type.
2007         * pt.c (decay_dependent_array_parm_type): New static function.
2008         (type_unification_real): Call decay_dependent_array_parm_type
2009         to decay a dependent array parameter type to its corresponding
2010         pointer type before unification.
2011         (more_specialized_fn): Likewise.
2012         (get_bindings): Likewise.
2013         * tree.c (cp_build_qualified_type): Trivial typofix in
2014         documentation.
2015
2016 2016-01-23  Martin Sebor  <msebor@redhat.com>
2017
2018         PR c++/58109
2019         PR c++/69022
2020         * decl2.c (is_late_template_attribute): Handle dependent argument
2021         to attribute align and attribute vector_size.
2022
2023 2016-01-21  Jason Merrill  <jason@redhat.com>
2024
2025         PR c++/69392
2026         * lambda.c (lambda_capture_field_type): Handle 'this' specially
2027         for init-capture, too.
2028
2029         PR c++/65687
2030         * decl.c (type_is_deprecated): Don't look into a typedef.
2031
2032         PR c++/40751
2033         PR c++/64987
2034         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2035
2036         PR c++/43407
2037         * decl.c (start_enum): Add attributes parameter.
2038         * parser.c (cp_parser_enum_specifier): Pass it.
2039         * pt.c (lookup_template_class_1): Pass it.
2040         * cp-tree.h: Adjust.
2041
2042 2016-01-19  Jason Merrill  <jason@redhat.com>
2043
2044         PR c++/59759
2045         * pt.c (convert_template_argument): Handle VAR_DECL properly.
2046
2047 2016-01-19  Marek Polacek  <polacek@redhat.com>
2048
2049         PR c++/68586
2050         * constexpr.c (clear_cv_cache): New.
2051         * cp-gimplify.c (clear_fold_cache): New.
2052         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2053         * decl.c (finish_enum_value_list): Call them.
2054
2055         PR c++/68965
2056         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2057
2058 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
2059
2060         PR c++/11858
2061         PR c++/24663
2062         PR c++/24664
2063         * decl.c (grokdeclarator): Don't decay array parameter type to
2064         a pointer type if it's dependent.
2065         (grokparms): Invoke strip_top_quals instead of directly invoking
2066         cp_build_qualified_type.
2067         * pt.c (decay_dependent_array_parm_type): New static function.
2068         (type_unification_real): Call decay_dependent_array_parm_type
2069         to decay a dependent array parameter type to its corresponding
2070         pointer type before unification.
2071         (more_specialized_fn): Likewise.
2072         (get_bindings): Likewise.
2073         * tree.c (cp_build_qualified_type): Trivial typofix in
2074         documentation.
2075
2076 2016-01-18  Jason Merrill  <jason@redhat.com>
2077
2078         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2079
2080         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2081
2082         PR c++/68767
2083         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
2084         (contains_label_1, contains_label_p): Remove.
2085
2086 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2087
2088         PR c++/69091
2089         * pt.c (type_dependent_expression_p): For a function template
2090         specialization, a type is dependent iff any of its template
2091         arguments are.
2092
2093 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2094
2095         * cp-array-notation.c (cp_expand_cond_array_notations): Return
2096         error_mark_node only if find_rank failed, not if it was
2097         successful.
2098
2099 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2100
2101         PR c++/68936
2102         * tree.c (build_min_non_dep_call_vec): Don't retain the
2103         KOENIG_LOOKUP_P flag of the non-dependent expression that's
2104         been built.
2105         (build_min_non_dep_op_overload): Instead, do it here.
2106
2107 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
2108
2109         PR bootstrap/68271
2110         * parser.h (cp_token): Remove pragma_kind field.  Add comment
2111         with number of unused bits.
2112         * parser.c (eof_token): Remove pragma_kind field initializer.
2113         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
2114         field, don't clear CPP_PRAGMA u.value.
2115         (cp_parser_pragma_kind): New function.
2116         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
2117         cp_parser_omp_construct, cp_parser_initial_pragma,
2118         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
2119         pragma_kind field.
2120
2121 2016-01-15  Jason Merrill  <jason@redhat.com>
2122
2123         PR c++/68847
2124         * call.c (build_cxx_call): Use fold_non_dependent_expr.
2125
2126         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
2127         value.
2128
2129         PR c++/69257
2130         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
2131         array/function-to-pointer conversion.  Call
2132         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
2133         * call.c (convert_like_real): Print call context if
2134         decay_conversion errors.
2135
2136 2016-01-14  Tom de Vries  <tom@codesourcery.com>
2137
2138         PR tree-optimization/68773
2139         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
2140         set force_output.
2141
2142 2016-01-14  Jason Merrill  <jason@redhat.com>
2143
2144         PR c++/69261
2145         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2146
2147 2016-01-12  Marek Polacek  <polacek@redhat.com>
2148
2149         PR c++/68979
2150         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2151         error_at and adjust the return value.
2152
2153 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
2154
2155         PR objc++/68511
2156         PR c++/69213
2157         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
2158         GS_ERROR whenever seen_error (), only if *expr_p contains
2159         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
2160
2161         PR c++/66808
2162         PR c++/69000
2163         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2164
2165 2016-01-11  Jason Merrill  <jason@redhat.com>
2166
2167         PR c++/69131
2168         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
2169         (process_subob_fn): Likewise.  Don't consider triviality if true.
2170         (synthesize_method_walk): Pass it.
2171
2172 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
2173
2174         PR c++/68795
2175         * parser.c (cp_parser_postfix_expression): Initialize
2176         close_paren_loc to UNKNOWN_LOCATION; only use it if
2177         it has been written to by
2178         cp_parser_parenthesized_expression_list.
2179         (cp_parser_parenthesized_expression_list): Document the behavior
2180         with respect to the CLOSE_PAREN_LOC param.
2181
2182 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
2183
2184         PR c++/69211
2185         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
2186         folded operands have side-effects, but folding changed any of them,
2187         build a new tree with the folded operands instead of returning the
2188         unfolded tree.
2189
2190 2016-01-09  Marek Polacek  <polacek@redhat.com>
2191
2192         PR c++/69113
2193         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2194
2195 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
2196
2197         PR c++/69164
2198         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2199
2200 2016-01-08  Jason Merrill  <jason@redhat.com>
2201
2202         PR c++/69158
2203         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2204         in completion.
2205
2206 2016-01-08  Marek Polacek  <polacek@redhat.com>
2207
2208         PR c++/68449
2209         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2210
2211 2016-01-08  Jason Merrill  <jason@redhat.com>
2212
2213         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2214         workaround.
2215
2216         PR c++/68983
2217         PR c++/67557
2218         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2219         TREE_ADDRESSABLE type.
2220
2221         PR c++/68983
2222         PR c++/67557
2223         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2224
2225 2016-01-05  Nathan Sidwell  <nathan@acm.org>
2226
2227         PR c++/58583
2228         * pt.c (build_non_dependent_expr): Don't try a checking fold when
2229         parsing an nsdmi.
2230
2231 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
2232
2233         Update copyright years.
2234 \f
2235 Copyright (C) 2016 Free Software Foundation, Inc.
2236
2237 Copying and distribution of this file, with or without modification,
2238 are permitted in any medium without royalty provided the copyright
2239 notice and this notice are preserved.