e53e00d088bb889d17629aa240e6549df564dd66
[gcc.git] / gcc / cp / ChangeLog
1 2015-08-04 Jason Merrill <jason@redhat.com>
2
3 * tree.c (build_target_expr): Copy the location from value.
4
5 2015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
6
7 * parser.c (cp_parser_selection_statement): Move handling of
8 semicolon body to ...
9 (cp_parser_implicitly_scoped_statement): .. here. Call
10 warn_for_misleading_indentation even when the body is a
11 semicolon. Extract token_indent_infos corresponding to the
12 guard, body and next tokens. Adjust call to
13 warn_for_misleading_indentation accordingly. Take
14 token_indent_info argument.
15 (cp_parser_already_scoped_statement): Likewise.
16 (cp_parser_selection_statement, cp_parser_iteration_statement):
17 Extract a token_indent_info corresponding to the guard token.
18
19 2015-08-01 Caroline Tice <cmtice@google.com>
20
21 PR 66521
22 * mangle.c : Add vtable-verify.h to include files.
23 (get_mangled_vtable_map_var_name): If the DECL_ASSEMBLER_NAME
24 is "<anon>" get the real mangled name for the class instead, and
25 also store the real mangled name in a vector for use later.
26
27 2015-07-31 Marek Polacek <polacek@redhat.com>
28
29 PR sanitizer/66977
30 * typeck.c (get_member_function_from_ptrfunc): Don't sanitize
31 RSHIFT_EXPR.
32
33 2015-07-30 Paolo Carlini <paolo.carlini@oracle.com>
34
35 * class.c (check_for_override): Use DECL_SOURCE_LOCATION and "%qD"
36 in warning_at instead of "%q+D" in warning.
37 (warn_hidden): Likewise but use location_of.
38 (finish_struct_anon_r): Likewise use DECL_SOURCE_LOCATION in permerror.
39 (check_bitfield_decl, check_field_decls): Likewise in warning_at.
40 (check_field_decls): Likewise for permerror.
41 (explain_non_literal_class): Likewise for inform.
42 (check_bases_and_members, layout_class_type): Likewise for warning_at.
43 (note_name_declared_in_class): Use location_of in permerror.
44 * name-lookup.c (diagnose_name_conflict): Use location_of in inform.
45 (pushdecl_maybe_friend_1): Use DECL_SOURCE_LOCATION in pedwarn,
46 inform, and warning_at.
47 (check_for_out_of_scope_variable): Likewise for warning_at and
48 permerror.
49
50 2015-07-30 Jason Merrill <jason@redhat.com>
51
52 DR 1558
53 PR c++/67021
54 * pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.
55
56 2015-07-28 Paolo Carlini <paolo.carlini@oracle.com>
57
58 * call.c (build_op_delete_call, convert_like_real, build_over_call):
59 Use Use DECL_SOURCE_LOCATION and "%qD" in inform and pedwarn instead
60 of "%q+D".
61 * constexpr.c (explain_invalid_constexpr_fn): Likewise.
62 * decl.c (duplicate_decls): Likewise for warning/warning_at.
63 * except.c (maybe_noexcept_warning): Likewise.
64 * friend.c (make_friend_class): Likewise for inform.
65 * mangle.c (mangle_decl): Likewise for warning/warning_at.
66 * method.c (process_subob_fn, walk_field_subobs,
67 maybe_explain_implicit_delete): Likewise for inform.
68 * parser.c (cp_parser_lambda_introducer): Likewise.
69 * pt.c (check_specialization_namespace,
70 maybe_process_partial_specialization): Likewise for permerror.
71 (redeclare_class_template): Likewise for inform_n.
72 (coerce_template_parms, tsubst_copy_and_build): Likewise for inform.
73 * search.c (check_final_overrider): Likewise.
74 * semantics.c (process_outer_var_ref): Likewise.
75
76 2015-07-27 Jason Merrill <jason@redhat.com>
77
78 * constexpr.c (cxx_eval_call_expression): Don't add this call to
79 the hash table if !depth_ok.
80
81 2015-07-27 Marek Polacek <polacek@redhat.com>
82
83 PR c++/66555
84 PR c/54979
85 * call.c (build_new_op_1): Call warn_tautological_cmp.
86 * pt.c (tsubst_copy_and_build): Use sentinel to suppress tautological
87 compare warnings.
88
89 2015-07-26 Patrick Palka <ppalka@gcc.gnu.org>
90
91 PR c++/18969
92 * typeck.c (check_return_expr): Also do the basic return-value
93 validity checking if processing_template_decl and yet types are
94 not dependent. Remove obsolete code.
95
96 2015-07-26 Paolo Carlini <paolo.carlini@oracle.com>
97
98 * decl.c (poplevel): Use Use DECL_SOURCE_LOCATION and "%qD"
99 in warning_at instead of "%q+D" in warning.
100 (warn_extern_redeclared_static): Likewise for inform.
101 (check_redeclaration_no_default_args): Likewise for permerror.
102 (duplicate_decls): Likewise.
103 (check_previous_goto_1): Likewise for inform.
104 (check_goto, start_decl, check_for_uninitialized_const_var,
105 start_preparsed_function, finish_function§): Likewise.
106 * decl2.c (build_anon_union_vars, c_parse_final_cleanups): Likewise.
107 * init.c (sort_mem_initializers): Likewise.
108 * typeck.c (convert_for_initialization): Likewise for inform.
109 (maybe_warn_about_returning_address_of_local): Likewise.
110 * typeck2.c (abstract_virtuals_error_sfinae): Likewise for inform.
111 (cxx_incomplete_type_diagnostic): Likewise for emit_diagnostic.
112
113 2015-07-25 Patrick Palka <ppalka@gcc.gnu.org>
114
115 PR c++/66857
116 * cvt.c (ocp_convert): Don't call scalar_constant_value when
117 converting to a class type.
118
119 2015-07-24 Jason Merrill <jason@redhat.com>
120
121 PR c++/64969
122 * pt.c (splice_late_return_type): Correct deduced return type for
123 abbreviated function template.
124
125 2015-07-24 Richard Biener <rguenther@suse.de>
126
127 * init.c (build_vec_init): Build iterator bound in the same
128 type as the iterator.
129
130 2015-07-23 Marek Polacek <polacek@redhat.com>
131
132 PR c++/66572
133 * pt.c (tsubst_copy_and_build): Add warn_logical_op sentinel.
134
135 2015-07-23 Paolo Carlini <paolo.carlini@oracle.com>
136
137 PR c++/52987
138 * parser.c (cp_parser_simple_declaration): Robustify check avoiding
139 redundant error messages.
140
141 2015-07-21 Paolo Carlini <paolo.carlini@oracle.com>
142
143 * decl.c (grokdeclarator): For an erroneous template parameter
144 propagate error_mark_node as type.
145
146 2015-07-20 Marek Polacek <polacek@redhat.com>
147
148 PR c++/55095
149 * typeck.c (cp_build_binary_op): Warn about left shift overflows.
150
151 2015-07-15 Jason Merrill <jason@redhat.com>
152
153 PR c++/65091
154 * parser.c (cp_parser_unqualified_id): Don't accept ~x in a
155 template if there is no type x in scope.
156
157 2015-07-14 Patrick Palka <ppalka@gcc.gnu.org>
158
159 PR c++/66850
160 * pt.c (redeclare_class_template): Set the DECL_CONTEXTs of each
161 template template parm in the redeclaration.
162 (lookup_template_class_1): Peel off irrelevant template levels
163 from current_template_parms before augmenting the argument
164 list.
165
166 2015-07-14 Andrea Azzarone <azzaronea@gmail.com>
167
168 PR c++/65071
169 * parser.c (cp_parser_sizeof_pack): Also consider template template
170 parameters.
171
172 2015-07-14 Jason Merrill <jason@redhat.com>
173
174 * call.c (build_new_method_call_1): Call reshape_init.
175
176 2015-07-14 Paolo Carlini <paolo.carlini@oracle.com>
177
178 * pt.c (check_template_shadow): Emit error + inform instead of
179 two errors.
180
181 2015-07-13 Patrick Palka <ppalka@gcc.gnu.org>
182
183 PR c++/65186
184 * pt.c (invalid_nontype_parm_type_p): Accept a bound template
185 template parm type under C++11 and later.
186
187 2015-07-12 Aldy Hernandez <aldyh@redhat.com>
188
189 * call.c: Fix double word typos.
190 * cp-array-notation.c: Same.
191 * cp-tree.h: Same.
192 * init.c: Same.
193 * name-lookup.c: Same.
194 * parser.c: Same.
195
196 2015-07-10 Patrick Palka <ppalka@gcc.gnu.org>
197
198 PR c++/30044
199 * pt.c (begin_template_parm_list): Add a dummy parameter level
200 to current_template_parms.
201 (end_template_parm_list): Remove the dummy parameter level
202 before adding the real one.
203 (tsubst): Don't attempt to substitute for template parameters
204 corresponding to a dummy argument level.
205 (template_parms_to_args): Remove obsolete hack for
206 giving template template arguments the proper level.
207 (splite_late_return_type): Remove obsolete hack for giving
208 template template arguments the proper level.
209 * error.c (dump_template_decl): Don't print dummy template
210 levels.
211
212 2015-07-10 Paolo Carlini <paolo.carlini@oracle.com>
213
214 PR c++/54521
215 * call.c (convert_like_real): Do not set LOOKUP_ONLYCONVERTING for
216 the second step of copy-initialization.
217
218 2015-07-10 Jason Merrill <jason@redhat.com>
219
220 * pt.c (find_parameter_packs_r): Handle variable templates.
221 (variable_template_specialization_p): New.
222 * cp-tree.h: Declare it.
223
224 * parser.c (cp_parser_template_id): SET_EXPR_LOCATION.
225
226 2015-07-10 Eric Botcazou <ebotcazou@adacore.com>
227
228 * decl2.c (cpp_check): Revert latest change.
229
230 2015-07-09 Jason Merrill <jason@redhat.com>
231
232 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Call
233 value_dependent_expression_p.
234
235 * cp-tree.h (struct cp_parameter_declarator): Rename ellipsis_p to
236 template_parameter_pack_p.
237 * parser.c (declarator_can_be_parameter_pack): False if
238 parameter_pack_p is set.
239 (make_parameter_declarator): Add template_parameter_pack_p parm.
240 (cp_parser_template_parameter): Remove parameter pack parsing.
241 (cp_parser_parameter_declaration): Handle all parameter packs.
242 Tweak default argument permerror.
243
244 2015-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
245
246 * parser.c (cp_parser_default_type_template_argument)
247 (cp_parser_default_template_template_argument): Factor out from
248 cp_parser_type_parameter.
249
250 2015-07-09 Paolo Carlini <paolo.carlini@oracle.com>
251
252 * typeck.c (warn_args_num): Rename to error_args_num.
253 (convert_arguments): Adjust calls.
254
255 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
256
257 * cp-ubsan.c: Don't include alloc-pool.h or lto-streamer.h.
258
259 2015-07-08 Eric Botcazou <ebotcazou@adacore.com>
260
261 * decl2.c (cpp_check): Deal with IS_CONSTEXPR.
262
263 2015-07-08 Jakub Jelinek <jakub@redhat.com>
264
265 * decl.c (grokfndecl): Handle flag_openmp_simd like flag_openmp.
266 * pt.c (apply_late_template_attributes): Likewise.
267
268 2015-07-08 Marek Polacek <polacek@redhat.com>
269
270 PR c++/66748
271 * tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before
272 accessing TYPE_LANG_SPECIFIC node.
273
274 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
275
276 * call.c: Adjust includes.
277 * class.c: Likewise.
278 * constexpr.c: Likewise.
279 * cp-array-notation.c: Likewise.
280 * cp-gimplify.c: Likewise.
281 * cp-lang.c: Likewise.
282 * cp-objcp-common.c: Likewise.
283 * cp-ubsan.c: Likewise.
284 * cvt.c: Likewise.
285 * decl.c: Likewise.
286 * decl2.c: Likewise.
287 * dump.c: Likewise.
288 * error.c: Likewise.
289 * except.c: Likewise.
290 * expr.c: Likewise.
291 * friend.c: Likewise.
292 * init.c: Likewise.
293 * lambda.c: Likewise.
294 * lex.c: Likewise.
295 * mangle.c: Likewise.
296 * method.c: Likewise.
297 * name-lookup.c: Likewise.
298 * optimize.c: Likewise.
299 * parser.c: Likewise.
300 * pt.c: Likewise.
301 * ptree.c: Likewise.
302 * repo.c: Likewise.
303 * rtti.c: Likewise.
304 * search.c: Likewise.
305 * semantics.c: Likewise.
306 * tree.c: Likewise.
307 * typeck.c: Likewise.
308 * typeck2.c: Likewise.
309
310 2015-07-07 Eric Botcazou <ebotcazou@adacore.com>
311
312 * decl2.c (cpp_check): Deal with IS_MOVE_CONSTRUCTOR.
313
314 2015-07-06 Jason Merrill <jason@redhat.com>
315
316 * pt.c (reduce_template_parm_level): Also build the TYPE_DECL
317 for a template template parameter.
318 (tsubst_decl) [TEMPLATE_DECL]: Use the TEMPLATE_DECL built
319 by reduce_template_parm_level.
320
321 * pt.c (argument_pack_element_is_expansion_p): A decl pack is an
322 expansion.
323
324 2015-07-02 Jason Merrill <jason@redhat.com>
325
326 PR c++/66743
327 * pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
328 TYPE_VALUES_RAW rather than TYPE_FIELDS.
329
330 2015-07-02 Andrew Sutton <andrew.n.sutton@gmail.com>
331
332 * pt.c (type_dependent_expression_p): Handle expressions
333 that refer to variable templates.
334
335 2015-07-01 Jason Merrill <jason@redhat.com>
336
337 * lex.c (init_reswords): s/CXX0X/CXX11/.
338 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
339
340 * mangle.c (write_CV_qualifiers_for_type, write_nested_name):
341 Attribute mangling is now -fabi-version=10.
342
343 PR c++/65945
344 * decl.c (cxx_init_decl_processing): Set TYPE_ALIGN of nullptr_t.
345 * class.c (layout_nonempty_base_or_field): Warn if that affects
346 the offset of a field.
347
348 2015-07-01 Paolo Carlini <paolo.carlini@oracle.com>
349
350 PR c++/60365
351 * parser.c (cp_parser_check_std_attribute): New.
352 (cp_parser_std_attribute_list): Call it.
353
354 2015-07-01 Patrick Palka <ppalka@gcc.gnu.org>
355
356 PR c++/66686
357 * pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
358 return 0 if tsubst returns a dependent type.
359
360 2015-06-30 Jason Merrill <jason@redhat.com>
361
362 PR debug/66653
363 * decl2.c (is_late_template_attribute): True for tls_model.
364
365 PR debug/66653
366 * cp-tree.h (CP_DECL_THREAD_LOCAL_P): New.
367 (DECL_GNU_TLS_P): Use DECL_LANG_SPECIFIC field.
368 (SET_DECL_GNU_TLS_P): New.
369 * call.c (make_temporary_var_for_ref_to_temp): Use
370 CP_DECL_THREAD_LOCAL_P.
371 (set_up_extended_ref_temp): Likewise.
372 * decl.c (duplicate_decls, expand_static_init): Likewise.
373 (redeclaration_error_message, grokvardecl): Likewise.
374 (start_decl, register_dtor_fn, grokdeclarator): Likewise.
375 * decl2.c (get_guard, var_needs_tls_wrapper): Likewise.
376 (handle_tls_init): Likewise.
377 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
378 * semantics.c (finish_id_expression): Likewise.
379 (handle_omp_array_sections_1, finish_omp_clauses): Likewise.
380 (finish_omp_threadprivate): Likewise.
381 * tree.c (decl_storage_duration): Likewise.
382 * cp-gimplify.c (omp_var_to_track): Likewise.
383 (cp_genericize_r): Check that it matches DECL_THREAD_LOCAL_P.
384 * lex.c (retrofit_lang_decl): Return if DECL_LANG_SPECIFIC is
385 already set.
386
387 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
388
389 Implement N4197 - Adding u8 character literals
390 * parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
391 and CPP_UTF8CHAR_USERDEF tokens;
392 (cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.
393
394 2015-06-29 Paolo Carlini <paolo.carlini@oracle.com>
395
396 PR c++/65977
397 * decl.c (grokfndecl): Allow constexpr declarations of friend
398 template specializations.
399
400 2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
401
402 PR fortran/66605
403 * decl.c (finish_function): Call do_warn_unused_parameter.
404
405 2015-06-29 Marek Polacek <polacek@redhat.com>
406
407 PR c/66322
408 * decl.c (struct cp_switch): Add OUTSIDE_RANGE_P.
409 (push_switch): Set OUTSIDE_RANGE_P.
410 (pop_switch): Update c_do_switch_warnings call.
411 (finish_case_label): Update c_add_case_label call.
412 * semantics.c (finish_switch_cond): Don't warn about -Wswitch-bool
413 here.
414
415 2015-06-27 Marek Polacek <polacek@redhat.com>
416
417 * call.c: Use VECTOR_TYPE_P.
418 * constexpr.c: Likewise.
419 * cvt.c: Likewise.
420 * decl.c: Likewise.
421 * decl2.c: Likewise.
422 * init.c: Likewise.
423 * semantics.c: Likewise.
424 * tree.c: Likewise.
425 * typeck.c: Likewise.
426 * typeck2.c: Likewise.
427
428 2015-06-27 Marek Polacek <polacek@redhat.com>
429
430 * call.c (set_up_extended_ref_temp): Use VAR_P.
431 * class.c: Use VAR_P throughout.
432 * constexpr.c (cxx_eval_constant_expression): Use VAR_P.
433 * cp-array-notation.c (make_triplet_val_inv): Likewise.
434 * decl.c: Use VAR_OR_FUNCTION_DECL_P or VAR_P
435 throughout.
436 * decl2.c: Likewise.
437 * error.c (dump_decl): Use VAR_P.
438 * mangle.c (decl_implicit_alias_p): Likewise.
439 * parser.c: Use VAR_P throughout.
440 * pt.c: Likewise.
441 * semantics.c: Likewise.
442 * vtable-class-hierarchy.c: Likewise.
443 * tree.c (handle_abi_tag_attribute): Use VAR_OR_FUNCTION_DECL_P.
444
445 2015-06-27 Andreas Schwab <schwab@linux-m68k.org>
446
447 * pt.c (check_unstripped_args): Mark parameter as unused.
448
449 2015-06-26 Jason Merrill <jason@redhat.com>
450
451 PR c++/66216
452 * class.c (finish_struct): Call fixup_attribute_variants.
453
454 PR c++/66684
455 * typeck2.c (merge_exception_specifiers): Allow different
456 noexcept-specifiers if we've had errors.
457
458 PR c++/66255
459 * pt.c (check_unstripped_args): Split out from...
460 (retrieve_specialization): ...here. Allow typedefs in the type of
461 a non-type argument.
462
463 PR c++/66067
464 * mangle.c (write_nested_name): Limit TYPENAME_TYPE handling to
465 TYPE_DECLs.
466 * mangle.c (write_template_args): Handle 0 length TREE_VEC.
467
468 PR c++/66654
469 * typeck2.c (digest_init_r): Only expect reshaping if the class is
470 aggregate.
471
472 2015-06-26 Marek Polacek <polacek@redhat.com>
473
474 * cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P.
475 * cp-ubsan.c (cp_ubsan_check_member_access_r): Likewise.
476
477 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
478
479 * call.c: Remove ipa-ref.h and plugin-api.h from include list.
480 * class.c: Likewise.
481 * cp-ubsan.c: Likewise.
482 * decl.c: Likewise.
483 * decl2.c: Likewise.
484 * lambda.c: Likewise.
485 * mangle.c: Likewise.
486 * method.c: Likewise.
487 * optimize.c: Likewise.
488 * parser.c: Likewise.
489 * semantics.c: Likewise.
490 * tree.c: Likewise.
491 * vtable-class-hierarchy.c: Likewise.
492
493 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
494
495 * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash
496 rather than ggc_hasher.
497 (constexpr_call_hasher): Likewise.
498 * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise.
499 * decl.c (typename_hasher): Likewise.
500 * mangle.c (conv_type_hasher): Likewise.
501 * pt.c (spec_hasher): Likewise.
502 * tree.c (cplus_array_hasher, list_hasher): Likewise.
503 * typeck2.c (abstract_type_hasher): Likewise.
504
505 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
506
507 * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
508 rather than pointer_hash.
509 (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash.
510 * semantics.c (nrv_data): Likewise.
511 * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise.
512
513 2015-06-24 Jason Merrill <jason@redhat.com>
514
515 PR c++/66647
516 * pt.c (dependent_type_p_r): Check for dependent alias template
517 specialization sooner.
518
519 PR c++/66501
520 * class.c (type_has_nontrivial_assignment): Remove.
521 * cp-tree.h: Remove declaration.
522 * init.c (vec_copy_assign_is_trivial): New.
523 (build_vec_init): Use it.
524
525 2015-06-24 Edward Smith-Rowland <3dw4rd@verizon.net>
526
527 Implement N3928 - Extending static_assert
528 * parser.c (cp_parser_static_assert): Support static_assert with
529 no message string. Supply an empty string in this case.
530 * semantics.c (finish_static_assert): Don't try to print a message if
531 the message strnig is empty.
532
533 2015-06-24 Adam Butcher <adam@jessamine.co.uk>
534
535 PR c++/65750
536 * parser.c (cp_parser_simple_type_specifier): Don't synthesize
537 implicit template parm if 'auto' is a placeholder for trailing
538 return type.
539
540 2015-06-24 Patrick Palka <ppalka@gcc.gnu.org>
541
542 Revert:
543 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
544
545 PR c++/30044
546 * parser.c (cp_parser_template_parameter_list): Update
547 current_template_parms right after processing a paramater.
548 * pt.c (template_parms_to_args): Remove obsolete hack for
549 giving template template arguments the proper level.
550 (check_default_tmpl_args): Account for tested template
551 parameter_lists.
552 (splite_late_return_type): Remove obsolete hack for giving
553 template template arguments the proper level.
554
555 2015-06-24 Paolo Carlini <paolo.carlini@oracle.com>
556
557 PR c++/65811
558 * decl.c (duplicate_decls): Adjust DECL_COMDAT of newdecl.
559
560 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
561
562 PR c++/30044
563 * parser.c (cp_parser_template_parameter_list): Update
564 current_template_parms right after processing a paramater.
565 * pt.c (template_parms_to_args): Remove obsolete hack for
566 giving template template arguments the proper level.
567 (check_default_tmpl_args): Account for tested template
568 parameter_lists.
569 (splite_late_return_type): Remove obsolete hack for giving
570 template template arguments the proper level.
571
572 2015-06-23 Jason Merrill <jason@redhat.com>
573
574 PR c++/65879
575 * decl.c (grokfndecl): Check the linkage of ctype, not just
576 TYPE_ANONYMOUS_P.
577 * tree.c (no_linkage_check): Skip the 'this' pointer.
578
579 PR c++/66501
580 * class.c (type_has_nontrivial_assignment): New.
581 * init.c (build_vec_init): Use it.
582 * cp-tree.h: Declare it.
583 * method.c (trivial_fn_p): Templates aren't trivial.
584
585 PR c++/66542
586 * decl.c (expand_static_init): Make sure the destructor is callable
587 here even if we have an initializer.
588
589 2015-06-04 Pierre-Marie de Rodat <derodat@adacore.com>
590
591 * lang-specs.h: Pass "-o %g.s" to cc1plus for headers even if
592 -fdump-ada-spec is passed.
593
594 2015-06-22 Pierre-Marie de Rodat <derodat@adacore.com>
595
596 * decl2.c (cpp_check): Deal with HAS_DEPENDENT_TEMPLATE_ARGS.
597
598 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
599
600 * decl.c (grokdeclarator): Use declspecs->locations[ds_virtual].
601
602 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
603
604 * decl.c (grokdeclarator): Remove pointless code.
605
606 2015-06-22 Jason Merrill <jason@redhat.com>
607
608 PR c++/66515
609 * call.c (implicit_conversion): Only reshape for classes.
610
611 2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
612
613 * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of
614 manually swapping.
615 * semantics.c (finish_omp_atomic): Likewise.
616 * typeck.c (cp_build_array_ref): Likewise.
617
618 2015-06-20 Mikhail Maltsev <maltsevm@gmail.com>
619
620 PR c++/65882
621 * call.c (build_new_op_1): Check tf_warning flag in all cases.
622
623 2015-06-19 Jason Merrill <jason@redhat.com>
624
625 PR c++/66585
626 * pt.c (instantiate_class_template_1): Clear
627 cp_unevaluated_operand and c_inhibit_evaluation_warnings.
628
629 PR c++/65880
630 * decl.c (build_ptrmemfunc_type): Check TYPE_GET_PTRMEMFUNC_TYPE after
631 cv-qualifiers.
632 * typeck.c (merge_types): build_ptrmemfunc_type before applying
633 quals and attributes.
634
635 PR c++/65973
636 * constexpr.c (build_constexpr_constructor_member_initializers):
637 Handle an empty STATEMENT_LIST.
638
639 PR c++/65843
640 * pt.c (tsubst_copy_and_build): Register a capture proxy in
641 local_specializations.
642
643 2015-06-17 Jason Merrill <jason@redhat.com>
644
645 PR c++/66001
646 * constexpr.c (cxx_eval_constant_expression): Handle TRY_BLOCK and
647 TRY_FINALLY_EXPR.
648 (potential_constant_expression_1): Likewise.
649
650 2015-06-17 Jason Merrill <jason@redhat.com>
651
652 PR c++/66515
653 * call.c (implicit_conversion): Call reshape_init here, early.
654 (build_aggr_conv): Not here.
655
656 2015-06-17 Jakub Jelinek <jakub@redhat.com>
657
658 PR c++/66571
659 * pt.c (tsubst_omp_clause_decl): New function.
660 (tsubst_omp_clauses): Use it or tsubst_copy instead of
661 tsubst_expr on OMP_CLAUSE_DECL.
662
663 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
664
665 * cp-lang.c (cxx_dwarf_name): Use anon_aggrname_p.
666 * cp-tree.h (TYPE_ANONYMOUS_P): Likewise.
667 * decl.c (grokdeclarator, xref_tag_1): Likewise.
668 * error.c (dump_aggr_type): likewise.
669 * pt.c (push_template_decl_real): Likewise.
670 * name-lookup.c (make_anon_name): Use anon_aggrname_format.
671
672 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
673
674 * call.c: Do not include input.h, line-map.h or is-a.h.
675 * class.c: Likewise.
676 * constexpr.c: Likewise.
677 * cp-array-notation.c: Likewise.
678 * cp-gimplify.c: Likewise.
679 * cp-lang.c: Likewise.
680 * cp-objcp-common.c: Likewise.
681 * cp-tree.h: Likewise.
682 * cp-ubsan.c: Likewise.
683 * cvt.c: Likewise.
684 * decl.c: Likewise.
685 * decl2.c: Likewise.
686 * dump.c: Likewise.
687 * error.c: Likewise.
688 * except.c: Likewise.
689 * expr.c: Likewise.
690 * friend.c: Likewise.
691 * init.c: Likewise.
692 * lambda.c: Likewise.
693 * lex.c: Likewise.
694 * mangle.c: Likewise.
695 * method.c: Likewise.
696 * name-lookup.c: Likewise.
697 * optimize.c: Likewise.
698 * parser.c: Likewise.
699 * pt.c: Likewise.
700 * ptree.c: Likewise.
701 * repo.c: Likewise.
702 * rtti.c: Likewise.
703 * search.c: Likewise.
704 * semantics.c: Likewise.
705 * tree.c: Likewise.
706 * typeck.c: Likewise.
707 * typeck2.c: Likewise.
708 * vtable-class-hierarchy.c: Likewise.
709
710 2015-06-16 Paolo Carlini <paolo.carlini@oracle.com>
711
712 PR c++/59682
713 * parser.c (cp_parser_new_placement): Reject an empty expression-list.
714
715 2015-06-16 Jason Merrill <jason@redhat.com>
716
717 PR c++/66536
718 * tree.c (replace_placeholders_r) [CONSTRUCTOR]: Handle type
719 mismatch.
720
721 PR c++/58063
722 * tree.c (bot_manip): Remap SAVE_EXPR.
723
724 PR c++/66387
725 * pt.c (tsubst_copy) [VAR_DECL]: Use process_outer_var_ref.
726
727 2015-06-15 Nathan Sidwell <nathan@acm.org>
728
729 PR c++/58583
730 * cp-tree.h (DECL_INSTANTIATING_NSDMI_P): New.
731 * init.c (get_nsdmi): Check for DEFAULT_ARG in template case and
732 protect it from recursive instantiation.
733
734 2015-06-15 Paolo Carlini <paolo.carlini@oracle.com>
735
736 PR c++/51048
737 * decl2.c (no_linkage_error): Do not issue a permerror if the DECL
738 using a local type is pure virtual.
739
740 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
741
742 * call.c: Remove comment documenting the long-deleted
743 function build_method_call.
744
745 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
746
747 PR c++/65168
748 * typeck.c (cp_build_binary_op): Warn when comparing an address
749 of a reference against NULL.
750
751 2015-06-12 Jason Merrill <jason@redhat.com>
752
753 PR c++/65719
754 * pt.c (tsubst_decl) [VAR_DECL]: Mark namespace-scope
755 variables as DECL_NOT_REALLY_EXTERN.
756
757 2015-06-11 Jason Merrill <jason@redhat.com>
758
759 PR c++/66445
760 * constexpr.c (potential_constant_expression_1): Handle a
761 DECL_EXPR of TYPE_DECL.
762
763 PR c++/66450
764 * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
765 ctx->ctor.
766
767 2015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
768
769 * decl.c (cxx_init_decl_processing): Register the main
770 translation unit through the new debug hook.
771
772 2015-06-10 Jason Merrill <jason@redhat.com>
773
774 PR c++/66289
775 * cp-tree.h (TEMPLATE_DECL_COMPLEX_ALIAS_P): New.
776 * pt.c (push_template_decl_real): Set it.
777 (dependent_alias_template_spec_p): Use it.
778 (dependent_type_p_r): Use dependent_alias_template_spec_p.
779 (uses_all_template_parms_data, uses_all_template_parms_r)
780 (complex_alias_template_p): New.
781 (get_template_parm_index): Handle BOUND_TEMPLATE_TEMPLATE_PARM.
782
783 2015-06-09 Jason Merrill <jason@redhat.com>
784
785 DR 1467
786 PR c++/51747
787 * typeck2.c (digest_init_r): Replace previous change with
788 gcc_unreachable.
789
790 PR c++/66387
791 * semantics.c (process_outer_var_ref): Make sure the value is
792 actually constant before returning it.
793 * typeck.c (cp_build_array_ref): Allow subscripting non-lvalue
794 array.
795
796 2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
797
798 PR c++/65815
799 * typeck2.c (digest_nsdmi_init): On aggregates use reshape_init.
800 * init.c (expand_default_init): Likewise.
801
802 2015-06-09 Jason Merrill <jason@redhat.com>
803
804 PR c++/66383
805 * tree.c (replace_placeholders_r): Handle placeholders for an
806 outer object.
807 * typeck2.c (store_init_value): Only replace_placeholders for
808 objects of class type.
809
810 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
811
812 * call.c : Adjust include files.
813 * class.c : Likewise.
814 * constexpr.c : Likewise.
815 * cp-array-notation.c : Likewise.
816 * cp-cilkplus.c : Likewise.
817 * cp-gimplify.c : Likewise.
818 * cp-lang.c : Likewise.
819 * cp-objcp-common.c : Likewise.
820 * cp-tree.h : Likewise.
821 * cp-ubsan.c : Likewise.
822 * cvt.c : Likewise.
823 * decl.c : Likewise.
824 * decl2.c : Likewise.
825 * dump.c : Likewise.
826 * error.c : Likewise.
827 * except.c : Likewise.
828 * expr.c : Likewise.
829 * friend.c : Likewise.
830 * init.c : Likewise.
831 * lambda.c : Likewise.
832 * lex.c : Likewise.
833 * mangle.c : Likewise.
834 * method.c : Likewise.
835 * name-lookup.c : Likewise.
836 * optimize.c : Likewise.
837 * parser.c : Likewise.
838 * pt.c : Likewise.
839 * ptree.c : Likewise.
840 * repo.c : Likewise.
841 * rtti.c : Likewise.
842 * search.c : Likewise.
843 * semantics.c : Likewise.
844 * tree.c : Likewise.
845 * typeck.c : Likewise.
846 * typeck2.c : Likewise.
847 * vtable-class-hierarchy.c : Likewise.
848
849 2015-06-05 Jason Merrill <jason@redhat.com>
850
851 PR c++/66405
852 * pt.c (argument_pack_element_is_expansion_p): Return 2 if
853 the expansion has extra args.
854 (use_pack_expansion_extra_args_p): Return true in that case.
855
856 PR c++/66405
857 * pt.c (type_dependent_expression_p): EXPR_PACK_EXPANSION is
858 dependent even if it has a type.
859
860 2015-06-05 Aldy Hernandez <aldyh@redhat.com>
861
862 * cp-objcp-common.c: Adjust comment for
863 cxx_warn_unused_global_decl.
864 * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Remove
865 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): New.
866 * cp-tree.h (note_mangling_alias): Protoize.
867 (cp_write_global_declarations): Remove.
868 (cxx_post_compilation_parsing_cleanups): Protoize.
869 * decl.c (wrapup_globals_for_namespace): Remove use of DATA
870 argument.
871 * decl2.c (mangling_aliases): New global.
872 (build_java_method_aliases): New. Adapted from
873 collect_candidates_for_java_method_aliases.
874 (collect_candidates_for_java_method_aliases): Remove.
875 (build_java_method_aliases): Remove.
876 (generate_mangling_aliases): New.
877 (note_mangling_alias): New. Moved from mangle_decl.
878 (locus_at_end_of_parsing): New global.
879 (c_parse_final_cleanups): Rename from
880 cp_write_global_declarations.
881 Use locus_at_end_of_parsing.
882 Call generate_mangling_aliases.
883 Rename call to collect_candidates_for_java_method_aliases into
884 build_java_method_aliases.
885 Remove call to finalize_compilation_unit.
886 Move vtable handling into cxx_post_compilation_parsing_cleanups.
887 Do not call check_global_declarations or
888 emit_debug_global_declarations.
889 (cxx_post_compilation_parsing_cleanups): New.
890 * mangle.c (mangle_decl): Move code to note_mangling_alias.
891 * name-lookup.c (do_namespace_alias): Call early_global_decl.
892
893 2015-06-05 Nathan Sidwell <nathan@acm.org>
894
895 PR c++/52595
896 * parser.c (cp_parser_cache_defarg): Continue looking for
897 declarators when scanning a potential template argument list of an
898 NSDMI.
899
900 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
901
902 * call.c: Adjust includes for restructured coretypes.h.
903 * class.c: Likewise.
904 * constexpr.c: Likewise.
905 * cp-array-notation.c: Likewise.
906 * cp-gimplify.c: Likewise.
907 * cp-lang.c: Likewise.
908 * cp-objcp-common.c: Likewise.
909 * cp-tree.h: Likewise.
910 * cp-ubsan.c: Likewise.
911 * cvt.c: Likewise.
912 * decl.c: Likewise.
913 * decl2.c: Likewise.
914 * dump.c: Likewise.
915 * error.c: Likewise.
916 * except.c: Likewise.
917 * expr.c: Likewise.
918 * friend.c: Likewise.
919 * init.c: Likewise.
920 * lambda.c: Likewise.
921 * lex.c: Likewise.
922 * mangle.c: Likewise.
923 * method.c: Likewise.
924 * name-lookup.c: Likewise.
925 * optimize.c: Likewise.
926 * parser.c: Likewise.
927 * pt.c: Likewise.
928 * ptree.c: Likewise.
929 * repo.c: Likewise.
930 * rtti.c: Likewise.
931 * search.c: Likewise.
932 * semantics.c: Likewise.
933 * tree.c: Likewise.
934 * typeck.c: Likewise.
935 * typeck2.c: Likewise.
936 * vtable-class-hierarchy.c: Likewise.
937
938 2015-06-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
939
940 PR c++/66192
941 PR target/66200
942 * cp-tree.h (get_guard_cond): Adjust declaration
943 * decl.c (expand_static_init): Use atomic load acquire
944 and adjust call to get_guard_cond.
945 * decl2.c (build_atomic_load_byte): New function.
946 (get_guard_cond): Handle thread_safety.
947 (one_static_initialization_or_destruction): Adjust call to
948 get_guard_cond.
949
950 2015-06-03 Jason Merrill <jason@redhat.com>
951
952 PR c++/44282
953 * mangle.c (mangle_decl): Always SET_IDENTIFIER_GLOBAL_VALUE.
954 (write_CV_qualifiers_for_type): Set G.need_abi_warning.
955 (decl_implicit_alias_p): Split out from maybe_remove_implicit_alias.
956 * cp-tree.h (DECL_REALLY_EXTERN): Handle null DECL_LANG_SPECIFIC.
957
958 2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
959 Paolo Carlini <paolo.carlini@oracle.com>
960
961 PR c++/66130
962 * typeck.c (invalid_nonstatic_memfn_p): Add location_t parameter and
963 use it in the diagnostic.
964 (decay_conversion): Adjust call.
965 * semantics.c (finish_decltype_type): Likewise.
966 * call.c (resolve_args, build_new_op_1,
967 perform_implicit_conversion_flags): Adjust calls.
968 * cvt.c (ocp_convert, convert_to_void): Likewise.
969 * cp-tree.h (invalid_nonstatic_memfn_p): Update declaration.
970
971 2015-06-03 Paolo Carlini <paolo.carlini@oracle.com>
972
973 * decl.c (check_tag_decl): Use declspecs->locations as locations in
974 error_at and warning_at calls.
975
976 2015-06-03 Marek Polacek <polacek@redhat.com>
977
978 PR sanitizer/66190
979 * cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
980 (cp_genericize_r): Don't instrument static initializers.
981 (cp_genericize_tree): Initialize wtd.no_sanitize_p.
982
983 2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
984
985 * decl.c (start_function): Call plugin before parsing.
986 (finish_function): Call plugin after parsing.
987
988 2015-06-02 Patrick Palka <patrick@parcs.ath.cx>
989
990 * cp-tree.h (init_error): Remove declaration.
991 * error.c (scratch_pretty_printer): Rename to ...
992 (actual_pretty_printer): ... this.
993 (cxx_pp): Constify and update accordingly.
994 (init_error): Remove definition.
995 * lex.c (cxx_init): Do not call init_error.
996
997 2015-06-02 Paolo Carlini <paolo.carlini@oracle.com>
998
999 PR c++/61683
1000 * parser.c (cp_parser_mem_initializer): Allow for decltype-specifier.
1001
1002 2015-06-01 Jason Merrill <jason@redhat.com>
1003
1004 PR c++/65942
1005 * decl2.c (mark_used): Don't always instantiate constexpr fns.
1006 * constexpr.c (cxx_eval_call_expression): Instantiate them here.
1007
1008 PR c++/44282
1009 * mangle.c (attr_strcmp): New.
1010 (write_CV_qualifiers_for_type): Also write out attributes that
1011 affect type identity.
1012 (write_type): Strip all attributes after writing qualifiers.
1013
1014 2015-05-31 Jason Merrill <jason@redhat.com>
1015
1016 * constexpr.c (cxx_eval_indirect_ref): Try folding first.
1017
1018 PR c++/66320
1019 * constexpr.c (cxx_eval_constant_expression): Treat a placeholder
1020 with the wrong type as non-constant.
1021
1022 2015-05-27 Jason Merrill <jason@redhat.com>
1023
1024 * decl.c (check_redeclaration_exception_specification): Depend on
1025 -Wsystem-headers rather than -pedantic.
1026
1027 * decl.c (warn_extern_redeclared_static): Use the location of
1028 newdecl in diagnostics, not input_location.
1029 (validate_constexpr_redeclaration): Likewise.
1030 (check_redeclaration_no_default_args): Likewise.
1031 (duplicate_decls): Likewise.
1032 (check_redeclaration_exception_specification): Likewise.
1033 Change second diagnostic to inform.
1034
1035 2015-05-24 Nathan Sidwell <nathan@acm.org>
1036
1037 PR c++/66243
1038 * decl.c (build_enumerator): Don't silently convert scoped enums.
1039
1040 2015-05-24 Jan Hubicka <hubicka@ucw.cz>
1041
1042 PR lto/66180
1043 * mangle.c (mangle_decl): Mangle anonymous namespace types as
1044 "<anon>".
1045
1046 2015-05-23 Nathan Sidwell <nathan@acm.org>
1047
1048 PR c++/65936
1049 * pt.c (lookup_template_class_1): Copy may_alias attribute too.
1050
1051 2015-05-22 Jim Wilson <jim.wilson@linaro.org>
1052
1053 * Make-lang.in (check_g++_parallelize): Update comment.
1054
1055 2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
1056
1057 PR c++/65598
1058 * decl.c (grokdeclarator): Use the correct location in error
1059 messages about 'explicit'.
1060
1061 2015-05-22 Marek Polacek <polacek@redhat.com>
1062 Edward Smith-Rowland <3dw4rd@verizon.net>
1063
1064 PR c/47043
1065 * cp-tree.h (build_enumerator): Update declaration.
1066 * decl.c (build_enumerator): Add attributes parameter. Call
1067 cplus_decl_attributes.
1068 * init.c (constant_value_1): Pass tf_none to mark_used.
1069 * parser.c (cp_parser_enumerator_definition): Parse attributes and
1070 pass them down to build_enumerator.
1071 * pt.c (tsubst_enum): Pass decl attributes to build_enumerator.
1072 * semantics.c (finish_id_expression): Don't warn_deprecated_use here.
1073
1074 2015-05-21 Nathan Sidwell <nathan@acm.org>
1075
1076 PR c++/60943
1077 * decl2.c (change_return_type): Propagate FUNCTION_REF_QUALIFIED.
1078
1079 2015-05-21 Marek Polacek <polacek@redhat.com>
1080
1081 * typeck.c (warn_args_num): Don't print "declare here" for builtins.
1082
1083 2015-05-20 Jason Merrill <jason@redhat.com>
1084
1085 * pt.c (tsubst_decl) [VAR_DECL]: SET_DECL_IMPLICIT_INSTANTIATION
1086 before register_specialization.
1087
1088 * decl.c (grok_op_properties): Don't complain about size_t
1089 placement delete here.
1090 * call.c (second_parm_is_size_t): Split out from...
1091 (non_placement_deallocation_fn_p): ...here.
1092 (build_op_delete_call): Warn about size_t placement delete with
1093 -Wc++14-compat.
1094
1095 2015-05-19 Nathan Sidwell <nathan@acm.org>
1096
1097 PR c++/65954
1098 * typeck.c (finish_class_member_access_expr): Diagnose failed
1099 lookup of enum class member.
1100
1101 2015-05-19 Jakub Jelinek <jakub@redhat.com>
1102
1103 PR middle-end/66199
1104 * parser.c (cp_parser_omp_for_loop): Don't add
1105 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
1106 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
1107 (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
1108 constructs.
1109
1110 2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
1111
1112 * typeck.c (composite_pointer_type): Use std::swap instead of explicit
1113 swaps.
1114
1115 2015-05-18 Jason Merrill <jason@redhat.com>
1116
1117 * pt.c (retrieve_specialization): Make sure our arguments have
1118 gone through strip_typedefs.
1119
1120 * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
1121 (determine_specialization): Call coerce_template_parms.
1122
1123 DR 1391
1124 * pt.c (type_unification_real): Check convertibility here.
1125 (unify_one_argument): Not here.
1126
1127 * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo.
1128 (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype.
1129 [TREE_LIST]: Fix no-change case.
1130
1131 * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.
1132
1133 2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
1134
1135 PR fortran/44054
1136 * error.c (cp_diagnostic_starter): Use diagnostic_location
1137 function.
1138 (cp_print_error_function): Likewise.
1139 (cp_printer): Replace locus pointer with accessor function.
1140
1141 2015-05-12 David Malcolm <dmalcolm@redhat.com>
1142
1143 * parser.c (cp_parser_selection_statement): Add location and
1144 guard_kind arguments to calls to
1145 cp_parser_implicitly_scoped_statement.
1146 (cp_parser_iteration_statement): Likewise for calls to
1147 cp_parser_already_scoped_statement.
1148 (cp_parser_implicitly_scoped_statement): Add "guard_loc" and
1149 "guard_kind" params; use them to warn for misleading
1150 indentation.
1151 (cp_parser_already_scoped_statement): Likewise.
1152
1153 2015-05-11 Jan Hubicka <hubicka@ucw.cz>
1154
1155 * class.c (fixup_type_variants): Do not copy TYPE_METHODS
1156 (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant.
1157 * semantics.c (finish_member_declaration): Likewise.
1158 * method.c (lazily_declare_fn): Allways add method to main variant list.
1159
1160 2015-05-09 Aldy Hernandez <aldyh@redhat.com>
1161
1162 PR bootstrap/66085
1163 * decl2.c (note_mangling_alias): Declare arguments as unused.
1164
1165 2015-05-08 Jason Merrill <jason@redhat.com>
1166
1167 * cp-gimplify.c, parser.c: Adjust to -Wc++11-compat replacing
1168 -Wc++0x-compat.
1169
1170 2015-05-08 Jason Merrill <jason@redhat.com>
1171
1172 * decl2.c (mangling_aliases): New variable.
1173 (note_mangling_alias, generate_mangling_aliases): New.
1174 (cp_write_global_declarations): Call generate_mangling_aliases.
1175 (generate_mangling_alias): Split out from...
1176 * mangle.c (mangle_decl): ...here.
1177 * cp-tree.h: Declare note_mangling_alias.
1178
1179 2015-05-08 Aldy Hernandez <aldyh@redhat.com>
1180
1181 * decl2.c (collect_candidates_for_java_method_aliases): Remove.
1182 (build_java_method_aliases): Adapt to use create_same_body_alias
1183 instead of assemble_alias. Move variable declarations to
1184 definition and tidy up.
1185 (cp_write_global_declarations): Call build_java_method_aliases
1186 instead of collecting candidates first.
1187
1188 2015-05-07 Jason Merrill <jason@redhat.com>
1189
1190 PR c++/59012
1191 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion.
1192 (cp_parser_std_attribute_spec): Handle alignas pack expansion.
1193 * decl2.c (is_late_template_attribute): An attribute exp is dependent.
1194 * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion.
1195 (apply_late_template_attributes): Handle attribute pack expansion.
1196
1197 2015-05-07 Marek Polacek <polacek@redhat.com>
1198
1199 PR c/65179
1200 * typeck.c (cp_build_binary_op): Warn when left shifting a negative
1201 value.
1202
1203 2015-05-07 Jason Merrill <jason@redhat.com>
1204
1205 DR 1467
1206 PR c++/51747
1207 * typeck2.c (digest_init_r): Fix single element list.
1208
1209 2015-05-05 Jason Merrill <jason@redhat.com>
1210
1211 * cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and
1212 MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a
1213 MUST_NOT_THROW_EXPR.
1214 (cp_genericize_data): Add try_block field.
1215 (cp_genericize_tree): Initialize it.
1216 * except.c (expand_end_catch_block): Set TREE_NO_WARNING on
1217 implicit rethrow.
1218
1219 * constexpr.c (potential_constant_expression_1) [AT_ENCODE_EXPR]:
1220 Return false.
1221
1222 * semantics.c (finish_call_expr): Check complain.
1223
1224 * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
1225 maybe-in-charge constructor.
1226
1227 * decl.c (start_decl): Don't push the plain VAR_DECL for a
1228 variable template.
1229
1230 DR 1518
1231 DR 1630
1232 PR c++/54835
1233 PR c++/60417
1234 * call.c (convert_like_real): Check value-initialization before
1235 explicit.
1236 * typeck2.c (process_init_constructor_record): Don't set
1237 CONSTRUCTOR_IS_DIRECT_INIT.
1238 (process_init_constructor_array): Likewise.
1239 * init.c (build_vec_init): Likewise.
1240
1241 2015-05-05 David Malcolm <dmalcolm@redhat.com>
1242
1243 * parser.c (cp_parser_asm_definition): Only test for
1244 error_mark_node if "outputs" was just set. Likewise for "inputs".
1245
1246 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1247 Jakub Jelinek <jakub@redhat.com>
1248
1249 PR c++/66007
1250 * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't
1251 result in an actual error.
1252
1253 2015-05-01 Paolo Carlini <paolo.carlini@oracle.com>
1254 Prathamesh Kulharni <prathamesh.kulkarni@linaro.org>
1255
1256 PR c++/65858
1257 * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
1258 false.
1259
1260 2015-04-30 David Malcolm <dmalcolm@redhat.com>
1261
1262 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove spurious
1263 trailing semicolon.
1264
1265 2015-04-29 Jason Merrill <jason@redhat.com>
1266
1267 PR c++/50800
1268 * tree.c (apply_identity_attributes): Fix handling of classes.
1269
1270 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
1271
1272 * parser.c (cp_parser_oacc_enter_exit_data): Use
1273 OMP_STANDALONE_CLAUSES.
1274
1275 2015-04-29 Paolo Carlini <paolo.carlini@oracle.com>
1276
1277 PR c++/64667
1278 * init.c (perform_member_init): Handle references for -Winit-self.
1279
1280 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
1281
1282 * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
1283 OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
1284
1285 2015-04-28 Jason Merrill <jason@redhat.com>
1286
1287 PR c++/65896
1288 * constexpr.c (cxx_eval_store_expression): Don't try to actually
1289 store an empty class.
1290
1291 PR c++/65656
1292 * constexpr.c (cxx_eval_builtin_function_call): Fix
1293 __builtin_constant_p.
1294
1295 PR c++/50800
1296 * tree.c (strip_typedefs): Add remove_attributes parm.
1297 (strip_typedefs_expr): Likewise.
1298 (apply_identity_attributes): New subroutine of strip_typedefs.
1299 * pt.c (canonicalize_type_argument): Let strip_typedefs handle attrs.
1300 (convert_nontype_argument, unify): Likewise.
1301 * cp-tree.h: Adjust.
1302
1303 PR c++/65734
1304 * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
1305
1306 2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1307
1308 * class.c (layout_class_type): Remove check if
1309 PCC_BITFIELD_TYPE_MATTERS is defined.
1310
1311 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
1312
1313 * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus.
1314
1315 2015-04-24 Jason Merrill <jason@redhat.com>
1316
1317 PR c++/50800
1318 * typeck.c (structural_comptypes): Don't check TYPE_REF_CAN_ALIAS_ALL.
1319
1320 * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
1321 Remove obsolete code.
1322 [NE_EXPR]: Likewise.
1323
1324 2015-04-23 Jason Merrill <jason@redhat.com>
1325
1326 PR c++/65646
1327 * pt.c (check_explicit_specialization): Don't
1328 SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
1329 headers.
1330 * decl.c (grokvardecl): Revert earlier fix.
1331
1332 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com>
1333
1334 PR c++/65801
1335 * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
1336 suppresses the diagnostic.
1337
1338 2015-04-20 Ville Voutilainen <ville.voutilainen@gmail.com>
1339
1340 Reject trailing return type for an operator auto().
1341 * decl.c (grokdeclarator): Reject trailing return types for
1342 all conversion operators, don't handle conversion operators
1343 in the previous checks that deal with auto.
1344
1345 2015-04-20 Ilya Verbin <ilya.verbin@intel.com>
1346
1347 * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
1348
1349 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
1350
1351 * class.c (resolve_address_of_overloaded_function, instantiate_type):
1352 Rename tsubst_flags_t parameter flags -> complain.
1353
1354 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
1355
1356 * call.c (build_op_delete_call, build_over_call): Check mark_used
1357 return value.
1358 * class.c (resolve_address_of_overloaded_function): Likewise.
1359 * decl.c (cxx_maybe_build_cleanup): Likewise.
1360 * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
1361 tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
1362 * rtti.c (build_dynamic_cast_1): Likewise.
1363 * semantics.c (process_outer_var_ref): Likewise.
1364 * typeck.c (build_class_member_access_expr,
1365 cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
1366
1367 2015-04-15 Jason Merrill <jason@redhat.com>
1368
1369 * constexpr.c (cxx_eval_store_expression): Ignore clobbers.
1370 (build_constexpr_constructor_member_initializers): Loop to find
1371 the BIND_EXPR.
1372 * decl.c (start_preparsed_function): Clobber the object at the
1373 beginning of a constructor.
1374
1375 * decl.c (grokmethod): Only set DECL_COMDAT if TREE_PUBLIC is set.
1376 * method.c (implicitly_declare_fn): Likewise.
1377 * decl2.c (vague_linkage_p): Check TREE_PUBLIC first.
1378
1379 * decl2.c (determine_visibility): Use get_template_info.
1380
1381 2015-04-15 Jason Merrill <jason@redhat.com>
1382 Marek Polacek <polacek@redhat.com>
1383
1384 PR c++/65727
1385 * lambda.c (lambda_expr_this_capture): In unevaluated context go
1386 through the normal loop, just don't capture.
1387 (maybe_resolve_dummy): Handle null return.
1388
1389 2015-04-15 Paolo Carlini <paolo.carlini@oracle.com>
1390
1391 * call.c (enforce_access): Emit error + inform.
1392
1393 2015-04-15 Marek Polacek <polacek@redhat.com>
1394
1395 * constexpr.c (use_new_call): Remove #define.
1396 (lookup_parameter_binding): Remove function.
1397 (cxx_bind_parameters_in_call): Remove unused code.
1398 (cxx_eval_call_expression): Likewise.
1399 (cxx_eval_constant_expression): Likewise.
1400
1401 2015-04-14 Mikhail Maltsev <maltsevm@gmail.com>
1402
1403 * tree.c (replace_placeholders_t): Remove unused type.
1404 (replace_placeholders): Remove unused pset.
1405
1406 2015-04-14 Jason Merrill <jason@redhat.com>
1407
1408 * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
1409
1410 PR c++/65695
1411 * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
1412
1413 PR c++/65721
1414 * name-lookup.c (do_class_using_decl): Complain about specifying
1415 the current class even if there are dependent bases.
1416
1417 2015-04-14 David Krauss <david_work@me.com>
1418
1419 PR c++/59766
1420 * decl.c (grokdeclarator): Do not flag friends with deduced return.
1421
1422 2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
1423 Jason Merrill <jason@redhat.com>
1424
1425 PR c++/60994
1426 * parser.c (cp_parser_class_name): Add enum_ok parameter.
1427 (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
1428 (cp_parser_diagnose_invalid_type_name): Don't assume a template is
1429 a class template.
1430
1431 2015-04-12 Jakub Jelinek <jakub@redhat.com>
1432
1433 PR c++/65736
1434 * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
1435 don't fold if op01 isn't divisible by TYPE_SIZE_UNIT. Convert
1436 the expression to the original type at the end.
1437
1438 2015-04-09 Jakub Jelinek <jakub@redhat.com>
1439
1440 PR c++/65690
1441 * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
1442 TYPE_USER_ALIGN.
1443
1444 PR c++/65690
1445 * tree.c (build_cplus_array_type): Layout type before variants are
1446 set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
1447 variant.
1448
1449 2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
1450
1451 PR c++/64085
1452 * lambda.c (add_capture): Use dependent_type_p for capture by
1453 reference too.
1454
1455 2015-04-02 Marek Polacek <polacek@redhat.com>
1456
1457 PR c++/65642
1458 * constexpr.c (cxx_eval_pointer_plus_expression): Call
1459 cxx_eval_constant_expression on the first operand.
1460
1461 2015-04-01 Jason Merrill <jason@redhat.com>
1462
1463 PR c++/65625
1464 * decl.c (make_typename_type): Handle seeing a variable template.
1465
1466 2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1467
1468 PR c++/56100
1469 * pt.c (instantiating_current_function_p): New.
1470 * name-lookup.c (pushdecl_maybe_friend_1): Use it.
1471 * cp-tree.h (instantiating_current_function_p): Declare.
1472
1473 2015-04-01 Jason Merrill <jason@redhat.com>
1474
1475 PR c++/65646
1476 * decl.c (grokvardecl): Don't call check_explicit_specialization
1477 for non-template members of a class template.
1478
1479 2015-04-01 Marek Polacek <polacek@redhat.com>
1480
1481 PR c++/65554
1482 * class.c (finish_struct): Require that the second field of a
1483 user-defined initializer_list be of size type.
1484
1485 2015-03-31 Marek Polacek <polacek@redhat.com>
1486
1487 PR c++/65390
1488 * tree.c (build_cplus_array_type): Use dependent_type_p rather than
1489 checking for constness.
1490
1491 2015-03-30 Marek Polacek <polacek@redhat.com>
1492
1493 PR c++/65398
1494 * constexpr.c (cxx_fold_indirect_ref): Don't perform the
1495 *(&A[i] p+ j) => A[i + j] transformation here.
1496 (cxx_eval_pointer_plus_expression): New function.
1497 (cxx_eval_constant_expression): Use it here.
1498
1499 2015-03-27 Tobias Burnus <burnus@net-b.de>
1500
1501 PR c/65586
1502 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
1503 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
1504 cp_parser_omp_declare): Don't show error for skipped omp pragmas with
1505 -fopenmp-simd.
1506
1507 2015-03-27 Marek Polacek <polacek@redhat.com>
1508
1509 PR c++/65556
1510 * semantics.c (finish_switch_cond): If the unlowered type is not an
1511 enum, use the type of the condition.
1512
1513 2015-03-27 Jason Merrill <jason@redhat.com>
1514
1515 PR c++/65509
1516 * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
1517 constants.
1518
1519 2015-03-26 Mikhail Maltsev <maltsevm@gmail.com>
1520
1521 PR c++/65154
1522 * init.c (build_vec_init): Fix initializing aggregates
1523 with empty init list.
1524
1525 2015-03-26 Jason Merrill <jason@redhat.com>
1526
1527 PR c++/65525
1528 * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
1529
1530 2015-03-25 Marek Polacek <polacek@redhat.com>
1531
1532 PR c++/65558
1533 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
1534 on an anonymous namespace.
1535
1536 2015-03-25 Marek Polacek <polacek@redhat.com>
1537
1538 PR c++/61670
1539 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
1540
1541 2015-03-24 Jason Merrill <jason@redhat.com>
1542
1543 PR c++/65046
1544 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
1545 * parser.c (cp_parser_namespace_definition): Don't set it.
1546 * name-lookup.c (handle_namespace_attrs): Check
1547 DECL_NAMESPACE_ASSOCIATIONS instead.
1548
1549 PR c++/65498
1550 * pt.c (get_mostly_instantiated_function_type): Just return the
1551 type of the partially instantiated template in DECL_TI_TEMPLATE.
1552
1553 2015-03-20 Marek Polacek <polacek@redhat.com>
1554
1555 PR c++/65398
1556 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
1557 A[i + j].
1558
1559 2015-03-20 Marek Polacek <polacek@redhat.com>
1560
1561 PR c++/65072
1562 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
1563 variant.
1564
1565 2015-03-19 Jason Merrill <jason@redhat.com>
1566
1567 PR c++/65046
1568 Automatically propagate ABI tags to variables and functions
1569 from their (return) type.
1570 * class.c (check_tag): Handle variables and functions.
1571 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
1572 (mark_or_check_tags): Likewise.
1573 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
1574 (check_abi_tags): Add single argument overload for decls.
1575 Handle inheriting tags for decls.
1576 * mangle.c (write_mangled_name): Call it.
1577 (mangle_return_type_p): Split out from write_encoding.
1578 (unmangled_name_p): Split out from write_mangled_name.
1579 (write_mangled_name): Ignore abi_tag on namespace.
1580 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
1581 * parser.c (cp_parser_namespace_definition): Set it.
1582 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
1583 about abi_tag attribute on non-inline namespace.
1584 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
1585 (handle_abi_tag_attribute): Allow tags on variables.
1586
1587 2015-03-19 Jakub Jelinek <jakub@redhat.com>
1588
1589 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
1590 attribute for DECL_EXTERNAL VAR_DECLs.
1591
1592 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1593
1594 PR c++/65340
1595 * call.c (build_over_call): Pass the tsubst_flags_t argument to
1596 mark_used.
1597 * decl2.c (mark_used): Inline the require_deduced_type call and
1598 guard the error call.
1599
1600 2015-03-16 Jason Merrill <jason@redhat.com>
1601
1602 PR c++/65061
1603 * parser.c (cp_parser_template_name): Call strip_using_decl.
1604
1605 2015-03-16 Marek Polacek <polacek@redhat.com>
1606
1607 DR 1688
1608 PR c++/65327
1609 * decl.c (grokdeclarator): Allow volatile and constexpr together.
1610
1611 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
1612
1613 PR c++/65323
1614 * decl.c (check_default_argument): Don't call
1615 maybe_warn_zero_as_null_pointer_constant.
1616
1617 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
1618
1619 * cp-gimplify.c (simple_empty_class_p): New.
1620 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
1621 the code for empty class copies into simple_empty_class_p, and
1622 adapt it to handle COMPOUND_EXPRs.
1623
1624 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
1625
1626 PR c++/65370
1627 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
1628 only if the location of newdecl doesn't match the location of olddecl.
1629
1630 2015-03-10 Jakub Jelinek <jakub@redhat.com>
1631
1632 PR c++/65127
1633 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
1634 is not a PARM_DECL.
1635
1636 2015-03-10 Jason Merrill <jason@redhat.com>
1637
1638 PR c++/65333
1639 DR 1558
1640 * pt.c (dependent_type_p_r): Check both class and alias template args.
1641
1642 2015-03-10 Jakub Jelinek <jakub@redhat.com>
1643
1644 PR c/65120
1645 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
1646 before preparing arguments to warn_logical_not_parentheses.
1647 Use maybe_constant_value on rhs.
1648
1649 2015-03-09 Jason Merrill <jason@redhat.com>
1650
1651 PR c++/65339
1652 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
1653
1654 2015-03-09 Jakub Jelinek <jakub@redhat.com>
1655
1656 PR c/65120
1657 * parser.c (cp_parser_binary_expression): Don't warn for
1658 !!x == y or !b == y where b is bool.
1659
1660 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
1661
1662 * ptree.c (cxx_print_lambda_node): New.
1663 (cxx_print_xnode): Handle LAMBDA_EXPR.
1664
1665 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
1666
1667 PR c++/65295
1668 * constexpr.c (cxx_eval_constant_expression): Remove assert in
1669 RESULT_DECL handling.
1670
1671 2015-02-26 Marek Polacek <polacek@redhat.com>
1672
1673 PR c++/65202
1674 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
1675 a RETURN_EXPR if its operand is null.
1676
1677 2015-02-25 Jason Merrill <jason@redhat.com>
1678
1679 PR c++/65209
1680 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
1681 DECL_COMDAT.
1682 (constrain_visibility_for_template): Handle reference arguments.
1683
1684 PR debug/58315
1685 * decl.c (start_preparsed_function): Use create_artificial_label
1686 for cdtor_label.
1687
1688 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
1689 Jakub Jelinek <jakub@redhat.com>
1690
1691 PR c++/65075
1692 * constexpr.c (check_constexpr_bind_expr_vars): Allow
1693 implicit typedefs for lambda types.
1694
1695 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
1696
1697 PR c++/60894
1698 * decl.c (lookup_and_check_tag): Use strip_using_decl.
1699
1700 2015-02-13 Jason Merrill <jason@redhat.com>
1701
1702 PR c++/65054
1703 * pt.c (template_args_equal): Look through conversions here.
1704 * tree.c (cp_tree_equal): Not here.
1705
1706 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
1707
1708 PR c++/60211
1709 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
1710 pragma_external context.
1711
1712 2015-02-13 Jason Merrill <jason@redhat.com>
1713
1714 PR c++/65051
1715 * call.c (reference_binding): Don't look for bad conversion
1716 if TO is incomplete.
1717
1718 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
1719
1720 PR c++/64970
1721 * decl.c (make_typename_type): Pass tsubst_flags_t argument
1722 to lookup_template_class.
1723
1724 2015-02-13 Jakub Jelinek <jakub@redhat.com>
1725
1726 PR ipa/65034
1727 * decl.c (start_preparsed_function): Use void_type_node instead
1728 of NULL_TREE as LABEL_DECL type.
1729
1730 2015-02-12 Jason Merrill <jason@redhat.com>
1731
1732 PR c++/64898
1733 * mangle.c (write_mangled_name): Fix test for variable template
1734 instantiation.
1735
1736 * decl.c (begin_destructor_body): Condition clobber on
1737 -flifetime-dse.
1738
1739 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
1740
1741 PR c++/64959
1742 * parser.c (lookup_literal_operator): Return all candidates.
1743 (cp_parser_userdef_char_literal): Simplify error handling.
1744 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
1745 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
1746 Also give higher priority to standard string UDL operator.
1747
1748 2015-02-12 Jakub Jelinek <jakub@redhat.com>
1749
1750 PR debug/55541
1751 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
1752 * decl.c (poplevel): If functionbody, try not to create an extra
1753 BLOCK for function body and use subblocks as that, if it is non-NULL
1754 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
1755 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
1756
1757 PR sanitizer/64984
1758 * except.c (check_noexcept_r): Return NULL for internal
1759 calls.
1760
1761 2015-02-10 Jason Merrill <jason@redhat.com>
1762
1763 PR c++/64994
1764 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
1765
1766 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
1767
1768 PR ipa/64982
1769 * method.c (use_thunk): Do not check for stdarg thunks.
1770
1771 2015-02-06 Jason Merrill <jason@redhat.com>
1772
1773 PR c++/64899
1774 * init.c (build_vec_init): Handle default-initialized array with
1775 constexpr default constructor.
1776
1777 2015-02-04 Jakub Jelinek <jakub@redhat.com>
1778
1779 PR c/64824
1780 PR c/64868
1781 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
1782
1783 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
1784
1785 PR c++/64877
1786 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
1787 for generated expressions.
1788
1789 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
1790
1791 PR c++/64901
1792 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
1793 DECL_OVERRIDE_P.
1794
1795 2015-02-02 Jason Merrill <jason@redhat.com>
1796
1797 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
1798
1799 2015-01-30 Joseph Myers <joseph@codesourcery.com>
1800
1801 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
1802 changed to pass input_location as first argument.
1803
1804 2015-01-29 Jakub Jelinek <jakub@redhat.com>
1805
1806 PR c++/64717
1807 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
1808 into SAVE_EXPR.
1809
1810 2015-01-29 Jason Merrill <jason@redhat.com>
1811
1812 PR c++/49508
1813 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
1814 erroneous return statement.
1815
1816 PR c++/64521
1817 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
1818 point.
1819
1820 2015-01-27 Caroline Tice <cmtice@google.com>
1821
1822 Committing VTV Cywin/Ming patch for Patrick Wollgast
1823 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
1824 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
1825
1826 2015-01-27 Jason Merrill <jason@redhat.com>
1827
1828 PR c++/58597
1829 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
1830 current_function_decl.
1831
1832 PR c++/63889
1833 * pt.c (finish_template_variable): Move from semantics.c.
1834 Handle multiple template arg levels. Handle coercion here.
1835 (lookup_template_variable): Not here.
1836
1837 2015-01-23 Jason Merrill <jason@redhat.com>
1838
1839 PR c++/64314
1840 PR c++/57510
1841 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
1842 that has been completely split out.
1843
1844 PR c++/64701
1845 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
1846 statement codes.
1847
1848 PR c++/64727
1849 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
1850 of CONST_DECL.
1851
1852 2015-01-21 Jason Merrill <jason@redhat.com>
1853
1854 PR c++/64603
1855 * constexpr.c (cxx_eval_constant_expression): Only shortcut
1856 constant CONSTRUCTORs.
1857
1858 PR c++/64647
1859 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
1860 give a hard error in a template instantiation.
1861
1862 2015-01-21 Richard Biener <rguenther@suse.de>
1863
1864 PR middle-end/64313
1865 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
1866 for builtins the user declared correctly.
1867
1868 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
1869
1870 PR c++/58614
1871 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
1872 TREE_TYPE (elt) == error_mark_node.
1873
1874 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
1875
1876 PR tree-optimization/62053
1877 * tree.c (build_cplus_array_type): Layout type after variants are set.
1878
1879 2015-01-15 Jakub Jelinek <jakub@redhat.com>
1880
1881 * cp-gimplify.c (cp_genericize_r): Call
1882 cp_ubsan_maybe_instrument_member_call for member calls.
1883 (cp_ubsan_check_member_access_r): New function.
1884 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
1885 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
1886 cp_ubsan_instrument_member_accesses,
1887 cp_ubsan_maybe_instrument_downcast,
1888 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
1889 * cp-ubsan.c: New file.
1890 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
1891 * constexpr.c (cxx_eval_call_expression): Return void_node
1892 for IFN_UBSAN_VPTR.
1893 (potential_constant_expression_1): Return true for
1894 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
1895 * typeck.c (build_class_member_access_expr): Provide locus
1896 for COMPONENT_REFs.
1897 (build_static_cast_1): Instrument downcasts.
1898 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
1899 add ubsan instrumentation for virtual_access.
1900 * call.c: Include internal-fn.h.
1901 (set_flags_from_callee): Handle internal calls.
1902
1903 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
1904
1905 PR c++/59366
1906 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
1907 and function templates, declared only in the class.
1908 * decl.c (duplicate_decls): Reveal hidden friend functions or
1909 function templates, if they are redeclared outside the class.
1910
1911 2015-01-15 Jason Merrill <jason@redhat.com>
1912
1913 PR c++/64356
1914 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
1915
1916 PR c++/63283
1917 * constexpr.c (potential_constant_expression_1): Handle reference
1918 args in templates.
1919
1920 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
1921 James Norris <jnorris@codesourcery.com>
1922 Cesar Philippidis <cesar@codesourcery.com>
1923 Ilmir Usmanov <i.usmanov@samsung.com>
1924 Jakub Jelinek <jakub@redhat.com>
1925
1926 * parser.c: Include "gomp-constants.h".
1927 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
1928 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1929 Use OMP_CLAUSE_SET_MAP_KIND.
1930 (cp_parser_omp_construct, cp_parser_pragma): Handle
1931 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
1932 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
1933 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
1934 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
1935 "create", "delete", "deviceptr", "host", "num_gangs",
1936 "num_workers", "present", "present_or_copy", "pcopy",
1937 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
1938 "present_or_create", "pcreate", "vector_length", "wait".
1939 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
1940 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
1941 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
1942 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
1943 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
1944 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
1945 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
1946 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
1947 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
1948 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
1949 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
1950 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
1951 (cp_parser_oacc_parallel, cp_parser_oacc_update)
1952 (cp_parser_oacc_wait): New functions.
1953 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
1954 (finish_oacc_parallel): New prototypes.
1955 * semantics.c: Include "gomp-constants.h".
1956 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
1957 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
1958 OMP_CLAUSE_SET_MAP_KIND.
1959 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
1960 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
1961 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1962 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
1963 functions.
1964
1965 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
1966
1967 PR c++/58671
1968 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
1969 self-initialization.
1970
1971 2015-01-13 Jason Merrill <jason@redhat.com>
1972
1973 PR c++/64356
1974 PR libstdc++/58777
1975 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1976 pointer expressions.
1977 (cxx_eval_increment_expression): Likewise.
1978
1979 PR c++/64514
1980 * pt.c (coerce_template_parameter_pack): Return NULL for a
1981 zero-length fixed parameter pack with a pack expansion arg.
1982
1983 PR c++/64520
1984 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
1985
1986 2015-01-12 Jason Merrill <jason@redhat.com>
1987
1988 PR c++/64547
1989 * constexpr.c (cxx_eval_call_expression): A call to a void
1990 function doesn't need to return a value.
1991
1992 2015-01-09 Michael Collison <michael.collison@linaro.org>
1993
1994 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
1995 input.h, alias.h, symtab.h, options.h, fold-const.h,
1996 wide-int.h, and inchash.h due to flattening of tree.h.
1997 * class.c: Ditto.
1998 * constexpr.c: Ditto.
1999 * cp-array-notation.c: Ditto.
2000 * cp-gimplify.c: Ditto.
2001 * cp-lang.c: Ditto.
2002 * cp-objcp-common.c: Ditto.
2003 * cvt.c: Ditto.
2004 * decl2.c: Ditto.
2005 * decl.c: Ditto.
2006 * dump.c: Ditto.
2007 * error.c: Ditto.
2008 * except.c: Ditto.
2009 * expr.c: Ditto.
2010 * friend.c: Ditto.
2011 * init.c: Ditto.
2012 * lambda.c: Ditto.
2013 * lex.c: Ditto.
2014 * mangle.c: Ditto.
2015 * name-lookup.c: Ditto.
2016 * optimize.c: Ditto.
2017 * parser.c: Ditto.
2018 * pt.c: Ditto.
2019 * ptree.c: Ditto.
2020 * repo.c: Ditto.
2021 * rtti.c: Ditto.
2022 * search.c: Ditto.
2023 * semantics.c: Ditto.
2024 * tree.c: Ditto.
2025 * typeck2.c: Ditto.
2026 * typeck.c: Ditto.
2027
2028 2015-01-08 Jason Merrill <jason@redhat.com>
2029
2030 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
2031 * decl.c (compute_array_index_type): Likewise.
2032 * init.c (build_vec_init): Likewise.
2033 * typeck.c (cp_build_binary_op): Likewise.
2034
2035 2015-01-08 Jason Merrill <jason@redhat.com>
2036
2037 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
2038 whether an initializer-list is too big for a VLA.
2039 (throw_bad_array_length): Remove.
2040 * cp-tree.h: Remove prototype.
2041
2042 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
2043
2044 PR c++/60753
2045 * decl.c (grokfndecl): Add bool parameter.
2046 (grokdeclarator): Adjust calls.
2047 (start_decl): Don't set DECL_DELETED_FN here.
2048
2049 2015-01-06 Jason Merrill <jason@redhat.com>
2050
2051 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
2052 template-ids.
2053
2054 PR c++/64455
2055 * pt.c (type_dependent_expression_p): Handle variable templates.
2056 * constexpr.c (potential_constant_expression_1): Use it.
2057
2058 PR c++/64487
2059 * semantics.c (finish_offsetof): Handle templates here.
2060 * parser.c (cp_parser_builtin_offsetof): Not here.
2061
2062 PR c++/64496
2063 * semantics.c (process_outer_var_ref): Diagnose lambda in local
2064 class NSDMI.
2065
2066 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
2067
2068 PR c++/64489
2069 * class.c (check_field_decls): Make copy assignment operators
2070 complex only in c++98 mode.
2071
2072 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
2073
2074 PR c++/31397
2075 * class.c (check_for_override): Warn when a virtual function is an
2076 override not marked override.
2077
2078 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
2079
2080 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
2081 hold base_fndecls.
2082 (get_basefndecls): Adjust.
2083
2084 2015-01-05 Jakub Jelinek <jakub@redhat.com>
2085
2086 Update copyright years.
2087
2088 2015-01-05 Marek Polacek <polacek@redhat.com>
2089
2090 PR c/64423
2091 * typeck.c (cp_build_array_ref): Pass loc down to
2092 warn_array_subscript_with_type_char.
2093
2094 \f
2095 Copyright (C) 2015 Free Software Foundation, Inc.
2096
2097 Copying and distribution of this file, with or without modification,
2098 are permitted in any medium without royalty provided the copyright
2099 notice and this notice are preserved.