1 2015-09-01 Paolo Carlini <paolo.carlini@oracle.com>
4 * decl.c (smallest_type_quals_location): New.
5 (check_special_function_return_type): Use the latter; add int and
6 const location_t* parameters.
7 (grokdeclarator): Adjust check_special_function_return_type call.
9 2015-08-29 Markus Trippelsdorf <markus@trippelsdorf.de>
12 * constexpr.c (potential_constant_expression_1): Remove IF_STMT
13 case. Move label to COND_EXPR case. Remove checking of
16 2015-08-22 Paolo Carlini <paolo.carlini@oracle.com>
19 * pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE
22 2015-08-21 Jason Merrill <jason@redhat.com>
25 * constraint.cc (satisfy_implicit_conversion_constraint): Also
28 2015-08-21 Paolo Carlini <paolo.carlini@oracle.com>
30 * decl.c (grokvardecl): Simplify the latter.
32 2015-08-21 Paolo Carlini <paolo.carlini@oracle.com>
34 * decl.c (grokvardecl): Complete check added for c++/67065.
36 2015-08-20 Jason Merrill <jason@redhat.com>
38 * name-lookup.c (hidden_name_p): Handle OVERLOAD.
40 2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
43 * decl.c (grokvardecl): Reject 'main' as global variable.
45 2015-08-19 Jason Merrill <jason@redhat.com>
48 * search.c (protected_accessible_p): Remove redundant access_in_type.
49 Add otype parm instead of walking binfo.
50 (friend_accessible_p): Check SCOPE itself. Handle class
51 templates. Pass through otype.
52 (dfs_accessible_post): Handle all accessibility cases.
53 (dfs_accessible_pre): New.
54 (accessible_p): Use it. Don't check protected access here. Pass
55 decl and otype to dfs_walk.
56 (member_declared_in_type, dfs_access_in_type_pre): New.
57 (access_in_type): Use dfs_access_in_type_pre.
58 * friend.c (add_friend): Fix multiple friends with the same name.
60 * lambda.c (current_nonlambda_scope): New.
62 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
64 * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c,
65 method.c, name-lookup.h, parser.c, parser.h, rtti.c,
66 semantics.c, typeck2.c: Remove useless typedefs.
68 2015-08-18 Jason Merrill <jason@redhat.com>
71 * pt.c (convert_nontype_argument): Allow internal linkage in C++11
74 2015-08-17 Paolo Carlini <paolo.carlini@oracle.com>
77 * call.c (null_ptr_cst_p): In C++11 return 'false' for 'false'.
79 2015-08-17 Jason Merrill <jason@redhat.com>
82 * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies.
85 * constexpr.c (array_index_cmp, find_array_ctor_elt): New.
86 (cxx_eval_array_reference, cxx_eval_store_expression): Use them.
88 * constexpr.c (cxx_eval_store_expression): Don't set
89 CONSTRUCTOR_NO_IMPLICIT_ZERO if we have an enclosing CONSTRUCTOR
91 (cxx_eval_array_reference): Check it.
93 * except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P.
95 2015-08-14 Jason Merrill <jason@redhat.com>
98 * decl2.c (mark_vtable_entries): Suppress -Wdeprecated.
100 2015-08-12 Jason Merrill <jason@redhat.com>
103 * constexpr.c (cxx_eval_array_reference): Fix typo.
106 * constexpr.c (cxx_eval_array_reference): Handle sparse
110 * decl2.c (c_parse_final_cleanups): Set at_eof to 2 at end.
111 * error.c (dump_template_bindings): Don't tsubst in that case.
114 * error.c (dump_decl) [TEMPLATE_ID_EXPR]: Pass
115 TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS.
117 2015-08-08 Jason Merrill <jason@redhat.com>
120 * pt.c (process_partial_specialization): Call
121 associate_classtype_constraints.
124 * constraint.cc (finish_template_introduction):
125 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
128 * pt.c (equal): Make sure tmpl is actually a template.
131 * call.c (joust): Only call more_constrained on decls.
133 2015-08-06 Andrew Sutton <andrew.n.sutton@gmail.com>
134 Braden Obrzut <admin@maniacsvault.net>
135 Jason Merrill <jason@redhat.com>
136 Ville Voutilainen <ville.voutilainen@gmail.com>
138 Add C++ Concepts TS support.
139 * constraint.cc, logic.cc: New files.
140 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o.
141 (c++.tags): Also process .cc files.
142 * call.c (enum rejection_reason_code): Add rr_constraint_failure.
143 (print_z_candidate): Handle it.
144 (constraint_failure): New.
145 (add_function_candidate): Check constraints.
146 (build_new_function_call): Handle evaluating concepts.
147 (joust): Check more_constrained.
148 * class.c (add_method): Check equivalently_constrained.
149 (build_clone): Copy constraints.
150 (currently_open_class): Return tree.
151 (resolve_address_of_overloaded_function): Check constraints.
152 * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR.
153 (potential_constant_expression_1): Likewise.
154 * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO.
155 (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR.
156 * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR,
157 SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR,
158 EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR,
159 EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR.
160 * cp-tree.h (struct tree_constraint_info, check_nonnull)
161 (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS)
162 (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS)
163 (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS)
164 (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P)
165 (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR)
166 (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE)
167 (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN)
168 (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS)
169 (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT)
170 (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE)
171 (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated)
172 (struct local_specialization_stack, enum auto_deduction_context)
173 (variable_concept_p, concept_template_p)
174 (struct deferring_access_check_sentinel): New.
175 (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO.
176 (union lang_tree_node): Add constraint_info field.
177 (struct lang_decl_base): Add concept_p flag.
178 (enum cp_decl_spec): Add ds_concept.
179 (struct cp_declarator): Add requires_clause.
180 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
181 (cxx_pretty_printer::expression): Handle REQUIRES_EXPR,
182 TRAIT_EXPR, *_CONSTR.
183 (pp_cxx_parameter_declaration_clause): Accept a chain of
185 (cxx_pretty_printer::declarator): Print requires-clause.
186 (pp_cxx_template_declaration): Likewise.
187 (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS.
188 (pp_cxx_requires_clause, pp_cxx_requirement)
189 (pp_cxx_requirement_list, pp_cxx_requirement_body)
190 (pp_cxx_requires_expr, pp_cxx_simple_requirement)
191 (pp_cxx_type_requirement, pp_cxx_compound_requirement)
192 (pp_cxx_nested_requirement, pp_cxx_predicate_constraint)
193 (pp_cxx_expression_constraint, pp_cxx_type_constraint)
194 (pp_cxx_implicit_conversion_constraint)
195 (pp_cxx_argument_deduction_constraint)
196 (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint)
197 (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New.
198 * cxx-pretty-print.h: Declare them.
199 * decl.c (decls_match): Compare constraints.
200 (duplicate_decls): Likewise. Remove constraints before freeing.
201 (cxx_init_decl_processing): Call init_constraint_processing.
202 (cp_finish_decl): Diagnose concept without initializer.
203 (grokfndecl, grokvardecl): Handle concepts and constraints.
204 (grokdeclarator): Handle concept, requires-clause.
205 (grokparms): No longer static.
206 (xref_tag_1): Check constraints.
207 (finish_function): Call check_function_concept.
208 (cp_tree_node_structure): Handle CONSTRAINT_INFO.
209 (check_concept_refinement, is_concept_var, check_concept_fn): New.
210 * decl2.c (check_classfn): Compare constraints.
211 (mark_used): Don't instantiate concepts.
212 * error.c (dump_template_decl): Print constraints.
213 (dump_function_decl): Likewise.
214 (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR.
215 * lex.c (init_reswords): Set D_CXX_CONCEPTS.
216 * method.c (implicitly_declare_fn): Copy constraints from
218 * parser.h (struct cp_parser): Add in_result_type_constraint_p and
219 prevent_constrained_type_specifiers fields.
220 * parser.c (make_call_declarator): Add requires_clause parm.
221 (cp_parser_new): Clear prevent_constrained_type_specifiers.
222 (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES.
223 (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers.
224 (cp_parser_trait_expr): Handle RID_IS_SAME_AS.
225 (cp_parser_declaration): Handle concept introduction.
226 (cp_parser_member_declaration): Likewise.
227 (cp_parser_template_parameter): Handle constrained parameter.
228 (cp_parser_type_parameter): Handle constraints.
229 (cp_parser_decl_specifier_seq): Handle RID_CONCEPT.
230 (cp_parser_template_id): Handle partial concept id.
231 (cp_parser_type_name): Add overload that takes typename_keyword_p.
232 Handle constrained parameter.
233 (cp_parser_nonclass_name): Handle concept names.
234 (cp_parser_alias_declaration): Handle constraints.
235 (cp_parser_late_return_type_opt): Also handle requires-clause.
236 (cp_parser_type_id_1): Handle deduction constraint.
237 (cp_parser_parameter_declaration): Handle constrained parameters.
238 (cp_parser_class_specifier_1): Handle constraints.
239 (cp_parser_template_declaration_after_parameters): Split out from
240 cp_parser_template_declaration_after_export.
241 (cp_parser_single_declaration): Handle constraints.
242 (synthesize_implicit_template_parm): Handle constraints.
243 (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id)
244 (cp_parser_introduction_list, get_id_declarator)
245 (get_unqualified_id, is_constrained_parameter)
246 (cp_parser_check_constrained_type_parm)
247 (cp_parser_constrained_type_template_parm)
248 (cp_parser_constrained_template_template_parm)
249 (constrained_non_type_template_parm, finish_constrained_parameter)
250 (declares_constrained_type_template_parameter)
251 (declares_constrained_template_template_parameter)
252 (check_type_concept, cp_parser_maybe_constrained_type_specifier)
253 (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id)
254 (cp_parser_requires_clause, cp_parser_requires_clause_opt)
255 (cp_parser_requires_expression)
256 (cp_parser_requirement_parameter_list, cp_parser_requirement_body)
257 (cp_parser_requirement_list, cp_parser_requirement)
258 (cp_parser_simple_requirement, cp_parser_type_requirement)
259 (cp_parser_compound_requirement, cp_parser_nested_requirement)
260 (cp_parser_template_introduction)
261 (cp_parser_explicit_template_declaration)
262 (get_concept_from_constraint): New.
263 * pt.c (local_specialization_stack): Implement.
264 (maybe_new_partial_specialization): New.
265 (maybe_process_partial_specialization): Use it.
266 (retrieve_local_specialization, register_local_specialization)
267 (template_parm_to_arg, build_template_decl, extract_fnparm_pack)
268 (tsubst_expr): No longer static.
269 (spec_hasher::equal): Compare constraints.
270 (determine_specialization): Handle constraints.
271 (check_explicit_specialization): Handle concepts.
272 (process_template_parm): Handle constraints.
273 (end_template_parm_list): Add overload taking no arguments.
274 (process_partial_specialization): Handle concepts and constraints.
275 Register partial specializations of variable templates.
276 (redeclare_class_template): Handle constraints.
277 (convert_template_argument): Handle WILDCARD_DECL. Check
278 is_compatible_template_arg.
279 (coerce_template_parameter_pack): Handle wildcard packs.
280 (coerce_template_parms): DR 1430 also applies to concepts. Add
281 overloads taking fewer parameters.
282 (lookup_template_class_1): Handle constraints.
283 (lookup_template_variable): Concepts are always bool.
284 (finish_template_variable): Handle concepts and constraints.
285 (tsubst_friend_class): Handle constraints.
286 (gen_elem_of_pack_expansion_instantiation): Handle constraints.
287 (tsubst_pack_expansion): Handle local parameters.
288 (tsubst_decl) [FUNCTION_DECL]: Handle constraints.
289 (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints.
290 (tsubst_copy_and_build): Handle REQUIRES_EXPR.
291 (more_specialized_fn, more_specialized_partial_spec): Check constraints.
292 (more_specialized_inst): Split out from most_specialized_instantiation.
293 (most_specialized_partial_spec): Check constraints.
294 (instantiate_decl): Never instantiate a concept.
295 (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ,
297 (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR.
298 (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts.
299 (do_auto_deduction): Add overload taking tsubst flags and context enum.
301 (get_template_for_ordering, most_constrained_function)
302 (is_compatible_template_arg, convert_wildcard_argument)
303 (struct constr_entry, struct constr_hasher, decl_constraints)
304 (valid_constraints_p, get_constraints, set_constraints)
305 (remove_constraints, init_constraint_processing): New.
306 * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO.
307 * search.c (lookup_member): Do lookup in the open partial
309 * semantics.c (finish_template_template_parm): Handle constraints.
310 (fixup_template_type): New.
311 (finish_template_type): Call it.
312 (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS.
313 * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO.
314 (cp_walk_subtrees): Handle REQUIRES_EXPR.
315 * typeck.c (cp_build_function_call_vec): Check constraints.
317 2015-08-06 Jason Merrill <jason@redhat.com>
320 * parser.c (cp_parser_primary_expression): Don't skip to the end
321 of the statement if we're parsing tentatively.
326 * mangle.c (write_expression) [TEMPLATE_ID_EXPR]: Handle variable
328 * pt.c (tsubst_copy_and_build): Check for argument substitution
331 2015-08-05 Jason Merrill <jason@redhat.com>
333 * pt.c (determine_specialization): Print candidates after 'no
336 * decl.c (cp_finish_decl): Tidy.
337 * typeck.c (finish_class_member_access_expr): Use
338 type_dependent_expression_p.
339 * semantics.c (finish_id_expression): Use
340 type_dependent_expression_p. Don't build_qualified_name for a
341 decl in non-dependent scope.
342 * pt.c (type_dependent_expression_p): A TEMPLATE_ID_EXPR of an
343 identifier is dependent. Remove variable_template_p check.
349 * pt.c (lookup_template_variable): Use NULL_TREE for type.
350 (instantiate_template_1): Also set DECL_TI_ARGS based on
351 the immediate parent.
352 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle variable templates.
353 (finish_template_variable): Add complain parm.
358 * semantics.c (finish_id_expression): Call convert_from_reference
359 for variable template.
361 2015-08-04 Jason Merrill <jason@redhat.com>
363 * pt.c (lookup_template_class_1): Clear elt.spec.
365 * tree.c (build_target_expr): Copy the location from value.
367 2015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
369 * parser.c (cp_parser_selection_statement): Move handling of
370 semicolon body to ...
371 (cp_parser_implicitly_scoped_statement): .. here. Call
372 warn_for_misleading_indentation even when the body is a
373 semicolon. Extract token_indent_infos corresponding to the
374 guard, body and next tokens. Adjust call to
375 warn_for_misleading_indentation accordingly. Take
376 token_indent_info argument.
377 (cp_parser_already_scoped_statement): Likewise.
378 (cp_parser_selection_statement, cp_parser_iteration_statement):
379 Extract a token_indent_info corresponding to the guard token.
381 2015-08-01 Caroline Tice <cmtice@google.com>
384 * mangle.c : Add vtable-verify.h to include files.
385 (get_mangled_vtable_map_var_name): If the DECL_ASSEMBLER_NAME
386 is "<anon>" get the real mangled name for the class instead, and
387 also store the real mangled name in a vector for use later.
389 2015-07-31 Marek Polacek <polacek@redhat.com>
392 * typeck.c (get_member_function_from_ptrfunc): Don't sanitize
395 2015-07-30 Paolo Carlini <paolo.carlini@oracle.com>
397 * class.c (check_for_override): Use DECL_SOURCE_LOCATION and "%qD"
398 in warning_at instead of "%q+D" in warning.
399 (warn_hidden): Likewise but use location_of.
400 (finish_struct_anon_r): Likewise use DECL_SOURCE_LOCATION in permerror.
401 (check_bitfield_decl, check_field_decls): Likewise in warning_at.
402 (check_field_decls): Likewise for permerror.
403 (explain_non_literal_class): Likewise for inform.
404 (check_bases_and_members, layout_class_type): Likewise for warning_at.
405 (note_name_declared_in_class): Use location_of in permerror.
406 * name-lookup.c (diagnose_name_conflict): Use location_of in inform.
407 (pushdecl_maybe_friend_1): Use DECL_SOURCE_LOCATION in pedwarn,
408 inform, and warning_at.
409 (check_for_out_of_scope_variable): Likewise for warning_at and
412 2015-07-30 Jason Merrill <jason@redhat.com>
416 * pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.
418 2015-07-28 Paolo Carlini <paolo.carlini@oracle.com>
420 * call.c (build_op_delete_call, convert_like_real, build_over_call):
421 Use Use DECL_SOURCE_LOCATION and "%qD" in inform and pedwarn instead
423 * constexpr.c (explain_invalid_constexpr_fn): Likewise.
424 * decl.c (duplicate_decls): Likewise for warning/warning_at.
425 * except.c (maybe_noexcept_warning): Likewise.
426 * friend.c (make_friend_class): Likewise for inform.
427 * mangle.c (mangle_decl): Likewise for warning/warning_at.
428 * method.c (process_subob_fn, walk_field_subobs,
429 maybe_explain_implicit_delete): Likewise for inform.
430 * parser.c (cp_parser_lambda_introducer): Likewise.
431 * pt.c (check_specialization_namespace,
432 maybe_process_partial_specialization): Likewise for permerror.
433 (redeclare_class_template): Likewise for inform_n.
434 (coerce_template_parms, tsubst_copy_and_build): Likewise for inform.
435 * search.c (check_final_overrider): Likewise.
436 * semantics.c (process_outer_var_ref): Likewise.
438 2015-07-27 Jason Merrill <jason@redhat.com>
440 * constexpr.c (cxx_eval_call_expression): Don't add this call to
441 the hash table if !depth_ok.
443 2015-07-27 Marek Polacek <polacek@redhat.com>
447 * call.c (build_new_op_1): Call warn_tautological_cmp.
448 * pt.c (tsubst_copy_and_build): Use sentinel to suppress tautological
451 2015-07-26 Patrick Palka <ppalka@gcc.gnu.org>
454 * typeck.c (check_return_expr): Also do the basic return-value
455 validity checking if processing_template_decl and yet types are
456 not dependent. Remove obsolete code.
458 2015-07-26 Paolo Carlini <paolo.carlini@oracle.com>
460 * decl.c (poplevel): Use Use DECL_SOURCE_LOCATION and "%qD"
461 in warning_at instead of "%q+D" in warning.
462 (warn_extern_redeclared_static): Likewise for inform.
463 (check_redeclaration_no_default_args): Likewise for permerror.
464 (duplicate_decls): Likewise.
465 (check_previous_goto_1): Likewise for inform.
466 (check_goto, start_decl, check_for_uninitialized_const_var,
467 start_preparsed_function, finish_function§): Likewise.
468 * decl2.c (build_anon_union_vars, c_parse_final_cleanups): Likewise.
469 * init.c (sort_mem_initializers): Likewise.
470 * typeck.c (convert_for_initialization): Likewise for inform.
471 (maybe_warn_about_returning_address_of_local): Likewise.
472 * typeck2.c (abstract_virtuals_error_sfinae): Likewise for inform.
473 (cxx_incomplete_type_diagnostic): Likewise for emit_diagnostic.
475 2015-07-25 Patrick Palka <ppalka@gcc.gnu.org>
478 * cvt.c (ocp_convert): Don't call scalar_constant_value when
479 converting to a class type.
481 2015-07-24 Jason Merrill <jason@redhat.com>
484 * pt.c (splice_late_return_type): Correct deduced return type for
485 abbreviated function template.
487 2015-07-24 Richard Biener <rguenther@suse.de>
489 * init.c (build_vec_init): Build iterator bound in the same
490 type as the iterator.
492 2015-07-23 Marek Polacek <polacek@redhat.com>
495 * pt.c (tsubst_copy_and_build): Add warn_logical_op sentinel.
497 2015-07-23 Paolo Carlini <paolo.carlini@oracle.com>
500 * parser.c (cp_parser_simple_declaration): Robustify check avoiding
501 redundant error messages.
503 2015-07-21 Paolo Carlini <paolo.carlini@oracle.com>
505 * decl.c (grokdeclarator): For an erroneous template parameter
506 propagate error_mark_node as type.
508 2015-07-20 Marek Polacek <polacek@redhat.com>
511 * typeck.c (cp_build_binary_op): Warn about left shift overflows.
513 2015-07-15 Jason Merrill <jason@redhat.com>
516 * parser.c (cp_parser_unqualified_id): Don't accept ~x in a
517 template if there is no type x in scope.
519 2015-07-14 Patrick Palka <ppalka@gcc.gnu.org>
522 * pt.c (redeclare_class_template): Set the DECL_CONTEXTs of each
523 template template parm in the redeclaration.
524 (lookup_template_class_1): Peel off irrelevant template levels
525 from current_template_parms before augmenting the argument
528 2015-07-14 Andrea Azzarone <azzaronea@gmail.com>
531 * parser.c (cp_parser_sizeof_pack): Also consider template template
534 2015-07-14 Jason Merrill <jason@redhat.com>
536 * call.c (build_new_method_call_1): Call reshape_init.
538 2015-07-14 Paolo Carlini <paolo.carlini@oracle.com>
540 * pt.c (check_template_shadow): Emit error + inform instead of
543 2015-07-13 Patrick Palka <ppalka@gcc.gnu.org>
546 * pt.c (invalid_nontype_parm_type_p): Accept a bound template
547 template parm type under C++11 and later.
549 2015-07-12 Aldy Hernandez <aldyh@redhat.com>
551 * call.c: Fix double word typos.
552 * cp-array-notation.c: Same.
555 * name-lookup.c: Same.
558 2015-07-10 Patrick Palka <ppalka@gcc.gnu.org>
561 * pt.c (begin_template_parm_list): Add a dummy parameter level
562 to current_template_parms.
563 (end_template_parm_list): Remove the dummy parameter level
564 before adding the real one.
565 (tsubst): Don't attempt to substitute for template parameters
566 corresponding to a dummy argument level.
567 (template_parms_to_args): Remove obsolete hack for
568 giving template template arguments the proper level.
569 (splite_late_return_type): Remove obsolete hack for giving
570 template template arguments the proper level.
571 * error.c (dump_template_decl): Don't print dummy template
574 2015-07-10 Paolo Carlini <paolo.carlini@oracle.com>
577 * call.c (convert_like_real): Do not set LOOKUP_ONLYCONVERTING for
578 the second step of copy-initialization.
580 2015-07-10 Jason Merrill <jason@redhat.com>
582 * pt.c (find_parameter_packs_r): Handle variable templates.
583 (variable_template_specialization_p): New.
584 * cp-tree.h: Declare it.
586 * parser.c (cp_parser_template_id): SET_EXPR_LOCATION.
588 2015-07-10 Eric Botcazou <ebotcazou@adacore.com>
590 * decl2.c (cpp_check): Revert latest change.
592 2015-07-09 Jason Merrill <jason@redhat.com>
594 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Call
595 value_dependent_expression_p.
597 * cp-tree.h (struct cp_parameter_declarator): Rename ellipsis_p to
598 template_parameter_pack_p.
599 * parser.c (declarator_can_be_parameter_pack): False if
600 parameter_pack_p is set.
601 (make_parameter_declarator): Add template_parameter_pack_p parm.
602 (cp_parser_template_parameter): Remove parameter pack parsing.
603 (cp_parser_parameter_declaration): Handle all parameter packs.
604 Tweak default argument permerror.
606 2015-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
608 * parser.c (cp_parser_default_type_template_argument)
609 (cp_parser_default_template_template_argument): Factor out from
610 cp_parser_type_parameter.
612 2015-07-09 Paolo Carlini <paolo.carlini@oracle.com>
614 * typeck.c (warn_args_num): Rename to error_args_num.
615 (convert_arguments): Adjust calls.
617 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
619 * cp-ubsan.c: Don't include alloc-pool.h or lto-streamer.h.
621 2015-07-08 Eric Botcazou <ebotcazou@adacore.com>
623 * decl2.c (cpp_check): Deal with IS_CONSTEXPR.
625 2015-07-08 Jakub Jelinek <jakub@redhat.com>
627 * decl.c (grokfndecl): Handle flag_openmp_simd like flag_openmp.
628 * pt.c (apply_late_template_attributes): Likewise.
630 2015-07-08 Marek Polacek <polacek@redhat.com>
633 * tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before
634 accessing TYPE_LANG_SPECIFIC node.
636 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
638 * call.c: Adjust includes.
640 * constexpr.c: Likewise.
641 * cp-array-notation.c: Likewise.
642 * cp-gimplify.c: Likewise.
643 * cp-lang.c: Likewise.
644 * cp-objcp-common.c: Likewise.
645 * cp-ubsan.c: Likewise.
651 * except.c: Likewise.
653 * friend.c: Likewise.
655 * lambda.c: Likewise.
657 * mangle.c: Likewise.
658 * method.c: Likewise.
659 * name-lookup.c: Likewise.
660 * optimize.c: Likewise.
661 * parser.c: Likewise.
666 * search.c: Likewise.
667 * semantics.c: Likewise.
669 * typeck.c: Likewise.
670 * typeck2.c: Likewise.
672 2015-07-07 Eric Botcazou <ebotcazou@adacore.com>
674 * decl2.c (cpp_check): Deal with IS_MOVE_CONSTRUCTOR.
676 2015-07-06 Jason Merrill <jason@redhat.com>
678 * pt.c (reduce_template_parm_level): Also build the TYPE_DECL
679 for a template template parameter.
680 (tsubst_decl) [TEMPLATE_DECL]: Use the TEMPLATE_DECL built
681 by reduce_template_parm_level.
683 * pt.c (argument_pack_element_is_expansion_p): A decl pack is an
686 2015-07-02 Jason Merrill <jason@redhat.com>
689 * pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
690 TYPE_VALUES_RAW rather than TYPE_FIELDS.
692 2015-07-02 Andrew Sutton <andrew.n.sutton@gmail.com>
694 * pt.c (type_dependent_expression_p): Handle expressions
695 that refer to variable templates.
697 2015-07-01 Jason Merrill <jason@redhat.com>
699 * lex.c (init_reswords): s/CXX0X/CXX11/.
700 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
702 * mangle.c (write_CV_qualifiers_for_type, write_nested_name):
703 Attribute mangling is now -fabi-version=10.
706 * decl.c (cxx_init_decl_processing): Set TYPE_ALIGN of nullptr_t.
707 * class.c (layout_nonempty_base_or_field): Warn if that affects
708 the offset of a field.
710 2015-07-01 Paolo Carlini <paolo.carlini@oracle.com>
713 * parser.c (cp_parser_check_std_attribute): New.
714 (cp_parser_std_attribute_list): Call it.
716 2015-07-01 Patrick Palka <ppalka@gcc.gnu.org>
719 * pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
720 return 0 if tsubst returns a dependent type.
722 2015-06-30 Jason Merrill <jason@redhat.com>
725 * decl2.c (is_late_template_attribute): True for tls_model.
728 * cp-tree.h (CP_DECL_THREAD_LOCAL_P): New.
729 (DECL_GNU_TLS_P): Use DECL_LANG_SPECIFIC field.
730 (SET_DECL_GNU_TLS_P): New.
731 * call.c (make_temporary_var_for_ref_to_temp): Use
732 CP_DECL_THREAD_LOCAL_P.
733 (set_up_extended_ref_temp): Likewise.
734 * decl.c (duplicate_decls, expand_static_init): Likewise.
735 (redeclaration_error_message, grokvardecl): Likewise.
736 (start_decl, register_dtor_fn, grokdeclarator): Likewise.
737 * decl2.c (get_guard, var_needs_tls_wrapper): Likewise.
738 (handle_tls_init): Likewise.
739 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
740 * semantics.c (finish_id_expression): Likewise.
741 (handle_omp_array_sections_1, finish_omp_clauses): Likewise.
742 (finish_omp_threadprivate): Likewise.
743 * tree.c (decl_storage_duration): Likewise.
744 * cp-gimplify.c (omp_var_to_track): Likewise.
745 (cp_genericize_r): Check that it matches DECL_THREAD_LOCAL_P.
746 * lex.c (retrofit_lang_decl): Return if DECL_LANG_SPECIFIC is
749 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
751 Implement N4197 - Adding u8 character literals
752 * parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
753 and CPP_UTF8CHAR_USERDEF tokens;
754 (cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.
756 2015-06-29 Paolo Carlini <paolo.carlini@oracle.com>
759 * decl.c (grokfndecl): Allow constexpr declarations of friend
760 template specializations.
762 2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
765 * decl.c (finish_function): Call do_warn_unused_parameter.
767 2015-06-29 Marek Polacek <polacek@redhat.com>
770 * decl.c (struct cp_switch): Add OUTSIDE_RANGE_P.
771 (push_switch): Set OUTSIDE_RANGE_P.
772 (pop_switch): Update c_do_switch_warnings call.
773 (finish_case_label): Update c_add_case_label call.
774 * semantics.c (finish_switch_cond): Don't warn about -Wswitch-bool
777 2015-06-27 Marek Polacek <polacek@redhat.com>
779 * call.c: Use VECTOR_TYPE_P.
780 * constexpr.c: Likewise.
785 * semantics.c: Likewise.
787 * typeck.c: Likewise.
788 * typeck2.c: Likewise.
790 2015-06-27 Marek Polacek <polacek@redhat.com>
792 * call.c (set_up_extended_ref_temp): Use VAR_P.
793 * class.c: Use VAR_P throughout.
794 * constexpr.c (cxx_eval_constant_expression): Use VAR_P.
795 * cp-array-notation.c (make_triplet_val_inv): Likewise.
796 * decl.c: Use VAR_OR_FUNCTION_DECL_P or VAR_P
799 * error.c (dump_decl): Use VAR_P.
800 * mangle.c (decl_implicit_alias_p): Likewise.
801 * parser.c: Use VAR_P throughout.
803 * semantics.c: Likewise.
804 * vtable-class-hierarchy.c: Likewise.
805 * tree.c (handle_abi_tag_attribute): Use VAR_OR_FUNCTION_DECL_P.
807 2015-06-27 Andreas Schwab <schwab@linux-m68k.org>
809 * pt.c (check_unstripped_args): Mark parameter as unused.
811 2015-06-26 Jason Merrill <jason@redhat.com>
814 * class.c (finish_struct): Call fixup_attribute_variants.
817 * typeck2.c (merge_exception_specifiers): Allow different
818 noexcept-specifiers if we've had errors.
821 * pt.c (check_unstripped_args): Split out from...
822 (retrieve_specialization): ...here. Allow typedefs in the type of
826 * mangle.c (write_nested_name): Limit TYPENAME_TYPE handling to
828 * mangle.c (write_template_args): Handle 0 length TREE_VEC.
831 * typeck2.c (digest_init_r): Only expect reshaping if the class is
834 2015-06-26 Marek Polacek <polacek@redhat.com>
836 * cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P.
837 * cp-ubsan.c (cp_ubsan_check_member_access_r): Likewise.
839 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
841 * call.c: Remove ipa-ref.h and plugin-api.h from include list.
843 * cp-ubsan.c: Likewise.
846 * lambda.c: Likewise.
847 * mangle.c: Likewise.
848 * method.c: Likewise.
849 * optimize.c: Likewise.
850 * parser.c: Likewise.
851 * semantics.c: Likewise.
853 * vtable-class-hierarchy.c: Likewise.
855 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
857 * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash
858 rather than ggc_hasher.
859 (constexpr_call_hasher): Likewise.
860 * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise.
861 * decl.c (typename_hasher): Likewise.
862 * mangle.c (conv_type_hasher): Likewise.
863 * pt.c (spec_hasher): Likewise.
864 * tree.c (cplus_array_hasher, list_hasher): Likewise.
865 * typeck2.c (abstract_type_hasher): Likewise.
867 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
869 * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
870 rather than pointer_hash.
871 (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash.
872 * semantics.c (nrv_data): Likewise.
873 * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise.
875 2015-06-24 Jason Merrill <jason@redhat.com>
878 * pt.c (dependent_type_p_r): Check for dependent alias template
879 specialization sooner.
882 * class.c (type_has_nontrivial_assignment): Remove.
883 * cp-tree.h: Remove declaration.
884 * init.c (vec_copy_assign_is_trivial): New.
885 (build_vec_init): Use it.
887 2015-06-24 Edward Smith-Rowland <3dw4rd@verizon.net>
889 Implement N3928 - Extending static_assert
890 * parser.c (cp_parser_static_assert): Support static_assert with
891 no message string. Supply an empty string in this case.
892 * semantics.c (finish_static_assert): Don't try to print a message if
893 the message strnig is empty.
895 2015-06-24 Adam Butcher <adam@jessamine.co.uk>
898 * parser.c (cp_parser_simple_type_specifier): Don't synthesize
899 implicit template parm if 'auto' is a placeholder for trailing
902 2015-06-24 Patrick Palka <ppalka@gcc.gnu.org>
905 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
908 * parser.c (cp_parser_template_parameter_list): Update
909 current_template_parms right after processing a paramater.
910 * pt.c (template_parms_to_args): Remove obsolete hack for
911 giving template template arguments the proper level.
912 (check_default_tmpl_args): Account for tested template
914 (splite_late_return_type): Remove obsolete hack for giving
915 template template arguments the proper level.
917 2015-06-24 Paolo Carlini <paolo.carlini@oracle.com>
920 * decl.c (duplicate_decls): Adjust DECL_COMDAT of newdecl.
922 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
925 * parser.c (cp_parser_template_parameter_list): Update
926 current_template_parms right after processing a paramater.
927 * pt.c (template_parms_to_args): Remove obsolete hack for
928 giving template template arguments the proper level.
929 (check_default_tmpl_args): Account for tested template
931 (splite_late_return_type): Remove obsolete hack for giving
932 template template arguments the proper level.
934 2015-06-23 Jason Merrill <jason@redhat.com>
937 * decl.c (grokfndecl): Check the linkage of ctype, not just
939 * tree.c (no_linkage_check): Skip the 'this' pointer.
942 * class.c (type_has_nontrivial_assignment): New.
943 * init.c (build_vec_init): Use it.
944 * cp-tree.h: Declare it.
945 * method.c (trivial_fn_p): Templates aren't trivial.
948 * decl.c (expand_static_init): Make sure the destructor is callable
949 here even if we have an initializer.
951 2015-06-04 Pierre-Marie de Rodat <derodat@adacore.com>
953 * lang-specs.h: Pass "-o %g.s" to cc1plus for headers even if
954 -fdump-ada-spec is passed.
956 2015-06-22 Pierre-Marie de Rodat <derodat@adacore.com>
958 * decl2.c (cpp_check): Deal with HAS_DEPENDENT_TEMPLATE_ARGS.
960 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
962 * decl.c (grokdeclarator): Use declspecs->locations[ds_virtual].
964 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
966 * decl.c (grokdeclarator): Remove pointless code.
968 2015-06-22 Jason Merrill <jason@redhat.com>
971 * call.c (implicit_conversion): Only reshape for classes.
973 2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
975 * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of
977 * semantics.c (finish_omp_atomic): Likewise.
978 * typeck.c (cp_build_array_ref): Likewise.
980 2015-06-20 Mikhail Maltsev <maltsevm@gmail.com>
983 * call.c (build_new_op_1): Check tf_warning flag in all cases.
985 2015-06-19 Jason Merrill <jason@redhat.com>
988 * pt.c (instantiate_class_template_1): Clear
989 cp_unevaluated_operand and c_inhibit_evaluation_warnings.
992 * decl.c (build_ptrmemfunc_type): Check TYPE_GET_PTRMEMFUNC_TYPE after
994 * typeck.c (merge_types): build_ptrmemfunc_type before applying
995 quals and attributes.
998 * constexpr.c (build_constexpr_constructor_member_initializers):
999 Handle an empty STATEMENT_LIST.
1002 * pt.c (tsubst_copy_and_build): Register a capture proxy in
1003 local_specializations.
1005 2015-06-17 Jason Merrill <jason@redhat.com>
1008 * constexpr.c (cxx_eval_constant_expression): Handle TRY_BLOCK and
1010 (potential_constant_expression_1): Likewise.
1012 2015-06-17 Jason Merrill <jason@redhat.com>
1015 * call.c (implicit_conversion): Call reshape_init here, early.
1016 (build_aggr_conv): Not here.
1018 2015-06-17 Jakub Jelinek <jakub@redhat.com>
1021 * pt.c (tsubst_omp_clause_decl): New function.
1022 (tsubst_omp_clauses): Use it or tsubst_copy instead of
1023 tsubst_expr on OMP_CLAUSE_DECL.
1025 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
1027 * cp-lang.c (cxx_dwarf_name): Use anon_aggrname_p.
1028 * cp-tree.h (TYPE_ANONYMOUS_P): Likewise.
1029 * decl.c (grokdeclarator, xref_tag_1): Likewise.
1030 * error.c (dump_aggr_type): likewise.
1031 * pt.c (push_template_decl_real): Likewise.
1032 * name-lookup.c (make_anon_name): Use anon_aggrname_format.
1034 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
1036 * call.c: Do not include input.h, line-map.h or is-a.h.
1037 * class.c: Likewise.
1038 * constexpr.c: Likewise.
1039 * cp-array-notation.c: Likewise.
1040 * cp-gimplify.c: Likewise.
1041 * cp-lang.c: Likewise.
1042 * cp-objcp-common.c: Likewise.
1043 * cp-tree.h: Likewise.
1044 * cp-ubsan.c: Likewise.
1047 * decl2.c: Likewise.
1049 * error.c: Likewise.
1050 * except.c: Likewise.
1052 * friend.c: Likewise.
1054 * lambda.c: Likewise.
1056 * mangle.c: Likewise.
1057 * method.c: Likewise.
1058 * name-lookup.c: Likewise.
1059 * optimize.c: Likewise.
1060 * parser.c: Likewise.
1062 * ptree.c: Likewise.
1065 * search.c: Likewise.
1066 * semantics.c: Likewise.
1068 * typeck.c: Likewise.
1069 * typeck2.c: Likewise.
1070 * vtable-class-hierarchy.c: Likewise.
1072 2015-06-16 Paolo Carlini <paolo.carlini@oracle.com>
1075 * parser.c (cp_parser_new_placement): Reject an empty expression-list.
1077 2015-06-16 Jason Merrill <jason@redhat.com>
1080 * tree.c (replace_placeholders_r) [CONSTRUCTOR]: Handle type
1084 * tree.c (bot_manip): Remap SAVE_EXPR.
1087 * pt.c (tsubst_copy) [VAR_DECL]: Use process_outer_var_ref.
1089 2015-06-15 Nathan Sidwell <nathan@acm.org>
1092 * cp-tree.h (DECL_INSTANTIATING_NSDMI_P): New.
1093 * init.c (get_nsdmi): Check for DEFAULT_ARG in template case and
1094 protect it from recursive instantiation.
1096 2015-06-15 Paolo Carlini <paolo.carlini@oracle.com>
1099 * decl2.c (no_linkage_error): Do not issue a permerror if the DECL
1100 using a local type is pure virtual.
1102 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
1104 * call.c: Remove comment documenting the long-deleted
1105 function build_method_call.
1107 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
1110 * typeck.c (cp_build_binary_op): Warn when comparing an address
1111 of a reference against NULL.
1113 2015-06-12 Jason Merrill <jason@redhat.com>
1116 * pt.c (tsubst_decl) [VAR_DECL]: Mark namespace-scope
1117 variables as DECL_NOT_REALLY_EXTERN.
1119 2015-06-11 Jason Merrill <jason@redhat.com>
1122 * constexpr.c (potential_constant_expression_1): Handle a
1123 DECL_EXPR of TYPE_DECL.
1126 * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
1129 2015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
1131 * decl.c (cxx_init_decl_processing): Register the main
1132 translation unit through the new debug hook.
1134 2015-06-10 Jason Merrill <jason@redhat.com>
1137 * cp-tree.h (TEMPLATE_DECL_COMPLEX_ALIAS_P): New.
1138 * pt.c (push_template_decl_real): Set it.
1139 (dependent_alias_template_spec_p): Use it.
1140 (dependent_type_p_r): Use dependent_alias_template_spec_p.
1141 (uses_all_template_parms_data, uses_all_template_parms_r)
1142 (complex_alias_template_p): New.
1143 (get_template_parm_index): Handle BOUND_TEMPLATE_TEMPLATE_PARM.
1145 2015-06-09 Jason Merrill <jason@redhat.com>
1149 * typeck2.c (digest_init_r): Replace previous change with
1153 * semantics.c (process_outer_var_ref): Make sure the value is
1154 actually constant before returning it.
1155 * typeck.c (cp_build_array_ref): Allow subscripting non-lvalue
1158 2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1161 * typeck2.c (digest_nsdmi_init): On aggregates use reshape_init.
1162 * init.c (expand_default_init): Likewise.
1164 2015-06-09 Jason Merrill <jason@redhat.com>
1167 * tree.c (replace_placeholders_r): Handle placeholders for an
1169 * typeck2.c (store_init_value): Only replace_placeholders for
1170 objects of class type.
1172 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
1174 * call.c : Adjust include files.
1175 * class.c : Likewise.
1176 * constexpr.c : Likewise.
1177 * cp-array-notation.c : Likewise.
1178 * cp-cilkplus.c : Likewise.
1179 * cp-gimplify.c : Likewise.
1180 * cp-lang.c : Likewise.
1181 * cp-objcp-common.c : Likewise.
1182 * cp-tree.h : Likewise.
1183 * cp-ubsan.c : Likewise.
1185 * decl.c : Likewise.
1186 * decl2.c : Likewise.
1187 * dump.c : Likewise.
1188 * error.c : Likewise.
1189 * except.c : Likewise.
1190 * expr.c : Likewise.
1191 * friend.c : Likewise.
1192 * init.c : Likewise.
1193 * lambda.c : Likewise.
1195 * mangle.c : Likewise.
1196 * method.c : Likewise.
1197 * name-lookup.c : Likewise.
1198 * optimize.c : Likewise.
1199 * parser.c : Likewise.
1201 * ptree.c : Likewise.
1202 * repo.c : Likewise.
1203 * rtti.c : Likewise.
1204 * search.c : Likewise.
1205 * semantics.c : Likewise.
1206 * tree.c : Likewise.
1207 * typeck.c : Likewise.
1208 * typeck2.c : Likewise.
1209 * vtable-class-hierarchy.c : Likewise.
1211 2015-06-05 Jason Merrill <jason@redhat.com>
1214 * pt.c (argument_pack_element_is_expansion_p): Return 2 if
1215 the expansion has extra args.
1216 (use_pack_expansion_extra_args_p): Return true in that case.
1219 * pt.c (type_dependent_expression_p): EXPR_PACK_EXPANSION is
1220 dependent even if it has a type.
1222 2015-06-05 Aldy Hernandez <aldyh@redhat.com>
1224 * cp-objcp-common.c: Adjust comment for
1225 cxx_warn_unused_global_decl.
1226 * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Remove
1227 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): New.
1228 * cp-tree.h (note_mangling_alias): Protoize.
1229 (cp_write_global_declarations): Remove.
1230 (cxx_post_compilation_parsing_cleanups): Protoize.
1231 * decl.c (wrapup_globals_for_namespace): Remove use of DATA
1233 * decl2.c (mangling_aliases): New global.
1234 (build_java_method_aliases): New. Adapted from
1235 collect_candidates_for_java_method_aliases.
1236 (collect_candidates_for_java_method_aliases): Remove.
1237 (build_java_method_aliases): Remove.
1238 (generate_mangling_aliases): New.
1239 (note_mangling_alias): New. Moved from mangle_decl.
1240 (locus_at_end_of_parsing): New global.
1241 (c_parse_final_cleanups): Rename from
1242 cp_write_global_declarations.
1243 Use locus_at_end_of_parsing.
1244 Call generate_mangling_aliases.
1245 Rename call to collect_candidates_for_java_method_aliases into
1246 build_java_method_aliases.
1247 Remove call to finalize_compilation_unit.
1248 Move vtable handling into cxx_post_compilation_parsing_cleanups.
1249 Do not call check_global_declarations or
1250 emit_debug_global_declarations.
1251 (cxx_post_compilation_parsing_cleanups): New.
1252 * mangle.c (mangle_decl): Move code to note_mangling_alias.
1253 * name-lookup.c (do_namespace_alias): Call early_global_decl.
1255 2015-06-05 Nathan Sidwell <nathan@acm.org>
1258 * parser.c (cp_parser_cache_defarg): Continue looking for
1259 declarators when scanning a potential template argument list of an
1262 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
1264 * call.c: Adjust includes for restructured coretypes.h.
1265 * class.c: Likewise.
1266 * constexpr.c: Likewise.
1267 * cp-array-notation.c: Likewise.
1268 * cp-gimplify.c: Likewise.
1269 * cp-lang.c: Likewise.
1270 * cp-objcp-common.c: Likewise.
1271 * cp-tree.h: Likewise.
1272 * cp-ubsan.c: Likewise.
1275 * decl2.c: Likewise.
1277 * error.c: Likewise.
1278 * except.c: Likewise.
1280 * friend.c: Likewise.
1282 * lambda.c: Likewise.
1284 * mangle.c: Likewise.
1285 * method.c: Likewise.
1286 * name-lookup.c: Likewise.
1287 * optimize.c: Likewise.
1288 * parser.c: Likewise.
1290 * ptree.c: Likewise.
1293 * search.c: Likewise.
1294 * semantics.c: Likewise.
1296 * typeck.c: Likewise.
1297 * typeck2.c: Likewise.
1298 * vtable-class-hierarchy.c: Likewise.
1300 2015-06-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
1304 * cp-tree.h (get_guard_cond): Adjust declaration
1305 * decl.c (expand_static_init): Use atomic load acquire
1306 and adjust call to get_guard_cond.
1307 * decl2.c (build_atomic_load_byte): New function.
1308 (get_guard_cond): Handle thread_safety.
1309 (one_static_initialization_or_destruction): Adjust call to
1312 2015-06-03 Jason Merrill <jason@redhat.com>
1315 * mangle.c (mangle_decl): Always SET_IDENTIFIER_GLOBAL_VALUE.
1316 (write_CV_qualifiers_for_type): Set G.need_abi_warning.
1317 (decl_implicit_alias_p): Split out from maybe_remove_implicit_alias.
1318 * cp-tree.h (DECL_REALLY_EXTERN): Handle null DECL_LANG_SPECIFIC.
1320 2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
1321 Paolo Carlini <paolo.carlini@oracle.com>
1324 * typeck.c (invalid_nonstatic_memfn_p): Add location_t parameter and
1325 use it in the diagnostic.
1326 (decay_conversion): Adjust call.
1327 * semantics.c (finish_decltype_type): Likewise.
1328 * call.c (resolve_args, build_new_op_1,
1329 perform_implicit_conversion_flags): Adjust calls.
1330 * cvt.c (ocp_convert, convert_to_void): Likewise.
1331 * cp-tree.h (invalid_nonstatic_memfn_p): Update declaration.
1333 2015-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1335 * decl.c (check_tag_decl): Use declspecs->locations as locations in
1336 error_at and warning_at calls.
1338 2015-06-03 Marek Polacek <polacek@redhat.com>
1341 * cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
1342 (cp_genericize_r): Don't instrument static initializers.
1343 (cp_genericize_tree): Initialize wtd.no_sanitize_p.
1345 2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
1347 * decl.c (start_function): Call plugin before parsing.
1348 (finish_function): Call plugin after parsing.
1350 2015-06-02 Patrick Palka <patrick@parcs.ath.cx>
1352 * cp-tree.h (init_error): Remove declaration.
1353 * error.c (scratch_pretty_printer): Rename to ...
1354 (actual_pretty_printer): ... this.
1355 (cxx_pp): Constify and update accordingly.
1356 (init_error): Remove definition.
1357 * lex.c (cxx_init): Do not call init_error.
1359 2015-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1362 * parser.c (cp_parser_mem_initializer): Allow for decltype-specifier.
1364 2015-06-01 Jason Merrill <jason@redhat.com>
1367 * decl2.c (mark_used): Don't always instantiate constexpr fns.
1368 * constexpr.c (cxx_eval_call_expression): Instantiate them here.
1371 * mangle.c (attr_strcmp): New.
1372 (write_CV_qualifiers_for_type): Also write out attributes that
1373 affect type identity.
1374 (write_type): Strip all attributes after writing qualifiers.
1376 2015-05-31 Jason Merrill <jason@redhat.com>
1378 * constexpr.c (cxx_eval_indirect_ref): Try folding first.
1381 * constexpr.c (cxx_eval_constant_expression): Treat a placeholder
1382 with the wrong type as non-constant.
1384 2015-05-27 Jason Merrill <jason@redhat.com>
1386 * decl.c (check_redeclaration_exception_specification): Depend on
1387 -Wsystem-headers rather than -pedantic.
1389 * decl.c (warn_extern_redeclared_static): Use the location of
1390 newdecl in diagnostics, not input_location.
1391 (validate_constexpr_redeclaration): Likewise.
1392 (check_redeclaration_no_default_args): Likewise.
1393 (duplicate_decls): Likewise.
1394 (check_redeclaration_exception_specification): Likewise.
1395 Change second diagnostic to inform.
1397 2015-05-24 Nathan Sidwell <nathan@acm.org>
1400 * decl.c (build_enumerator): Don't silently convert scoped enums.
1402 2015-05-24 Jan Hubicka <hubicka@ucw.cz>
1405 * mangle.c (mangle_decl): Mangle anonymous namespace types as
1408 2015-05-23 Nathan Sidwell <nathan@acm.org>
1411 * pt.c (lookup_template_class_1): Copy may_alias attribute too.
1413 2015-05-22 Jim Wilson <jim.wilson@linaro.org>
1415 * Make-lang.in (check_g++_parallelize): Update comment.
1417 2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
1420 * decl.c (grokdeclarator): Use the correct location in error
1421 messages about 'explicit'.
1423 2015-05-22 Marek Polacek <polacek@redhat.com>
1424 Edward Smith-Rowland <3dw4rd@verizon.net>
1427 * cp-tree.h (build_enumerator): Update declaration.
1428 * decl.c (build_enumerator): Add attributes parameter. Call
1429 cplus_decl_attributes.
1430 * init.c (constant_value_1): Pass tf_none to mark_used.
1431 * parser.c (cp_parser_enumerator_definition): Parse attributes and
1432 pass them down to build_enumerator.
1433 * pt.c (tsubst_enum): Pass decl attributes to build_enumerator.
1434 * semantics.c (finish_id_expression): Don't warn_deprecated_use here.
1436 2015-05-21 Nathan Sidwell <nathan@acm.org>
1439 * decl2.c (change_return_type): Propagate FUNCTION_REF_QUALIFIED.
1441 2015-05-21 Marek Polacek <polacek@redhat.com>
1443 * typeck.c (warn_args_num): Don't print "declare here" for builtins.
1445 2015-05-20 Jason Merrill <jason@redhat.com>
1447 * pt.c (tsubst_decl) [VAR_DECL]: SET_DECL_IMPLICIT_INSTANTIATION
1448 before register_specialization.
1450 * decl.c (grok_op_properties): Don't complain about size_t
1451 placement delete here.
1452 * call.c (second_parm_is_size_t): Split out from...
1453 (non_placement_deallocation_fn_p): ...here.
1454 (build_op_delete_call): Warn about size_t placement delete with
1457 2015-05-19 Nathan Sidwell <nathan@acm.org>
1460 * typeck.c (finish_class_member_access_expr): Diagnose failed
1461 lookup of enum class member.
1463 2015-05-19 Jakub Jelinek <jakub@redhat.com>
1466 * parser.c (cp_parser_omp_for_loop): Don't add
1467 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
1468 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
1469 (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
1472 2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
1474 * typeck.c (composite_pointer_type): Use std::swap instead of explicit
1477 2015-05-18 Jason Merrill <jason@redhat.com>
1479 * pt.c (retrieve_specialization): Make sure our arguments have
1480 gone through strip_typedefs.
1482 * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
1483 (determine_specialization): Call coerce_template_parms.
1486 * pt.c (type_unification_real): Check convertibility here.
1487 (unify_one_argument): Not here.
1489 * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo.
1490 (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype.
1491 [TREE_LIST]: Fix no-change case.
1493 * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.
1495 2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
1498 * error.c (cp_diagnostic_starter): Use diagnostic_location
1500 (cp_print_error_function): Likewise.
1501 (cp_printer): Replace locus pointer with accessor function.
1503 2015-05-12 David Malcolm <dmalcolm@redhat.com>
1505 * parser.c (cp_parser_selection_statement): Add location and
1506 guard_kind arguments to calls to
1507 cp_parser_implicitly_scoped_statement.
1508 (cp_parser_iteration_statement): Likewise for calls to
1509 cp_parser_already_scoped_statement.
1510 (cp_parser_implicitly_scoped_statement): Add "guard_loc" and
1511 "guard_kind" params; use them to warn for misleading
1513 (cp_parser_already_scoped_statement): Likewise.
1515 2015-05-11 Jan Hubicka <hubicka@ucw.cz>
1517 * class.c (fixup_type_variants): Do not copy TYPE_METHODS
1518 (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant.
1519 * semantics.c (finish_member_declaration): Likewise.
1520 * method.c (lazily_declare_fn): Allways add method to main variant list.
1522 2015-05-09 Aldy Hernandez <aldyh@redhat.com>
1525 * decl2.c (note_mangling_alias): Declare arguments as unused.
1527 2015-05-08 Jason Merrill <jason@redhat.com>
1529 * cp-gimplify.c, parser.c: Adjust to -Wc++11-compat replacing
1532 2015-05-08 Jason Merrill <jason@redhat.com>
1534 * decl2.c (mangling_aliases): New variable.
1535 (note_mangling_alias, generate_mangling_aliases): New.
1536 (cp_write_global_declarations): Call generate_mangling_aliases.
1537 (generate_mangling_alias): Split out from...
1538 * mangle.c (mangle_decl): ...here.
1539 * cp-tree.h: Declare note_mangling_alias.
1541 2015-05-08 Aldy Hernandez <aldyh@redhat.com>
1543 * decl2.c (collect_candidates_for_java_method_aliases): Remove.
1544 (build_java_method_aliases): Adapt to use create_same_body_alias
1545 instead of assemble_alias. Move variable declarations to
1546 definition and tidy up.
1547 (cp_write_global_declarations): Call build_java_method_aliases
1548 instead of collecting candidates first.
1550 2015-05-07 Jason Merrill <jason@redhat.com>
1553 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion.
1554 (cp_parser_std_attribute_spec): Handle alignas pack expansion.
1555 * decl2.c (is_late_template_attribute): An attribute exp is dependent.
1556 * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion.
1557 (apply_late_template_attributes): Handle attribute pack expansion.
1559 2015-05-07 Marek Polacek <polacek@redhat.com>
1562 * typeck.c (cp_build_binary_op): Warn when left shifting a negative
1565 2015-05-07 Jason Merrill <jason@redhat.com>
1569 * typeck2.c (digest_init_r): Fix single element list.
1571 2015-05-05 Jason Merrill <jason@redhat.com>
1573 * cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and
1574 MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a
1575 MUST_NOT_THROW_EXPR.
1576 (cp_genericize_data): Add try_block field.
1577 (cp_genericize_tree): Initialize it.
1578 * except.c (expand_end_catch_block): Set TREE_NO_WARNING on
1581 * constexpr.c (potential_constant_expression_1) [AT_ENCODE_EXPR]:
1584 * semantics.c (finish_call_expr): Check complain.
1586 * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
1587 maybe-in-charge constructor.
1589 * decl.c (start_decl): Don't push the plain VAR_DECL for a
1596 * call.c (convert_like_real): Check value-initialization before
1598 * typeck2.c (process_init_constructor_record): Don't set
1599 CONSTRUCTOR_IS_DIRECT_INIT.
1600 (process_init_constructor_array): Likewise.
1601 * init.c (build_vec_init): Likewise.
1603 2015-05-05 David Malcolm <dmalcolm@redhat.com>
1605 * parser.c (cp_parser_asm_definition): Only test for
1606 error_mark_node if "outputs" was just set. Likewise for "inputs".
1608 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1609 Jakub Jelinek <jakub@redhat.com>
1612 * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't
1613 result in an actual error.
1615 2015-05-01 Paolo Carlini <paolo.carlini@oracle.com>
1616 Prathamesh Kulharni <prathamesh.kulkarni@linaro.org>
1619 * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
1622 2015-04-30 David Malcolm <dmalcolm@redhat.com>
1624 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove spurious
1627 2015-04-29 Jason Merrill <jason@redhat.com>
1630 * tree.c (apply_identity_attributes): Fix handling of classes.
1632 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
1634 * parser.c (cp_parser_oacc_enter_exit_data): Use
1635 OMP_STANDALONE_CLAUSES.
1637 2015-04-29 Paolo Carlini <paolo.carlini@oracle.com>
1640 * init.c (perform_member_init): Handle references for -Winit-self.
1642 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
1644 * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
1645 OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
1647 2015-04-28 Jason Merrill <jason@redhat.com>
1650 * constexpr.c (cxx_eval_store_expression): Don't try to actually
1651 store an empty class.
1654 * constexpr.c (cxx_eval_builtin_function_call): Fix
1655 __builtin_constant_p.
1658 * tree.c (strip_typedefs): Add remove_attributes parm.
1659 (strip_typedefs_expr): Likewise.
1660 (apply_identity_attributes): New subroutine of strip_typedefs.
1661 * pt.c (canonicalize_type_argument): Let strip_typedefs handle attrs.
1662 (convert_nontype_argument, unify): Likewise.
1663 * cp-tree.h: Adjust.
1666 * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
1668 2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1670 * class.c (layout_class_type): Remove check if
1671 PCC_BITFIELD_TYPE_MATTERS is defined.
1673 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
1675 * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus.
1677 2015-04-24 Jason Merrill <jason@redhat.com>
1680 * typeck.c (structural_comptypes): Don't check TYPE_REF_CAN_ALIAS_ALL.
1682 * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
1683 Remove obsolete code.
1684 [NE_EXPR]: Likewise.
1686 2015-04-23 Jason Merrill <jason@redhat.com>
1689 * pt.c (check_explicit_specialization): Don't
1690 SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
1692 * decl.c (grokvardecl): Revert earlier fix.
1694 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com>
1697 * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
1698 suppresses the diagnostic.
1700 2015-04-20 Ville Voutilainen <ville.voutilainen@gmail.com>
1702 Reject trailing return type for an operator auto().
1703 * decl.c (grokdeclarator): Reject trailing return types for
1704 all conversion operators, don't handle conversion operators
1705 in the previous checks that deal with auto.
1707 2015-04-20 Ilya Verbin <ilya.verbin@intel.com>
1709 * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
1711 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
1713 * class.c (resolve_address_of_overloaded_function, instantiate_type):
1714 Rename tsubst_flags_t parameter flags -> complain.
1716 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
1718 * call.c (build_op_delete_call, build_over_call): Check mark_used
1720 * class.c (resolve_address_of_overloaded_function): Likewise.
1721 * decl.c (cxx_maybe_build_cleanup): Likewise.
1722 * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
1723 tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
1724 * rtti.c (build_dynamic_cast_1): Likewise.
1725 * semantics.c (process_outer_var_ref): Likewise.
1726 * typeck.c (build_class_member_access_expr,
1727 cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
1729 2015-04-15 Jason Merrill <jason@redhat.com>
1731 * constexpr.c (cxx_eval_store_expression): Ignore clobbers.
1732 (build_constexpr_constructor_member_initializers): Loop to find
1734 * decl.c (start_preparsed_function): Clobber the object at the
1735 beginning of a constructor.
1737 * decl.c (grokmethod): Only set DECL_COMDAT if TREE_PUBLIC is set.
1738 * method.c (implicitly_declare_fn): Likewise.
1739 * decl2.c (vague_linkage_p): Check TREE_PUBLIC first.
1741 * decl2.c (determine_visibility): Use get_template_info.
1743 2015-04-15 Jason Merrill <jason@redhat.com>
1744 Marek Polacek <polacek@redhat.com>
1747 * lambda.c (lambda_expr_this_capture): In unevaluated context go
1748 through the normal loop, just don't capture.
1749 (maybe_resolve_dummy): Handle null return.
1751 2015-04-15 Paolo Carlini <paolo.carlini@oracle.com>
1753 * call.c (enforce_access): Emit error + inform.
1755 2015-04-15 Marek Polacek <polacek@redhat.com>
1757 * constexpr.c (use_new_call): Remove #define.
1758 (lookup_parameter_binding): Remove function.
1759 (cxx_bind_parameters_in_call): Remove unused code.
1760 (cxx_eval_call_expression): Likewise.
1761 (cxx_eval_constant_expression): Likewise.
1763 2015-04-14 Mikhail Maltsev <maltsevm@gmail.com>
1765 * tree.c (replace_placeholders_t): Remove unused type.
1766 (replace_placeholders): Remove unused pset.
1768 2015-04-14 Jason Merrill <jason@redhat.com>
1770 * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
1773 * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
1776 * name-lookup.c (do_class_using_decl): Complain about specifying
1777 the current class even if there are dependent bases.
1779 2015-04-14 David Krauss <david_work@me.com>
1782 * decl.c (grokdeclarator): Do not flag friends with deduced return.
1784 2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
1785 Jason Merrill <jason@redhat.com>
1788 * parser.c (cp_parser_class_name): Add enum_ok parameter.
1789 (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
1790 (cp_parser_diagnose_invalid_type_name): Don't assume a template is
1793 2015-04-12 Jakub Jelinek <jakub@redhat.com>
1796 * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
1797 don't fold if op01 isn't divisible by TYPE_SIZE_UNIT. Convert
1798 the expression to the original type at the end.
1800 2015-04-09 Jakub Jelinek <jakub@redhat.com>
1803 * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
1807 * tree.c (build_cplus_array_type): Layout type before variants are
1808 set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
1811 2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
1814 * lambda.c (add_capture): Use dependent_type_p for capture by
1817 2015-04-02 Marek Polacek <polacek@redhat.com>
1820 * constexpr.c (cxx_eval_pointer_plus_expression): Call
1821 cxx_eval_constant_expression on the first operand.
1823 2015-04-01 Jason Merrill <jason@redhat.com>
1826 * decl.c (make_typename_type): Handle seeing a variable template.
1828 2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1831 * pt.c (instantiating_current_function_p): New.
1832 * name-lookup.c (pushdecl_maybe_friend_1): Use it.
1833 * cp-tree.h (instantiating_current_function_p): Declare.
1835 2015-04-01 Jason Merrill <jason@redhat.com>
1838 * decl.c (grokvardecl): Don't call check_explicit_specialization
1839 for non-template members of a class template.
1841 2015-04-01 Marek Polacek <polacek@redhat.com>
1844 * class.c (finish_struct): Require that the second field of a
1845 user-defined initializer_list be of size type.
1847 2015-03-31 Marek Polacek <polacek@redhat.com>
1850 * tree.c (build_cplus_array_type): Use dependent_type_p rather than
1851 checking for constness.
1853 2015-03-30 Marek Polacek <polacek@redhat.com>
1856 * constexpr.c (cxx_fold_indirect_ref): Don't perform the
1857 *(&A[i] p+ j) => A[i + j] transformation here.
1858 (cxx_eval_pointer_plus_expression): New function.
1859 (cxx_eval_constant_expression): Use it here.
1861 2015-03-27 Tobias Burnus <burnus@net-b.de>
1864 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
1865 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
1866 cp_parser_omp_declare): Don't show error for skipped omp pragmas with
1869 2015-03-27 Marek Polacek <polacek@redhat.com>
1872 * semantics.c (finish_switch_cond): If the unlowered type is not an
1873 enum, use the type of the condition.
1875 2015-03-27 Jason Merrill <jason@redhat.com>
1878 * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
1881 2015-03-26 Mikhail Maltsev <maltsevm@gmail.com>
1884 * init.c (build_vec_init): Fix initializing aggregates
1885 with empty init list.
1887 2015-03-26 Jason Merrill <jason@redhat.com>
1890 * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
1892 2015-03-25 Marek Polacek <polacek@redhat.com>
1895 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
1896 on an anonymous namespace.
1898 2015-03-25 Marek Polacek <polacek@redhat.com>
1901 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
1903 2015-03-24 Jason Merrill <jason@redhat.com>
1906 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
1907 * parser.c (cp_parser_namespace_definition): Don't set it.
1908 * name-lookup.c (handle_namespace_attrs): Check
1909 DECL_NAMESPACE_ASSOCIATIONS instead.
1912 * pt.c (get_mostly_instantiated_function_type): Just return the
1913 type of the partially instantiated template in DECL_TI_TEMPLATE.
1915 2015-03-20 Marek Polacek <polacek@redhat.com>
1918 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
1921 2015-03-20 Marek Polacek <polacek@redhat.com>
1924 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
1927 2015-03-19 Jason Merrill <jason@redhat.com>
1930 Automatically propagate ABI tags to variables and functions
1931 from their (return) type.
1932 * class.c (check_tag): Handle variables and functions.
1933 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
1934 (mark_or_check_tags): Likewise.
1935 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
1936 (check_abi_tags): Add single argument overload for decls.
1937 Handle inheriting tags for decls.
1938 * mangle.c (write_mangled_name): Call it.
1939 (mangle_return_type_p): Split out from write_encoding.
1940 (unmangled_name_p): Split out from write_mangled_name.
1941 (write_mangled_name): Ignore abi_tag on namespace.
1942 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
1943 * parser.c (cp_parser_namespace_definition): Set it.
1944 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
1945 about abi_tag attribute on non-inline namespace.
1946 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
1947 (handle_abi_tag_attribute): Allow tags on variables.
1949 2015-03-19 Jakub Jelinek <jakub@redhat.com>
1951 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
1952 attribute for DECL_EXTERNAL VAR_DECLs.
1954 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1957 * call.c (build_over_call): Pass the tsubst_flags_t argument to
1959 * decl2.c (mark_used): Inline the require_deduced_type call and
1960 guard the error call.
1962 2015-03-16 Jason Merrill <jason@redhat.com>
1965 * parser.c (cp_parser_template_name): Call strip_using_decl.
1967 2015-03-16 Marek Polacek <polacek@redhat.com>
1971 * decl.c (grokdeclarator): Allow volatile and constexpr together.
1973 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
1976 * decl.c (check_default_argument): Don't call
1977 maybe_warn_zero_as_null_pointer_constant.
1979 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
1981 * cp-gimplify.c (simple_empty_class_p): New.
1982 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
1983 the code for empty class copies into simple_empty_class_p, and
1984 adapt it to handle COMPOUND_EXPRs.
1986 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
1989 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
1990 only if the location of newdecl doesn't match the location of olddecl.
1992 2015-03-10 Jakub Jelinek <jakub@redhat.com>
1995 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
1998 2015-03-10 Jason Merrill <jason@redhat.com>
2002 * pt.c (dependent_type_p_r): Check both class and alias template args.
2004 2015-03-10 Jakub Jelinek <jakub@redhat.com>
2007 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
2008 before preparing arguments to warn_logical_not_parentheses.
2009 Use maybe_constant_value on rhs.
2011 2015-03-09 Jason Merrill <jason@redhat.com>
2014 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
2016 2015-03-09 Jakub Jelinek <jakub@redhat.com>
2019 * parser.c (cp_parser_binary_expression): Don't warn for
2020 !!x == y or !b == y where b is bool.
2022 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
2024 * ptree.c (cxx_print_lambda_node): New.
2025 (cxx_print_xnode): Handle LAMBDA_EXPR.
2027 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
2030 * constexpr.c (cxx_eval_constant_expression): Remove assert in
2031 RESULT_DECL handling.
2033 2015-02-26 Marek Polacek <polacek@redhat.com>
2036 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
2037 a RETURN_EXPR if its operand is null.
2039 2015-02-25 Jason Merrill <jason@redhat.com>
2042 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
2044 (constrain_visibility_for_template): Handle reference arguments.
2047 * decl.c (start_preparsed_function): Use create_artificial_label
2050 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
2051 Jakub Jelinek <jakub@redhat.com>
2054 * constexpr.c (check_constexpr_bind_expr_vars): Allow
2055 implicit typedefs for lambda types.
2057 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
2060 * decl.c (lookup_and_check_tag): Use strip_using_decl.
2062 2015-02-13 Jason Merrill <jason@redhat.com>
2065 * pt.c (template_args_equal): Look through conversions here.
2066 * tree.c (cp_tree_equal): Not here.
2068 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
2071 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
2072 pragma_external context.
2074 2015-02-13 Jason Merrill <jason@redhat.com>
2077 * call.c (reference_binding): Don't look for bad conversion
2078 if TO is incomplete.
2080 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
2083 * decl.c (make_typename_type): Pass tsubst_flags_t argument
2084 to lookup_template_class.
2086 2015-02-13 Jakub Jelinek <jakub@redhat.com>
2089 * decl.c (start_preparsed_function): Use void_type_node instead
2090 of NULL_TREE as LABEL_DECL type.
2092 2015-02-12 Jason Merrill <jason@redhat.com>
2095 * mangle.c (write_mangled_name): Fix test for variable template
2098 * decl.c (begin_destructor_body): Condition clobber on
2101 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
2104 * parser.c (lookup_literal_operator): Return all candidates.
2105 (cp_parser_userdef_char_literal): Simplify error handling.
2106 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
2107 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
2108 Also give higher priority to standard string UDL operator.
2110 2015-02-12 Jakub Jelinek <jakub@redhat.com>
2113 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
2114 * decl.c (poplevel): If functionbody, try not to create an extra
2115 BLOCK for function body and use subblocks as that, if it is non-NULL
2116 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
2117 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
2120 * except.c (check_noexcept_r): Return NULL for internal
2123 2015-02-10 Jason Merrill <jason@redhat.com>
2126 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
2128 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
2131 * method.c (use_thunk): Do not check for stdarg thunks.
2133 2015-02-06 Jason Merrill <jason@redhat.com>
2136 * init.c (build_vec_init): Handle default-initialized array with
2137 constexpr default constructor.
2139 2015-02-04 Jakub Jelinek <jakub@redhat.com>
2143 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
2145 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
2148 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
2149 for generated expressions.
2151 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
2154 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
2157 2015-02-02 Jason Merrill <jason@redhat.com>
2159 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
2161 2015-01-30 Joseph Myers <joseph@codesourcery.com>
2163 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
2164 changed to pass input_location as first argument.
2166 2015-01-29 Jakub Jelinek <jakub@redhat.com>
2169 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
2172 2015-01-29 Jason Merrill <jason@redhat.com>
2175 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
2176 erroneous return statement.
2179 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
2182 2015-01-27 Caroline Tice <cmtice@google.com>
2184 Committing VTV Cywin/Ming patch for Patrick Wollgast
2185 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
2186 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
2188 2015-01-27 Jason Merrill <jason@redhat.com>
2191 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
2192 current_function_decl.
2195 * pt.c (finish_template_variable): Move from semantics.c.
2196 Handle multiple template arg levels. Handle coercion here.
2197 (lookup_template_variable): Not here.
2199 2015-01-23 Jason Merrill <jason@redhat.com>
2203 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
2204 that has been completely split out.
2207 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
2211 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
2214 2015-01-21 Jason Merrill <jason@redhat.com>
2217 * constexpr.c (cxx_eval_constant_expression): Only shortcut
2218 constant CONSTRUCTORs.
2221 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
2222 give a hard error in a template instantiation.
2224 2015-01-21 Richard Biener <rguenther@suse.de>
2227 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
2228 for builtins the user declared correctly.
2230 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
2233 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
2234 TREE_TYPE (elt) == error_mark_node.
2236 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
2238 PR tree-optimization/62053
2239 * tree.c (build_cplus_array_type): Layout type after variants are set.
2241 2015-01-15 Jakub Jelinek <jakub@redhat.com>
2243 * cp-gimplify.c (cp_genericize_r): Call
2244 cp_ubsan_maybe_instrument_member_call for member calls.
2245 (cp_ubsan_check_member_access_r): New function.
2246 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
2247 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
2248 cp_ubsan_instrument_member_accesses,
2249 cp_ubsan_maybe_instrument_downcast,
2250 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
2251 * cp-ubsan.c: New file.
2252 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
2253 * constexpr.c (cxx_eval_call_expression): Return void_node
2255 (potential_constant_expression_1): Return true for
2256 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
2257 * typeck.c (build_class_member_access_expr): Provide locus
2259 (build_static_cast_1): Instrument downcasts.
2260 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
2261 add ubsan instrumentation for virtual_access.
2262 * call.c: Include internal-fn.h.
2263 (set_flags_from_callee): Handle internal calls.
2265 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
2268 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
2269 and function templates, declared only in the class.
2270 * decl.c (duplicate_decls): Reveal hidden friend functions or
2271 function templates, if they are redeclared outside the class.
2273 2015-01-15 Jason Merrill <jason@redhat.com>
2276 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
2279 * constexpr.c (potential_constant_expression_1): Handle reference
2282 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
2283 James Norris <jnorris@codesourcery.com>
2284 Cesar Philippidis <cesar@codesourcery.com>
2285 Ilmir Usmanov <i.usmanov@samsung.com>
2286 Jakub Jelinek <jakub@redhat.com>
2288 * parser.c: Include "gomp-constants.h".
2289 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
2290 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
2291 Use OMP_CLAUSE_SET_MAP_KIND.
2292 (cp_parser_omp_construct, cp_parser_pragma): Handle
2293 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
2294 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
2295 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
2296 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
2297 "create", "delete", "deviceptr", "host", "num_gangs",
2298 "num_workers", "present", "present_or_copy", "pcopy",
2299 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
2300 "present_or_create", "pcreate", "vector_length", "wait".
2301 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
2302 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
2303 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
2304 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
2305 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
2306 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
2307 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
2308 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
2309 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
2310 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
2311 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
2312 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
2313 (cp_parser_oacc_parallel, cp_parser_oacc_update)
2314 (cp_parser_oacc_wait): New functions.
2315 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
2316 (finish_oacc_parallel): New prototypes.
2317 * semantics.c: Include "gomp-constants.h".
2318 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
2319 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
2320 OMP_CLAUSE_SET_MAP_KIND.
2321 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
2322 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
2323 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
2324 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
2327 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
2330 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
2331 self-initialization.
2333 2015-01-13 Jason Merrill <jason@redhat.com>
2337 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
2338 pointer expressions.
2339 (cxx_eval_increment_expression): Likewise.
2342 * pt.c (coerce_template_parameter_pack): Return NULL for a
2343 zero-length fixed parameter pack with a pack expansion arg.
2346 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
2348 2015-01-12 Jason Merrill <jason@redhat.com>
2351 * constexpr.c (cxx_eval_call_expression): A call to a void
2352 function doesn't need to return a value.
2354 2015-01-09 Michael Collison <michael.collison@linaro.org>
2356 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
2357 input.h, alias.h, symtab.h, options.h, fold-const.h,
2358 wide-int.h, and inchash.h due to flattening of tree.h.
2360 * constexpr.c: Ditto.
2361 * cp-array-notation.c: Ditto.
2362 * cp-gimplify.c: Ditto.
2364 * cp-objcp-common.c: Ditto.
2377 * name-lookup.c: Ditto.
2378 * optimize.c: Ditto.
2385 * semantics.c: Ditto.
2390 2015-01-08 Jason Merrill <jason@redhat.com>
2392 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
2393 * decl.c (compute_array_index_type): Likewise.
2394 * init.c (build_vec_init): Likewise.
2395 * typeck.c (cp_build_binary_op): Likewise.
2397 2015-01-08 Jason Merrill <jason@redhat.com>
2399 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
2400 whether an initializer-list is too big for a VLA.
2401 (throw_bad_array_length): Remove.
2402 * cp-tree.h: Remove prototype.
2404 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
2407 * decl.c (grokfndecl): Add bool parameter.
2408 (grokdeclarator): Adjust calls.
2409 (start_decl): Don't set DECL_DELETED_FN here.
2411 2015-01-06 Jason Merrill <jason@redhat.com>
2413 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
2417 * pt.c (type_dependent_expression_p): Handle variable templates.
2418 * constexpr.c (potential_constant_expression_1): Use it.
2421 * semantics.c (finish_offsetof): Handle templates here.
2422 * parser.c (cp_parser_builtin_offsetof): Not here.
2425 * semantics.c (process_outer_var_ref): Diagnose lambda in local
2428 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
2431 * class.c (check_field_decls): Make copy assignment operators
2432 complex only in c++98 mode.
2434 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
2437 * class.c (check_for_override): Warn when a virtual function is an
2438 override not marked override.
2440 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
2442 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
2444 (get_basefndecls): Adjust.
2446 2015-01-05 Jakub Jelinek <jakub@redhat.com>
2448 Update copyright years.
2450 2015-01-05 Marek Polacek <polacek@redhat.com>
2453 * typeck.c (cp_build_array_ref): Pass loc down to
2454 warn_array_subscript_with_type_char.
2457 Copyright (C) 2015 Free Software Foundation, Inc.
2459 Copying and distribution of this file, with or without modification,
2460 are permitted in any medium without royalty provided the copyright
2461 notice and this notice are preserved.