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