1 2015-11-12 Jason Merrill <jason@redhat.com>
3 * pt.c (check_explicit_specialization): Check the namespace after
6 2015-11-11 Jason Merrill <jason@redhat.com>
8 * decl.c (duplicate_decls): When combining typedefs, remove the
9 new type from the variants list.
11 2015-11-11 Jason Merrill <jason@redhat.com>
13 * pt.c (instantiate_class_template_1): Set function_depth around
14 instantiation of lambda op().
16 2015-11-11 Marek Polacek <polacek@redhat.com>
20 * decl.c (grokdeclarator): Call valid_array_size_p. Remove code
21 checking the size of an array.
23 2015-11-11 Dominique d'Humieres <dominiq@lps.ens.fr>
26 * parser.h (cp_token): Update pragma_kind to 8.
28 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
30 * call.c: Remove unused header files.
32 * constexpr.c: Likewise.
33 * cp-array-notation.c: Likewise.
34 * cp-cilkplus.c: Likewise.
35 * cp-gimplify.c: Likewise.
36 * cp-lang.c: Likewise.
37 * cp-objcp-common.c: Likewise.
38 * cp-ubsan.c: Likewise.
40 * cxx-pretty-print.c: Likewise.
48 * g++spec.c: Likewise.
54 * name-lookup.c: Likewise.
55 * optimize.c: Likewise.
62 * semantics.c: Likewise.
65 * typeck2.c: Likewise.
66 * vtable-class-hierarchy.c: Likewise.
68 2015-11-09 Cesar Philippidis <cesar@codesourcery.com>
70 * parser.c (cp_finalize_oacc_routine): New boolean first argument.
71 (cp_ensure_no_oacc_routine): Update call to cp_finalize_oacc_routine.
72 (cp_parser_simple_declaration): Maintain a boolean first to keep track
73 of each new declarator. Propagate it to cp_parser_init_declarator.
74 (cp_parser_init_declarator): New boolean first argument. Propagate it
75 to cp_parser_save_member_function_body and cp_finalize_oacc_routine.
76 (cp_parser_member_declaration): Likewise.
77 (cp_parser_single_declaration): Update call to
78 cp_parser_init_declarator.
79 (cp_parser_save_member_function_body): New boolean first_decl argument.
80 Propagate it to cp_finalize_oacc_routine.
81 (cp_parser_finish_oacc_routine): New boolean first argument. Use it to
82 determine if multiple declarators follow a routine construct.
83 (cp_parser_oacc_routine): Update call to cp_parser_finish_oacc_routine.
85 2015-10-19 Martin Sebor <msebor@redhat.com>
89 * call.c (build_operator_new_call): Do not assume size_check
90 is non-null, analogously to the top half of the function.
91 * init.c (build_new_1): Detect and diagnose array sizes in
92 excess of the maximum of roughly SIZE_MAX / 2.
93 Insert a runtime check only for arrays with a non-constant size.
94 (build_new): Detect and diagnose negative array sizes.
96 2015-11-09 Thomas Schwinge <thomas@codesourcery.com>
97 Cesar Philippidis <cesar@codesourcery.com>
98 James Norris <jnorris@codesourcery.com>
99 Julian Brown <julian@codesourcery.com>
100 Nathan Sidwell <nathan@codesourcery.com>
102 * parser.h (struct cp_parser): Add oacc_routine field.
103 * parser.c (cp_ensure_no_oacc_routine): New.
104 (cp_parser_new): Initialize oacc_routine field.
105 (cp_parser_linkage_specification): Call cp_ensure_no_oacc_routine.
106 (cp_parser_namespace_definition,
107 cp_parser_class_specifier_1): Likewise.
108 (cp_parser_init_declarator): Call cp_finalize_oacc_routine.
109 (cp_parser_function_definition,
110 cp_parser_save_member_function_body): Likewise.
111 (OACC_ROUTINE_CLAUSE_MASK): New.
112 (cp_parser_finish_oacc_routine, cp_parser_oacc_routine,
113 cp_finalize_oacc_routine): New.
114 (cp_parser_pragma): Adjust omp_declare_simd checking. Call
115 cp_ensure_no_oacc_routine.
116 (cp_parser_pragma): Add OpenACC routine handling.
118 2015-11-08 Martin Sebor <msebor@redhat.com>
121 * cp/init.c (warn_placement_new_too_small): Convert integer
122 operand of POINTER_PLUS_EXPR to ssize_t to determine its signed
125 2015-11-06 David Malcolm <dmalcolm@redhat.com>
127 * error.c (cp_printer): Update for new "caret_p" param for
128 textinfo::set_location.
129 (pedwarn_cxx98): Update for change in signature of
132 2015-11-06 Jason Merrill <jason@redhat.com>
134 Support non-type constrained-type-specifiers.
135 * parser.c (check_type_concept): Remove.
136 (cp_parser_maybe_constrained_type_specifier): Don't call it.
137 (synthesize_implicit_template_parm): Handle non-type and template
138 template parameters. Also compare extra args. Return the decl.
139 (cp_parser_template_argument): Handle constrained-type-specifiers for
140 non-type template parameters.
141 (finish_constrained_template_template_parm): Split out from
142 cp_parser_constrained_template_template_parm.
143 (cp_parser_nonclass_name): Move some logic into
144 cp_parser_maybe_concept_name.
145 (cp_parser_init_declarator): Fix error recovery.
146 (get_concept_from_constraint): Remove.
147 (cp_parser_simple_type_specifier): Adjust for
148 synthesize_implicit_template_parm returning the decl.
149 * constraint.cc (placeholder_extract_concept_and_args)
150 (equivalent_placeholder_constraints): Also handle TYPE_DECL
153 * pt.c (push_inline_template_parms_recursive): Don't recreate the
156 2015-11-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
158 * init.c (warn_placement_new_too_small): Use %wu format
159 rather than %lu when printing bytes_avail.
161 2015-11-05 Cesar Philippidis <cesar@codesourcery.com>
162 Thomas Schwinge <thomas@codesourcery.com>
163 James Norris <jnorris@codesourcery.com>
165 * parser.c (cp_parser_omp_clause_name): Add support for
166 PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
167 (cp_parser_oacc_shape_clause): Allow pointer variables as gang static
169 (cp_parser_oacc_clause_tile): New function.
170 (cp_parser_omp_clause_default): Add is_oacc argument. Handle
171 default(none) in OpenACC.
172 (cp_parser_oacc_all_clauses): Add support for
173 (cp_parser_omp_all_clauses): Update call to
174 cp_parser_omp_clause_default.
175 PRAGMA_OACC_CLAUSE_{DEFAULT,INDEPENDENT,TILE,PRIVATE,FIRSTPRIVATE}.
176 (OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
178 (OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
179 (OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
181 (cp_parser_oacc_update): Update the error message for missing clauses.
182 * semantics.c (finish_omp_clauses): Add support for
183 OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
185 2015-11-05 Martin Sebor <msebor@redhat.com>
188 * cp/init.c (warn_placement_new_too_small): Avoid assuming
189 the size of the first operand of placement new or its type
192 2015-11-05 Martin Sebor <msebor@redhat.com>
195 * cp/init.c (warn_placement_new_too_small): New function.
196 (build_new_1): Call it.
198 2015-11-05 Paolo Carlini <paolo.carlini@oracle.com>
201 * parser.c (cp_parser_lambda_body): Check lambda_return_type
203 * typeck2.c (cxx_incomplete_type_diagnostic): Print member or
204 member function used invalidly.
206 2015-11-05 Jakub Jelinek <jakub@redhat.com>
207 Ilya Verbin <ilya.verbin@intel.com>
209 * cp-tree.h (finish_omp_for): Add ORIG_INITS argument.
210 (omp_privatize_field): Add SHARED argument.
211 * parser.c: Include context.h.
212 (cp_parser_omp_clause_schedule): Parse schedule
213 modifiers, diagnose monotonic together with nonmonotonic.
214 (cp_parser_omp_clause_linear): Add DECLARE_SIMD argument. Parse
215 parameter name as linear step as id-expression rather than expression.
216 (cp_parser_omp_all_clauses): Adjust caller.
217 (cp_parser_omp_for_loop_init): Add ORIG_INIT argument,
218 initialize it. Adjust omp_privatize_field caller.
219 (cp_parser_omp_for_loop): Compute orig_inits, pass it's address
221 (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
222 (cp_parser_omp_target_data,
223 cp_parser_omp_target_enter_data,
224 cp_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER
225 and GOMP_MAP_FIRSTPRIVATE_REFERENCE.
226 (cp_parser_omp_target): Likewise. Evaluate num_teams and
227 thread_limit expressions on combined target teams before the target.
228 (cp_parser_omp_declare_target): If decl has "omp declare target" or
229 "omp declare target link" attribute, and cgraph or varpool node already
230 exists, then set corresponding flags. Call finish_omp_clauses
231 in the parenthesized extended-list syntax case. Call
232 cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol.
233 (cp_parser_omp_end_declare_target): Call cp_parser_require_pragma_eol
234 instead of cp_parser_skip_to_pragma_eol.
235 * decl2.c (cplus_decl_attributes): Don't diagnose block scope vars
236 inside declare target.
237 * pt.c (tsubst_omp_clauses): If OMP_CLAUSE_LINEAR_VARIABLE_STRIDE,
238 use tsubst_omp_clause_decl instead of tsubst_expr on
239 OMP_CLAUSE_LINEAR_STEP. Handle non-static data members in shared
241 (tsubst_omp_for_iterator): Adjust omp_privatize_field caller.
242 (tsubst_find_omp_teams): New function.
243 (tsubst_expr): Evaluate num_teams and thread_limit expressions on
244 combined target teams before the target. Use OMP_FOR_ORIG_DECLS for
245 all OpenMP/OpenACC/Cilk+ looping constructs. Adjust finish_omp_for
247 * semantics.c (omp_privatize_field): Add SHARED argument, if true,
248 always create artificial var and never put it into the hash table
250 (handle_omp_array_sections_1): Adjust omp_privatize_field caller.
251 Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections.
252 (handle_omp_array_sections): For structure element
253 based array sections use GOMP_MAP_ALWAYS_POINTER instead of
254 GOMP_MAP_FIRSTPRIVATE_POINTER. Encode low-bound into the MEM_REF,
255 either into the constant offset, or for variable low-bound using
257 (finish_omp_clauses): Adjust omp_privatize_field caller. Drop
258 generic_field_head, structure elements are now always mapped even
259 as array section bases, diagnose same var in data sharing and
260 mapping clauses. For references map what they refer to using
261 GOMP_MAP_ALWAYS_POINTER for structure elements and
262 GOMP_MAP_FIRSTPRIVATE_REFERENCE otherwise. Diagnose if linear step
263 on declare simd is neither a constant nor a uniform parameter.
264 Allow non-static data members on shared clauses. Look through
265 POINTER_PLUS_EXPR for array section reductions. Diagnose nonmonotonic
266 modifier on kinds other than dynamic or guided or nonmonotonic
267 modifier together with ordered clause. Diagnose the same var or
268 function appearing multiple times on the same directive. Fix up
269 wording for the to clause if t is neither a FUNCTION_DECL nor a
270 VAR_DECL, use special wording for OVERLOADs and TEMPLATE_ID_EXPR.
271 (handle_omp_for_class_iterator): Add ORIG_DECLS argument. Call
272 c_omp_check_loop_iv_exprs on cond.
273 (finish_omp_for): Add ORIG_INITS argument. Call
274 c_omp_check_loop_iv_exprs on ORIG_INITS elements. Adjust
275 handle_omp_for_class_iterator caller. Call c_omp_check_loop_iv.
277 (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
279 2015-11-04 Cesar Philippidis <cesar@codesourcery.com>
281 * (cp_parser_oacc_single_int_clause): New function.
282 (cp_parser_oacc_clause_vector_length): Delete.
283 (cp_parser_omp_clause_num_gangs): Delete.
284 (cp_parser_omp_clause_num_workers): Delete.
285 (cp_parser_oacc_all_clauses): Use cp_parser_oacc_single_int_clause
286 for num_gangs, num_workers and vector_length.
288 2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
290 * call.c (validate_conversion_obstack): Define unconditionally.
291 * constexpr.c (maybe_constant_value, fold_non_dependent_expr): Use
293 * cp-tree.h: Use CHECKING_P instead of ENABLE_CHECKING.
294 * decl2.c (cxx_post_compilation_parsing_cleanups): Use flag_checking.
295 * mangle.c (add_substitution): Likewise.
296 * method.c (maybe_explain_implicit_delete): Likewise.
297 * parser.c (cp_parser_template_argument_list): Remove conditional
299 * pt.c (check_unstripped_args): Rename to...
300 (verify_unstripped_args): ... this and remove conditional compilation.
301 (retrieve_specialization): Guard call of verify_unstripped_args with
303 (template_parm_to_arg): Remove conditional compilation.
304 (template_parms_to_args, coerce_template_parameter_pack,
305 coerce_template_parms): Likewise.
306 (tsubst_copy): Use flag_checking.
307 (type_unification_real): Remove conditional compilation.
308 (build_non_dependent_expr): Use flag_checking.
309 * tree.c (build_target_expr): Remove conditional compilation, use
311 * typeck.c (comptypes): Likewise.
312 * typeck2.c (digest_init_r): Likewise.
314 2015-11-03 Jason Merrill <jason@redhat.com>
316 * pt.c (struct find_parameter_pack_data): Add
317 type_pack_expansion_p field.
318 (find_parameter_packs_r): Use it to turn 'auto' into a parameter pack.
319 (uses_parameter_packs, make_pack_expansion)
320 (check_for_bare_parameter_packs, fixed_parameter_pack_p): Set it.
322 2015-11-03 Thomas Schwinge <thomas@codesourcery.com>
323 Chung-Lin Tang <cltang@codesourcery.com>
325 * parser.c (cp_parser_omp_construct, cp_parser_pragma): Handle
328 2015-10-31 Ville Voutilainen <ville.voutilainen@gmail.com>
330 Remove the implementation of N3994, terse range-for loops.
331 * parser.c (cp_parser_for_init_statement): Remove the parsing
332 of a terse range-for.
334 2015-10-31 Jason Merrill <jason@redhat.com>
336 Implement multiple 'auto' feature from Concepts TS.
337 * parser.c (cp_parser_type_id_1): Allow 'auto' if -fconcepts.
338 (cp_parser_template_type_arg): Likewise.
339 (get_concept_from_constraint): Split out most logic to...
340 * constraint.cc (placeholder_extract_concept_and_args): ...here.
341 (equivalent_placeholder_constraints, hash_placeholder_constraint): New.
342 * cxx-pretty-print.c (pp_cxx_constrained_type_spec): New.
343 * cxx-pretty-print.h: Declare it.
344 * error.c (dump_type) [TEMPLATE_TYPE_PARM]: Call it.
345 * pt.c (is_auto_r, extract_autos_r, extract_autos, auto_hash): New.
346 (type_uses_auto): Use is_auto_r.
347 (do_auto_deduction): Handle multiple 'auto's if -fconcepts.
348 * typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Compare
351 * pt.c (for_each_template_parm_r): Use WALK_SUBTREE.
352 Return a meaningful value rather than error_mark_node.
353 (for_each_template_parm): Return a tree.
354 (uses_template_parms_level): Return bool.
357 * pt.c (unify): Don't diagnose no common base if we already have
359 (do_auto_deduction): Explain deduction failure.
361 * pt.c (hash_tmpl_and_args): Use iterative_hash_object on template
364 * parser.c (synthesize_implicit_template_parm)
365 (finish_fully_implicit_template): Make static.
367 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
369 * call.c: Reorder #include's and remove duplicates.
371 * constexpr.c: Likewise.
372 * cp-array-notation.c: Likewise.
373 * cp-cilkplus.c: Likewise.
374 * cp-gimplify.c: Likewise.
375 * cp-lang.c: Likewise.
376 * cp-objcp-common.c: Likewise.
377 * cp-ubsan.c: Likewise.
379 * cxx-pretty-print.c: Likewise.
384 * except.c: Likewise.
386 * friend.c: Likewise.
388 * lambda.c: Likewise.
390 * mangle.c: Likewise.
391 * method.c: Likewise.
392 * name-lookup.c: Likewise.
393 * optimize.c: Likewise.
394 * parser.c: Likewise.
399 * search.c: Likewise.
400 * semantics.c: Likewise.
402 * typeck.c: Likewise.
403 * typeck2.c: Likewise.
404 * vtable-class-hierarchy.c: Likewise.
406 2015-10-29 Paolo Carlini <paolo.carlini@oracle.com>
409 * decl.c (grokfndecl): In case of erroneous cv-qualified non-member
410 functions consistently reset TREE_TYPE (decl) too.
412 2015-10-28 Jason Merrill <jason@redhat.com>
415 * class.c (type_has_user_provided_or_explicit_constructor): New.
416 (check_bases_and_members): Use it.
417 * cp-tree.h: Declare it.
419 2015-10-27 Cesar Philippidis <cesar@codesourcery.com>
420 Thomas Schwinge <thomas@codesourcery.com>
421 James Norris <jnorris@codesourcery.com>
422 Joseph Myers <joseph@codesourcery.com>
423 Julian Brown <julian@codesourcery.com>
424 Nathan Sidwell <nathan@codesourcery.com>
425 Bernd Schmidt <bschmidt@redhat.com>
427 * parser.c (cp_parser_omp_clause_name): Add auto, gang, seq,
429 (cp_parser_oacc_simple_clause): New.
430 (cp_parser_oacc_shape_clause): New.
431 (cp_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
432 (OACC_LOOP_CLAUSE_MASK): Likewise.
433 * semantics.c (finish_omp_clauses): Add auto, gang, seq, vector,
434 worker. Unify the handling of teams, tasks and vector_length with
435 the other loop shape clauses.
437 2015-10-27 Thomas Schwinge <thomas@codesourcery.com>
438 James Norris <jnorris@codesourcery.com>
439 Cesar Philippidis <cesar@codesourcery.com>
443 * cp-tree.h (finish_oacc_kernels, finish_oacc_parallel): Don't
445 (finish_omp_construct): Declare function.
446 * parser.c (cp_parser_oacc_loop): Add p_name, mask, cclauses
447 formal parameters, and handle these. Adjust all users.
448 (cp_parser_oacc_kernels, cp_parser_oacc_parallel): Merge functions
450 (cp_parser_oacc_kernels_parallel): ... this new function. Adjust
452 * semantics.c (finish_oacc_kernels, finish_oacc_parallel): Merge functions into...
453 (finish_omp_construct): ... this new function.
455 2015-10-25 Jason Merrill <jason@redhat.com>
458 * pt.c (process_partial_specialization): Handle error_mark_node
459 from most_specialized_partial_spec.
461 2015-10-23 Jason Merrill <jason@redhat.com>
467 * call.c (convert_like_real): Value-initialization can't use
468 explicit constructors in C++11 and up.
471 * constexpr.c (cxx_eval_store_expression): Always use *valp if
474 2015-10-22 Jason Merrill <jason@redhat.com>
476 * call.c (add_template_conv_candidate): Pass DEDUCE_CALL.
477 (add_template_candidate_real): Handle it.
478 * pt.c (fn_type_unification): Handle it.
480 * call.c (add_conv_candidate): Remove first_arg parm.
481 (add_template_conv_candidate): Likewise.
482 (add_template_candidate_real): Don't pass it.
483 (build_op_call_1): Likewise.
485 2015-10-22 Richard Biener <rguenther@suse.de>
487 * semantics.c (cp_finish_omp_clause_depend_sink): Properly convert
488 before folding a MINUS_EXPR.
489 (finish_omp_clauses): Likewise.
491 2015-10-21 Paolo Carlini <paolo.carlini@oracle.com>
494 * parser.c (cp_parser_enum_specifier): Upon error_at set
495 nested_name_specifier to error_mark_node; improve error message.
497 2015-10-21 Paolo Carlini <paolo.carlini@oracle.com>
500 * parser.c (cp_parser_enum_specifier): Reject a nested_name_specifier
501 which doesn't name a class or namespace.
503 2015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
505 * call.c (build_conditional_expr_1): Use boolean vector
506 type for vector comparison.
507 * typeck.c (build_vec_cmp): New.
508 (cp_build_binary_op): Use build_vec_cmp for comparison.
510 2015-10-20 Jason Merrill <jason@redhat.com>
513 * init.c (innermost_aggr_scope): New.
514 (build_field_list): Change uses_unions_p to uses_unions_or_anon_p.
515 (sort_mem_initializers): Handle initializers for entire anonymous
518 2015-10-20 Marek Polacek <polacek@redhat.com>
520 * parser.c (is_cilkplus_vector_p): Don't define here.
522 2015-10-19 Jason Merrill <jason@redhat.com>
525 * semantics.c (force_paren_expr): Don't mess with hard register vars.
527 Implement N4268, Do constant evaluation of all non-type template args.
528 * parser.c (cp_parser_template_argument): For C++1z just parse a
530 * pt.c (convert_nontype_argument): For C++1z always call
531 maybe_constant_value.
533 * constexpr.c (cxx_eval_constant_expression): Expand PTRMEM_CST
535 (cxx_eval_component_reference): Like here.
536 * decl2.c (lower_var_init): And here.
537 (c_parse_final_cleanups): Call it.
538 * typeck2.c (digest_init_r): Not here.
539 * decl.c (complete_vars): Or here.
540 (cp_finish_decl): Add local statics to symbol table.
542 2015-10-17 Jason Merrill <jason@redhat.com>
545 * decl.c (implicit_default_ctor_p): New.
546 (start_preparsed_function): Don't clobber on entry to one.
548 2015-10-16 Paolo Carlini <paolo.carlini@oracle.com>
551 * constexpr.c (potential_constant_expression_1): Handle
552 UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR, BINARY_LEFT_FOLD_EXPR,
553 BINARY_RIGHT_FOLD_EXPR.
555 2015-10-13 Jakub Jelinek <jakub@redhat.com>
556 Aldy Hernandez <aldyh@redhat.com>
558 * class.c (finish_struct_1): Call finish_omp_declare_simd_methods.
559 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_TASKLOOP.
560 (cp_genericize_r): Likewise.
561 (cxx_omp_finish_clause): Don't diagnose references.
562 (cxx_omp_disregard_value_expr): New function.
563 * cp-objcp-common.h (LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR): Redefine.
564 * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Document for OMP_TASKLOOP.
565 (DECL_OMP_PRIVATIZED_MEMBER): Define.
566 (finish_omp_declare_simd_methods, push_omp_privatization_clauses,
567 pop_omp_privatization_clauses, save_omp_privatization_clauses,
568 restore_omp_privatization_clauses, omp_privatize_field,
569 cxx_omp_disregard_value_expr): New prototypes.
570 (finish_omp_clauses): Add two new arguments.
571 (finish_omp_for): Add ORIG_DECLV argument.
572 * parser.c (cp_parser_lambda_body): Call
573 save_omp_privatization_clauses and restore_omp_privatization_clauses.
574 (cp_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
575 (cp_parser_omp_var_list_no_open): Handle structure elements for
576 map, to and from clauses. Handle array sections in reduction
577 clause. Parse this keyword. Formatting fixes.
578 (cp_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
580 (cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize,
581 cp_parser_omp_clause_priority, cp_parser_omp_clause_hint,
582 cp_parser_omp_clause_defaultmap): New functions.
583 (cp_parser_omp_clause_ordered): Parse optional parameter.
584 (cp_parser_omp_clause_reduction): Handle array reductions.
585 (cp_parser_omp_clause_schedule): Parse optional simd modifier.
586 (cp_parser_omp_clause_nogroup, cp_parser_omp_clause_orderedkind):
588 (cp_parser_omp_clause_linear): Parse linear clause modifiers.
589 (cp_parser_omp_clause_depend_sink): New function.
590 (cp_parser_omp_clause_depend): Parse source/sink depend kinds.
591 (cp_parser_omp_clause_map): Parse release/delete map kinds and
592 optional always modifier.
593 (cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_if
594 and finish_omp_clauses callers.
595 (cp_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
596 Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
597 (OMP_CRITICAL_CLAUSE_MASK): Define.
598 (cp_parser_omp_critical): Parse critical clauses.
599 (cp_parser_omp_for_incr): Use cp_tree_equal if
600 processing_template_decl.
601 (cp_parser_omp_for_loop_init): Return tree instead of bool. Handle
602 non-static data member iterators.
603 (cp_parser_omp_for_loop): Handle doacross loops, adjust
604 finish_omp_for and finish_omp_clauses callers.
605 (cp_omp_split_clauses): Adjust finish_omp_clauses caller.
606 (OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
607 (cp_parser_omp_simd): Allow ordered clause if it has no parameter.
608 (OMP_FOR_CLAUSE_MASK): Add linear clause.
609 (cp_parser_omp_for): Disallow ordered clause when combined with
610 distribute. Disallow linear clause when combined with distribute
611 and not combined with simd.
612 (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
613 (cp_parser_omp_ordered): Add CONTEXT argument, return bool instead
614 of tree, parse clauses and if depend clause is found, don't parse
616 (cp_parser_omp_parallel): Disallow copyin clause on target parallel.
617 Allow target parallel without for after it.
618 (OMP_TASK_CLAUSE_MASK): Add priority clause.
619 (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
620 (cp_parser_omp_target_data): Diagnose no map clauses or clauses with
622 (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
623 (OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
624 OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
625 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): New
627 (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
628 defaultmap and is_device_ptr clauses.
629 (cp_parser_omp_target): Parse target parallel and target simd. Set
630 OMP_TARGET_COMBINED on combined constructs. Parse target enter data
631 and target exit data. Diagnose invalid map kinds.
632 (cp_parser_oacc_cache): Adjust finish_omp_clauses caller.
633 (OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
634 (cp_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
636 (OMP_TASKLOOP_CLAUSE_MASK): Define.
637 (cp_parser_omp_taskloop): New function.
638 (cp_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
639 handle PRAGMA_OMP_TASKLOOP.
640 (cp_parser_pragma): Handle PRAGMA_OMP_ORDERED here directly,
641 handle PRAGMA_OMP_TASKLOOP, call push_omp_privatization_clauses
642 and pop_omp_privatization_clauses around parsing calls.
643 (cp_parser_cilk_for): Adjust finish_omp_clauses caller.
644 * pt.c (apply_late_template_attributes): Adjust tsubst_omp_clauses
645 and finish_omp_clauses callers.
646 (tsubst_omp_clause_decl): Return NULL if decl is NULL.
647 For TREE_LIST, copy over OMP_CLAUSE_DEPEND_SINK_NEGATIVE bit.
648 Use tsubst_expr instead of tsubst_copy, undo convert_from_reference
650 (tsubst_omp_clauses): Add ALLOW_FIELDS argument. Handle new
651 OpenMP 4.5 clauses. Use tsubst_omp_clause_decl for more clauses.
652 If ALLOW_FIELDS, handle non-static data members in the clauses.
653 Clear OMP_CLAUSE_LINEAR_STEP if it has been cleared before.
654 (omp_parallel_combined_clauses): New variable.
655 (tsubst_omp_for_iterator): Add ORIG_DECLV argument, recur on
656 OMP_FOR_ORIG_DECLS, handle non-static data member iterators.
657 Improve handling of clauses on combined constructs.
658 (tsubst_expr): Call push_omp_privatization_clauses and
659 pop_omp_privatization_clauses around instantiation of certain
660 OpenMP constructs, improve handling of clauses on combined
661 constructs, handle OMP_TASKLOOP, adjust tsubst_omp_for_iterator,
662 tsubst_omp_clauses and finish_omp_for callers, handle clauses on
663 critical and ordered, handle OMP_TARGET_{ENTER,EXIT}_DATA.
664 (instantiate_decl): Call save_omp_privatization_clauses and
665 restore_omp_privatization_clauses around instantiation.
666 (dependent_omp_for_p): Fix up comment typo. Handle SCOPE_REF.
667 * semantics.c (omp_private_member_map, omp_private_member_vec,
668 omp_private_member_ignore_next): New variables.
669 (finish_non_static_data_member): Return dummy decl for privatized
670 non-static data members.
671 (omp_clause_decl_field, omp_clause_printable_decl,
672 omp_note_field_privatization, omp_privatize_field): New functions.
673 (handle_omp_array_sections_1): Fix comment typo.
674 Add IS_OMP argument, handle structure element bases, diagnose
675 bitfields, pass IS_OMP recursively, diagnose known zero length
676 array sections in depend clauses, handle array sections in reduction
677 clause, diagnose negative length even for pointers.
678 (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
679 types, pass IS_OMP down to handle_omp_array_sections_1, handle
680 array sections in reduction clause, set
681 OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
682 length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
683 (finish_omp_reduction_clause): Handle array sections and arrays.
684 Use omp_clause_printable_decl.
685 (finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink):
687 (finish_omp_clauses): Add ALLOW_FIELDS and DECLARE_SIMD arguments.
688 Handle new OpenMP 4.5 clauses and new restrictions for the old
689 ones, handle non-static data members, reject this keyword when not
691 (push_omp_privatization_clauses, pop_omp_privatization_clauses,
692 save_omp_privatization_clauses, restore_omp_privatization_clauses):
694 (handle_omp_for_class_iterator): Handle OMP_TASKLOOP class iterators.
695 Add collapse and ordered arguments. Fix handling of lastprivate
696 iterators in doacross loops.
697 (finish_omp_for): Add ORIG_DECLV argument, handle doacross loops,
698 adjust c_finish_omp_for, handle_omp_for_class_iterator and
699 finish_omp_clauses callers. Fill in OMP_CLAUSE_LINEAR_STEP on simd
700 loops with non-static data member iterators.
702 2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
705 * lambda.c (lambda_return_type): Return error_mark_node
706 instead of void_type_node for the error cases.
708 2015-10-08 Jason Merrill <jason@redhat.com>
710 * cp-tree.h (SIMPLE_TARGET_EXPR_P): New.
711 * init.c (get_nsdmi): Use it.
712 * typeck2.c (massage_init_elt): Use it.
714 2015-10-07 Jason Merrill <jason@redhat.com>
717 * call.c (is_base_field_ref): New.
718 (unsafe_copy_elision_p): New.
719 (build_over_call): Use it.
721 2015-10-07 Marek Polacek <polacek@redhat.com>
724 * search.c (accessible_p): Initialize OTYPE to NULL_TREE.
726 2015-10-07 Marek Polacek <polacek@redhat.com>
728 * cp-gimplify.c (genericize_if_stmt): Use protected_set_expr_location.
729 (genericize_cp_loop): Likewise.
730 * decl.c (cxx_maybe_build_cleanup): Likewise.
731 * parser.c (cp_parser_binary_expression): Likewise.
732 (cp_parser_omp_for_loop): Likewise.
733 (cp_parser_omp_construct): Likewise.
734 * semantics.c (finish_transaction_stmt): Likewise.
735 (build_transaction_expr): Likewise.
737 2015-10-06 Jason Merrill <jason@redhat.com>
740 * parser.c (cp_parser_fold_expr_p): Remove.
742 (cp_parser_fold_expression): Take LHS as parameter.
743 (cp_parser_primary_expression): Call it after parsing an expression.
744 (cp_parser_binary_expression, cp_parser_assignment_operator_opt)
745 (cp_parser_expression): Ignore an operator followed by '...'.
747 * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
748 (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle errors.
750 2015-10-06 Marek Polacek <polacek@redhat.com>
753 * call.c (build_conditional_expr_1): Build the COND_EXPR with
756 2015-10-05 Paolo Carlini <paolo.carlini@oracle.com>
759 * pt.c (check_default_tmpl_args): Per [temp.param]/9, do not
760 reject default template arguments in out of class definitions
761 of members of non-template classes.
763 2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
765 * tree.c (cp_tree_equal): Use real_equal instead of
768 2015-10-04 Jason Merrill <jason@redhat.com>
770 Implement N4514, C++ Extensions for Transactional Memory.
771 * cp-tree.h (struct cp_declarator): Add tx_qualifier field.
772 (BCS_NORMAL, BCS_TRANSACTION): New enumerators.
773 * lex.c (init_reswords): Limit TM kewords to -fgnu-tm.
774 * parser.c (cp_lexer_get_preprocessor_token): Fix @synchronized.
775 (make_call_declarator): Take tx_qualifier.
776 (cp_parser_tx_qualifier_opt): New.
777 (cp_parser_lambda_declarator_opt): Use it.
778 (cp_parser_direct_declarator): Likewise.
779 (cp_parser_statement): Handle atomic_noexcept, atomic_cancel.
780 (cp_parser_compound_statement): Change in_try parameter to bcs_flags.
781 (cp_parser_std_attribute): Map optimize_for_synchronized to
782 transaction_callable.
783 (cp_parser_transaction): Take the token. Handle atomic_noexcept.
784 * lambda.c (maybe_add_lambda_conv_op): Handle transaction-safety.
785 * call.c (enum conversion_kind): Add ck_tsafe.
786 (standard_conversion): Handle transaction-safety conversion.
787 (convert_like_real, resolve_address_of_overloaded_function): Likewise.
788 (check_methods): Diagnose transaction_safe_dynamic on non-virtual
790 (look_for_tm_attr_overrides): Don't inherit transaction_safe_dynamic.
791 * cvt.c (tx_safe_fn_type_p, tx_unsafe_fn_variant)
792 (can_convert_tx_safety): New.
793 * typeck.c (composite_pointer_type): Handle transaction-safety.
794 * name-lookup.h (enum scope_kind): Add sk_transaction.
795 * name-lookup.c (begin_scope): Handle it.
796 * semantics.c (begin_compound_stmt): Pass it.
797 * decl.c (check_previous_goto_1): Check it.
798 (struct named_label_entry): Add in_transaction_scope.
799 (poplevel_named_label_1): Set it.
800 (check_goto): Check it.
801 (duplicate_decls): A specialization can be transaction_safe
802 independently of its template.
803 (grokdeclarator): Handle tx-qualifier.
804 * rtti.c (ptr_initializer): Handle transaction-safe.
805 * search.c (check_final_overrider): Check transaction_safe_dynamic.
806 Don't check transaction_safe.
807 * mangle.c (write_function_type): Mangle transaction_safe here.
808 (write_CV_qualifiers_for_type): Not here.
809 (write_type): Preserve transaction_safe when stripping attributes.
810 * error.c (dump_type_suffix): Print transaction_safe.
812 2015-10-02 Marek Polacek <polacek@redhat.com>
815 * parser.c (cp_parser_statement): Add CHAIN parameter and pass it
816 down to cp_parser_selection_statement.
817 (cp_parser_selection_statement): Add CHAIN parameter. Add code to
818 warn about duplicated if-else-if conditions.
819 (cp_parser_implicitly_scoped_statement): Add CHAIN parameter and pass
820 it down to cp_parser_statement.
822 2015-10-01 Ville Voutilainen <ville.voutilainen@gmail.com>
825 * name-lookup.c (push_binding): Make non-static.
826 * name-lookup.h (push_binding): Declare it.
827 * parser.c (cp_parser_range_for): Use it, get the range
828 declaration away from the scope until the range expression
829 has been parsed, then restore the declaration.
831 2015-09-23 Ville Voutilainen <ville.voutilainen@gmail.com>
833 Fix small typos in the coding rule enforcement warnings.
834 * parser.c (cp_parser_namespace_definition): Replace 'namepace'
837 2015-09-22 Nathan Sidwell <nathan@codesourcery.com>
839 * decl.c (xref_basetypes): Check virtual and/or multiple
841 * parser.c (cp_parser_namespace_definition): Check namespaces
843 * pt.c (push_template_decl_real): Check templates warning.
845 2015-09-22 Jason Merrill <jason@redhat.com>
847 * mangle.c (abi_warn_or_compat_version_crosses): New.
848 Use it instead of abi_version_crosses.
849 (mangle_decl): Deal with -fabi-compat-version and -Wabi separately.
851 2015-09-21 Ville Voutilainen <ville.voutilainen@gmail.com>
853 Complete the implementation of N4230, Nested namespace definition.
854 * parser.c (cp_parser_namespace_definition): Support namespace
855 attributes both before and after the namespace identifier.
857 2015-09-19 Trevor Saunders <tbsaunde@tbsaunde.org>
859 * cp-gimplify.c (gimplify_must_not_throw_expr): Adjust.
861 2015-09-18 Ville Voutilainen <ville.voutilainen@gmail.com>
863 Implement nested namespace definitions.
864 * parser.c (cp_parser_namespace_definition): Grok nested namespace
867 2015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
869 * parser.c (pragma_lex): Add loc argument. Rearrange the code to
870 make it more similar to the C version.
872 2015-09-17 Andrew Sutton <andrew.n.sutton@gmail.com>
873 Jason Merrill <jason@redhat.com>
875 Implement N4295 fold-expressions.
876 * cp-tree.def: Add UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR,
877 BINARY_LEFT_FOLD_EXPR, BINARY_RIGHT_FOLD_EXPR.
878 * cp-objcp-common.c (cp_common_init_ts): Handle them.
879 * cp-tree.h (FOLD_EXPR_CHECK, BINARY_FOLD_EXPR_CHECK, FOLD_EXPR_P)
880 (FOLD_EXPR_MODIFY_P, FOLD_EXPR_OP, FOLD_EXPR_PACK, FOLD_EXPR_INIT): New.
881 * parser.c (cp_parser_skip_to_closing_parenthesis): Split out...
882 (cp_parser_skip_to_closing_parenthesis_1): This function. Change
883 or_comma parameter to or_ttype.
884 (cp_parser_fold_operator, cp_parser_fold_expr_p)
885 (cp_parser_fold_expression): New.
886 (cp_parser_primary_expression): Use them.
887 * pt.c (expand_empty_fold, fold_expression, tsubst_fold_expr_pack)
888 (tsubst_fold_expr_init, expand_left_fold, tsubst_unary_left_fold)
889 (tsubst_binary_left_fold, expand_right_fold)
890 (tsubst_unary_right_fold, tsubst_binary_right_fold): New.
891 (tsubst_copy): Use them.
892 (type_dependent_expression_p): Handle fold-expressions.
893 * semantics.c (finish_unary_fold_expr)
894 (finish_left_unary_fold_expr, finish_right_unary_fold_expr)
895 (finish_binary_fold_expr): New.
897 2015-09-17 Richard Biener <rguenther@suse.de>
899 * cp-tree.h (note_decl_for_pch): Remove.
900 * class.c (build_clone): Do not call note_decl_for_pch.
901 * semantics.c (finish_member_declaration): Likewise.
902 (note_decl_for_pch): Remove.
903 * decl2.c (c_parse_final_cleanups): Mangle all globals before
906 2015-09-14 Jason Merrill <jason@redhat.com>
909 * mangle.c (write_CV_qualifiers_for_type): Also warn about regparm
910 mangling with lower -fabi-version.
912 2015-09-14 Paolo Carlini <paolo.carlini@oracle.com>
915 * parser.c (cp_parser_new_expression): Enforce 5.3.4/2 (as amended
916 per the spirit of DR 1467).
918 2015-09-11 Mark Wielaard <mjw@redhat.com>
921 * cp-objcp-common.c (cxx_warn_unused_global_decl): Remove hard-coded
922 VAR_P TREE_READONLY override.
924 2015-09-10 Paolo Carlini <paolo.carlini@oracle.com>
927 * parser.c (cp_parser_parameter_declaration): Consume the ellipsis
928 and set template_parameter_pack_p also when the type is null.
930 2015-09-09 Mark Wielaard <mjw@redhat.com>
932 * typeck.c (cp_build_binary_op): Check and warn when nonnull arg
935 2015-09-10 Jakub Jelinek <jakub@redhat.com>
938 * semantics.c (handle_omp_array_sections_1): Only run
939 type_dependent_expression_p on VAR_DECL/PARM_DECLs.
940 (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Likewise.
941 Don't adjust OMP_CLAUSE_LINEAR_STEP if OMP_CLAUSE_DECL
942 is not a VAR_DECL/PARM_DECL.
945 * semantics.c (handle_omp_for_class_iterator): Don't wrap
946 error_mark_node into a NOP_EXPR to void_type_node.
948 2015-09-09 Paolo Carlini <paolo.carlini@oracle.com>
951 * decl2.c (constrain_class_visibility): Use Wsubobject-linkage.
953 2015-09-09 Jakub Jelinek <jakub@redhat.com>
956 * parser.c (cp_parser_omp_clause_collapse): Test tree_fits_shwi_p
957 before INTEGRAL_TYPE_P test.
959 2015-09-08 Jason Merrill <jason@redhat.com>
962 * pt.c (tsubst_copy_and_build): Handle variables like functions.
964 2015-09-08 Paolo Carlini <paolo.carlini@oracle.com>
967 * pt.c (tsubst_copy, [case FUNCTION_DECL]): Do not call tsubst
968 if the first argument isn't a template.
970 2015-09-03 Martin Sebor <msebor@redhat.com>
973 * cp-tree.h (mark_rvalue_use, decay_conversion): Add new
975 * expr.c (mark_rvalue_use): Use new argument.
976 * call.c (build_addr_func): Call decay_conversion with new
978 * pt.c (convert_template_argument): Call reject_gcc_builtin.
979 * typeck.c (decay_conversion): Use new argument.
980 (c_decl_implicit): Define.
982 2015-09-02 Balaji V. Iyer <balaji.v.iyer@intel.com>
985 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): New
987 (cp_gimplify_expr): Added a call to the function
988 cilk_cp_gimplify_call_params_in_spawned_fn.
990 2015-09-01 Paolo Carlini <paolo.carlini@oracle.com>
993 * decl.c (smallest_type_quals_location): New.
994 (check_special_function_return_type): Use the latter; add int and
995 const location_t* parameters.
996 (grokdeclarator): Adjust check_special_function_return_type call.
998 2015-08-29 Markus Trippelsdorf <markus@trippelsdorf.de>
1001 * constexpr.c (potential_constant_expression_1): Remove IF_STMT
1002 case. Move label to COND_EXPR case. Remove checking of
1005 2015-08-22 Paolo Carlini <paolo.carlini@oracle.com>
1008 * pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE
1009 only on class types.
1011 2015-08-21 Jason Merrill <jason@redhat.com>
1014 * constraint.cc (satisfy_implicit_conversion_constraint): Also
1015 check for NULL_TREE.
1017 2015-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1019 * decl.c (grokvardecl): Simplify the latter.
1021 2015-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1023 * decl.c (grokvardecl): Complete check added for c++/67065.
1025 2015-08-20 Jason Merrill <jason@redhat.com>
1027 * name-lookup.c (hidden_name_p): Handle OVERLOAD.
1029 2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
1032 * decl.c (grokvardecl): Reject 'main' as global variable.
1034 2015-08-19 Jason Merrill <jason@redhat.com>
1037 * search.c (protected_accessible_p): Remove redundant access_in_type.
1038 Add otype parm instead of walking binfo.
1039 (friend_accessible_p): Check SCOPE itself. Handle class
1040 templates. Pass through otype.
1041 (dfs_accessible_post): Handle all accessibility cases.
1042 (dfs_accessible_pre): New.
1043 (accessible_p): Use it. Don't check protected access here. Pass
1044 decl and otype to dfs_walk.
1045 (member_declared_in_type, dfs_access_in_type_pre): New.
1046 (access_in_type): Use dfs_access_in_type_pre.
1047 * friend.c (add_friend): Fix multiple friends with the same name.
1049 * lambda.c (current_nonlambda_scope): New.
1051 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
1053 * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c,
1054 method.c, name-lookup.h, parser.c, parser.h, rtti.c,
1055 semantics.c, typeck2.c: Remove useless typedefs.
1057 2015-08-18 Jason Merrill <jason@redhat.com>
1060 * pt.c (convert_nontype_argument): Allow internal linkage in C++11
1063 2015-08-17 Paolo Carlini <paolo.carlini@oracle.com>
1066 * call.c (null_ptr_cst_p): In C++11 return 'false' for 'false'.
1068 2015-08-17 Jason Merrill <jason@redhat.com>
1071 * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies.
1074 * constexpr.c (array_index_cmp, find_array_ctor_elt): New.
1075 (cxx_eval_array_reference, cxx_eval_store_expression): Use them.
1077 * constexpr.c (cxx_eval_store_expression): Don't set
1078 CONSTRUCTOR_NO_IMPLICIT_ZERO if we have an enclosing CONSTRUCTOR
1080 (cxx_eval_array_reference): Check it.
1082 * except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P.
1084 2015-08-14 Jason Merrill <jason@redhat.com>
1087 * decl2.c (mark_vtable_entries): Suppress -Wdeprecated.
1089 2015-08-12 Jason Merrill <jason@redhat.com>
1092 * constexpr.c (cxx_eval_array_reference): Fix typo.
1095 * constexpr.c (cxx_eval_array_reference): Handle sparse
1099 * decl2.c (c_parse_final_cleanups): Set at_eof to 2 at end.
1100 * error.c (dump_template_bindings): Don't tsubst in that case.
1103 * error.c (dump_decl) [TEMPLATE_ID_EXPR]: Pass
1104 TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS.
1106 2015-08-08 Jason Merrill <jason@redhat.com>
1109 * pt.c (process_partial_specialization): Call
1110 associate_classtype_constraints.
1113 * constraint.cc (finish_template_introduction):
1114 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
1117 * pt.c (equal): Make sure tmpl is actually a template.
1120 * call.c (joust): Only call more_constrained on decls.
1122 2015-08-06 Andrew Sutton <andrew.n.sutton@gmail.com>
1123 Braden Obrzut <admin@maniacsvault.net>
1124 Jason Merrill <jason@redhat.com>
1125 Ville Voutilainen <ville.voutilainen@gmail.com>
1127 Add C++ Concepts TS support.
1128 * constraint.cc, logic.cc: New files.
1129 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o.
1130 (c++.tags): Also process .cc files.
1131 * call.c (enum rejection_reason_code): Add rr_constraint_failure.
1132 (print_z_candidate): Handle it.
1133 (constraint_failure): New.
1134 (add_function_candidate): Check constraints.
1135 (build_new_function_call): Handle evaluating concepts.
1136 (joust): Check more_constrained.
1137 * class.c (add_method): Check equivalently_constrained.
1138 (build_clone): Copy constraints.
1139 (currently_open_class): Return tree.
1140 (resolve_address_of_overloaded_function): Check constraints.
1141 * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR.
1142 (potential_constant_expression_1): Likewise.
1143 * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO.
1144 (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR.
1145 * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR,
1146 SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR,
1147 EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR,
1148 EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR.
1149 * cp-tree.h (struct tree_constraint_info, check_nonnull)
1150 (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS)
1151 (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS)
1152 (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS)
1153 (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P)
1154 (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR)
1155 (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE)
1156 (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN)
1157 (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS)
1158 (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT)
1159 (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE)
1160 (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated)
1161 (struct local_specialization_stack, enum auto_deduction_context)
1162 (variable_concept_p, concept_template_p)
1163 (struct deferring_access_check_sentinel): New.
1164 (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO.
1165 (union lang_tree_node): Add constraint_info field.
1166 (struct lang_decl_base): Add concept_p flag.
1167 (enum cp_decl_spec): Add ds_concept.
1168 (struct cp_declarator): Add requires_clause.
1169 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
1170 (cxx_pretty_printer::expression): Handle REQUIRES_EXPR,
1171 TRAIT_EXPR, *_CONSTR.
1172 (pp_cxx_parameter_declaration_clause): Accept a chain of
1174 (cxx_pretty_printer::declarator): Print requires-clause.
1175 (pp_cxx_template_declaration): Likewise.
1176 (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS.
1177 (pp_cxx_requires_clause, pp_cxx_requirement)
1178 (pp_cxx_requirement_list, pp_cxx_requirement_body)
1179 (pp_cxx_requires_expr, pp_cxx_simple_requirement)
1180 (pp_cxx_type_requirement, pp_cxx_compound_requirement)
1181 (pp_cxx_nested_requirement, pp_cxx_predicate_constraint)
1182 (pp_cxx_expression_constraint, pp_cxx_type_constraint)
1183 (pp_cxx_implicit_conversion_constraint)
1184 (pp_cxx_argument_deduction_constraint)
1185 (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint)
1186 (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New.
1187 * cxx-pretty-print.h: Declare them.
1188 * decl.c (decls_match): Compare constraints.
1189 (duplicate_decls): Likewise. Remove constraints before freeing.
1190 (cxx_init_decl_processing): Call init_constraint_processing.
1191 (cp_finish_decl): Diagnose concept without initializer.
1192 (grokfndecl, grokvardecl): Handle concepts and constraints.
1193 (grokdeclarator): Handle concept, requires-clause.
1194 (grokparms): No longer static.
1195 (xref_tag_1): Check constraints.
1196 (finish_function): Call check_function_concept.
1197 (cp_tree_node_structure): Handle CONSTRAINT_INFO.
1198 (check_concept_refinement, is_concept_var, check_concept_fn): New.
1199 * decl2.c (check_classfn): Compare constraints.
1200 (mark_used): Don't instantiate concepts.
1201 * error.c (dump_template_decl): Print constraints.
1202 (dump_function_decl): Likewise.
1203 (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR.
1204 * lex.c (init_reswords): Set D_CXX_CONCEPTS.
1205 * method.c (implicitly_declare_fn): Copy constraints from
1207 * parser.h (struct cp_parser): Add in_result_type_constraint_p and
1208 prevent_constrained_type_specifiers fields.
1209 * parser.c (make_call_declarator): Add requires_clause parm.
1210 (cp_parser_new): Clear prevent_constrained_type_specifiers.
1211 (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES.
1212 (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers.
1213 (cp_parser_trait_expr): Handle RID_IS_SAME_AS.
1214 (cp_parser_declaration): Handle concept introduction.
1215 (cp_parser_member_declaration): Likewise.
1216 (cp_parser_template_parameter): Handle constrained parameter.
1217 (cp_parser_type_parameter): Handle constraints.
1218 (cp_parser_decl_specifier_seq): Handle RID_CONCEPT.
1219 (cp_parser_template_id): Handle partial concept id.
1220 (cp_parser_type_name): Add overload that takes typename_keyword_p.
1221 Handle constrained parameter.
1222 (cp_parser_nonclass_name): Handle concept names.
1223 (cp_parser_alias_declaration): Handle constraints.
1224 (cp_parser_late_return_type_opt): Also handle requires-clause.
1225 (cp_parser_type_id_1): Handle deduction constraint.
1226 (cp_parser_parameter_declaration): Handle constrained parameters.
1227 (cp_parser_class_specifier_1): Handle constraints.
1228 (cp_parser_template_declaration_after_parameters): Split out from
1229 cp_parser_template_declaration_after_export.
1230 (cp_parser_single_declaration): Handle constraints.
1231 (synthesize_implicit_template_parm): Handle constraints.
1232 (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id)
1233 (cp_parser_introduction_list, get_id_declarator)
1234 (get_unqualified_id, is_constrained_parameter)
1235 (cp_parser_check_constrained_type_parm)
1236 (cp_parser_constrained_type_template_parm)
1237 (cp_parser_constrained_template_template_parm)
1238 (constrained_non_type_template_parm, finish_constrained_parameter)
1239 (declares_constrained_type_template_parameter)
1240 (declares_constrained_template_template_parameter)
1241 (check_type_concept, cp_parser_maybe_constrained_type_specifier)
1242 (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id)
1243 (cp_parser_requires_clause, cp_parser_requires_clause_opt)
1244 (cp_parser_requires_expression)
1245 (cp_parser_requirement_parameter_list, cp_parser_requirement_body)
1246 (cp_parser_requirement_list, cp_parser_requirement)
1247 (cp_parser_simple_requirement, cp_parser_type_requirement)
1248 (cp_parser_compound_requirement, cp_parser_nested_requirement)
1249 (cp_parser_template_introduction)
1250 (cp_parser_explicit_template_declaration)
1251 (get_concept_from_constraint): New.
1252 * pt.c (local_specialization_stack): Implement.
1253 (maybe_new_partial_specialization): New.
1254 (maybe_process_partial_specialization): Use it.
1255 (retrieve_local_specialization, register_local_specialization)
1256 (template_parm_to_arg, build_template_decl, extract_fnparm_pack)
1257 (tsubst_expr): No longer static.
1258 (spec_hasher::equal): Compare constraints.
1259 (determine_specialization): Handle constraints.
1260 (check_explicit_specialization): Handle concepts.
1261 (process_template_parm): Handle constraints.
1262 (end_template_parm_list): Add overload taking no arguments.
1263 (process_partial_specialization): Handle concepts and constraints.
1264 Register partial specializations of variable templates.
1265 (redeclare_class_template): Handle constraints.
1266 (convert_template_argument): Handle WILDCARD_DECL. Check
1267 is_compatible_template_arg.
1268 (coerce_template_parameter_pack): Handle wildcard packs.
1269 (coerce_template_parms): DR 1430 also applies to concepts. Add
1270 overloads taking fewer parameters.
1271 (lookup_template_class_1): Handle constraints.
1272 (lookup_template_variable): Concepts are always bool.
1273 (finish_template_variable): Handle concepts and constraints.
1274 (tsubst_friend_class): Handle constraints.
1275 (gen_elem_of_pack_expansion_instantiation): Handle constraints.
1276 (tsubst_pack_expansion): Handle local parameters.
1277 (tsubst_decl) [FUNCTION_DECL]: Handle constraints.
1278 (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints.
1279 (tsubst_copy_and_build): Handle REQUIRES_EXPR.
1280 (more_specialized_fn, more_specialized_partial_spec): Check constraints.
1281 (more_specialized_inst): Split out from most_specialized_instantiation.
1282 (most_specialized_partial_spec): Check constraints.
1283 (instantiate_decl): Never instantiate a concept.
1284 (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ,
1286 (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR.
1287 (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts.
1288 (do_auto_deduction): Add overload taking tsubst flags and context enum.
1290 (get_template_for_ordering, most_constrained_function)
1291 (is_compatible_template_arg, convert_wildcard_argument)
1292 (struct constr_entry, struct constr_hasher, decl_constraints)
1293 (valid_constraints_p, get_constraints, set_constraints)
1294 (remove_constraints, init_constraint_processing): New.
1295 * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO.
1296 * search.c (lookup_member): Do lookup in the open partial
1298 * semantics.c (finish_template_template_parm): Handle constraints.
1299 (fixup_template_type): New.
1300 (finish_template_type): Call it.
1301 (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS.
1302 * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO.
1303 (cp_walk_subtrees): Handle REQUIRES_EXPR.
1304 * typeck.c (cp_build_function_call_vec): Check constraints.
1306 2015-08-06 Jason Merrill <jason@redhat.com>
1309 * parser.c (cp_parser_primary_expression): Don't skip to the end
1310 of the statement if we're parsing tentatively.
1315 * mangle.c (write_expression) [TEMPLATE_ID_EXPR]: Handle variable
1317 * pt.c (tsubst_copy_and_build): Check for argument substitution
1320 2015-08-05 Jason Merrill <jason@redhat.com>
1322 * pt.c (determine_specialization): Print candidates after 'no
1325 * decl.c (cp_finish_decl): Tidy.
1326 * typeck.c (finish_class_member_access_expr): Use
1327 type_dependent_expression_p.
1328 * semantics.c (finish_id_expression): Use
1329 type_dependent_expression_p. Don't build_qualified_name for a
1330 decl in non-dependent scope.
1331 * pt.c (type_dependent_expression_p): A TEMPLATE_ID_EXPR of an
1332 identifier is dependent. Remove variable_template_p check.
1338 * pt.c (lookup_template_variable): Use NULL_TREE for type.
1339 (instantiate_template_1): Also set DECL_TI_ARGS based on
1340 the immediate parent.
1341 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle variable templates.
1342 (finish_template_variable): Add complain parm.
1343 * cp-tree.h: Adjust.
1347 * semantics.c (finish_id_expression): Call convert_from_reference
1348 for variable template.
1350 2015-08-04 Jason Merrill <jason@redhat.com>
1352 * pt.c (lookup_template_class_1): Clear elt.spec.
1354 * tree.c (build_target_expr): Copy the location from value.
1356 2015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
1358 * parser.c (cp_parser_selection_statement): Move handling of
1359 semicolon body to ...
1360 (cp_parser_implicitly_scoped_statement): .. here. Call
1361 warn_for_misleading_indentation even when the body is a
1362 semicolon. Extract token_indent_infos corresponding to the
1363 guard, body and next tokens. Adjust call to
1364 warn_for_misleading_indentation accordingly. Take
1365 token_indent_info argument.
1366 (cp_parser_already_scoped_statement): Likewise.
1367 (cp_parser_selection_statement, cp_parser_iteration_statement):
1368 Extract a token_indent_info corresponding to the guard token.
1370 2015-08-01 Caroline Tice <cmtice@google.com>
1373 * mangle.c : Add vtable-verify.h to include files.
1374 (get_mangled_vtable_map_var_name): If the DECL_ASSEMBLER_NAME
1375 is "<anon>" get the real mangled name for the class instead, and
1376 also store the real mangled name in a vector for use later.
1378 2015-07-31 Marek Polacek <polacek@redhat.com>
1381 * typeck.c (get_member_function_from_ptrfunc): Don't sanitize
1384 2015-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1386 * class.c (check_for_override): Use DECL_SOURCE_LOCATION and "%qD"
1387 in warning_at instead of "%q+D" in warning.
1388 (warn_hidden): Likewise but use location_of.
1389 (finish_struct_anon_r): Likewise use DECL_SOURCE_LOCATION in permerror.
1390 (check_bitfield_decl, check_field_decls): Likewise in warning_at.
1391 (check_field_decls): Likewise for permerror.
1392 (explain_non_literal_class): Likewise for inform.
1393 (check_bases_and_members, layout_class_type): Likewise for warning_at.
1394 (note_name_declared_in_class): Use location_of in permerror.
1395 * name-lookup.c (diagnose_name_conflict): Use location_of in inform.
1396 (pushdecl_maybe_friend_1): Use DECL_SOURCE_LOCATION in pedwarn,
1397 inform, and warning_at.
1398 (check_for_out_of_scope_variable): Likewise for warning_at and
1401 2015-07-30 Jason Merrill <jason@redhat.com>
1405 * pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.
1407 2015-07-28 Paolo Carlini <paolo.carlini@oracle.com>
1409 * call.c (build_op_delete_call, convert_like_real, build_over_call):
1410 Use Use DECL_SOURCE_LOCATION and "%qD" in inform and pedwarn instead
1412 * constexpr.c (explain_invalid_constexpr_fn): Likewise.
1413 * decl.c (duplicate_decls): Likewise for warning/warning_at.
1414 * except.c (maybe_noexcept_warning): Likewise.
1415 * friend.c (make_friend_class): Likewise for inform.
1416 * mangle.c (mangle_decl): Likewise for warning/warning_at.
1417 * method.c (process_subob_fn, walk_field_subobs,
1418 maybe_explain_implicit_delete): Likewise for inform.
1419 * parser.c (cp_parser_lambda_introducer): Likewise.
1420 * pt.c (check_specialization_namespace,
1421 maybe_process_partial_specialization): Likewise for permerror.
1422 (redeclare_class_template): Likewise for inform_n.
1423 (coerce_template_parms, tsubst_copy_and_build): Likewise for inform.
1424 * search.c (check_final_overrider): Likewise.
1425 * semantics.c (process_outer_var_ref): Likewise.
1427 2015-07-27 Jason Merrill <jason@redhat.com>
1429 * constexpr.c (cxx_eval_call_expression): Don't add this call to
1430 the hash table if !depth_ok.
1432 2015-07-27 Marek Polacek <polacek@redhat.com>
1436 * call.c (build_new_op_1): Call warn_tautological_cmp.
1437 * pt.c (tsubst_copy_and_build): Use sentinel to suppress tautological
1440 2015-07-26 Patrick Palka <ppalka@gcc.gnu.org>
1443 * typeck.c (check_return_expr): Also do the basic return-value
1444 validity checking if processing_template_decl and yet types are
1445 not dependent. Remove obsolete code.
1447 2015-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1449 * decl.c (poplevel): Use Use DECL_SOURCE_LOCATION and "%qD"
1450 in warning_at instead of "%q+D" in warning.
1451 (warn_extern_redeclared_static): Likewise for inform.
1452 (check_redeclaration_no_default_args): Likewise for permerror.
1453 (duplicate_decls): Likewise.
1454 (check_previous_goto_1): Likewise for inform.
1455 (check_goto, start_decl, check_for_uninitialized_const_var,
1456 start_preparsed_function, finish_function§): Likewise.
1457 * decl2.c (build_anon_union_vars, c_parse_final_cleanups): Likewise.
1458 * init.c (sort_mem_initializers): Likewise.
1459 * typeck.c (convert_for_initialization): Likewise for inform.
1460 (maybe_warn_about_returning_address_of_local): Likewise.
1461 * typeck2.c (abstract_virtuals_error_sfinae): Likewise for inform.
1462 (cxx_incomplete_type_diagnostic): Likewise for emit_diagnostic.
1464 2015-07-25 Patrick Palka <ppalka@gcc.gnu.org>
1467 * cvt.c (ocp_convert): Don't call scalar_constant_value when
1468 converting to a class type.
1470 2015-07-24 Jason Merrill <jason@redhat.com>
1473 * pt.c (splice_late_return_type): Correct deduced return type for
1474 abbreviated function template.
1476 2015-07-24 Richard Biener <rguenther@suse.de>
1478 * init.c (build_vec_init): Build iterator bound in the same
1479 type as the iterator.
1481 2015-07-23 Marek Polacek <polacek@redhat.com>
1484 * pt.c (tsubst_copy_and_build): Add warn_logical_op sentinel.
1486 2015-07-23 Paolo Carlini <paolo.carlini@oracle.com>
1489 * parser.c (cp_parser_simple_declaration): Robustify check avoiding
1490 redundant error messages.
1492 2015-07-21 Paolo Carlini <paolo.carlini@oracle.com>
1494 * decl.c (grokdeclarator): For an erroneous template parameter
1495 propagate error_mark_node as type.
1497 2015-07-20 Marek Polacek <polacek@redhat.com>
1500 * typeck.c (cp_build_binary_op): Warn about left shift overflows.
1502 2015-07-15 Jason Merrill <jason@redhat.com>
1505 * parser.c (cp_parser_unqualified_id): Don't accept ~x in a
1506 template if there is no type x in scope.
1508 2015-07-14 Patrick Palka <ppalka@gcc.gnu.org>
1511 * pt.c (redeclare_class_template): Set the DECL_CONTEXTs of each
1512 template template parm in the redeclaration.
1513 (lookup_template_class_1): Peel off irrelevant template levels
1514 from current_template_parms before augmenting the argument
1517 2015-07-14 Andrea Azzarone <azzaronea@gmail.com>
1520 * parser.c (cp_parser_sizeof_pack): Also consider template template
1523 2015-07-14 Jason Merrill <jason@redhat.com>
1525 * call.c (build_new_method_call_1): Call reshape_init.
1527 2015-07-14 Paolo Carlini <paolo.carlini@oracle.com>
1529 * pt.c (check_template_shadow): Emit error + inform instead of
1532 2015-07-13 Patrick Palka <ppalka@gcc.gnu.org>
1535 * pt.c (invalid_nontype_parm_type_p): Accept a bound template
1536 template parm type under C++11 and later.
1538 2015-07-12 Aldy Hernandez <aldyh@redhat.com>
1540 * call.c: Fix double word typos.
1541 * cp-array-notation.c: Same.
1544 * name-lookup.c: Same.
1547 2015-07-10 Patrick Palka <ppalka@gcc.gnu.org>
1550 * pt.c (begin_template_parm_list): Add a dummy parameter level
1551 to current_template_parms.
1552 (end_template_parm_list): Remove the dummy parameter level
1553 before adding the real one.
1554 (tsubst): Don't attempt to substitute for template parameters
1555 corresponding to a dummy argument level.
1556 (template_parms_to_args): Remove obsolete hack for
1557 giving template template arguments the proper level.
1558 (splite_late_return_type): Remove obsolete hack for giving
1559 template template arguments the proper level.
1560 * error.c (dump_template_decl): Don't print dummy template
1563 2015-07-10 Paolo Carlini <paolo.carlini@oracle.com>
1566 * call.c (convert_like_real): Do not set LOOKUP_ONLYCONVERTING for
1567 the second step of copy-initialization.
1569 2015-07-10 Jason Merrill <jason@redhat.com>
1571 * pt.c (find_parameter_packs_r): Handle variable templates.
1572 (variable_template_specialization_p): New.
1573 * cp-tree.h: Declare it.
1575 * parser.c (cp_parser_template_id): SET_EXPR_LOCATION.
1577 2015-07-10 Eric Botcazou <ebotcazou@adacore.com>
1579 * decl2.c (cpp_check): Revert latest change.
1581 2015-07-09 Jason Merrill <jason@redhat.com>
1583 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Call
1584 value_dependent_expression_p.
1586 * cp-tree.h (struct cp_parameter_declarator): Rename ellipsis_p to
1587 template_parameter_pack_p.
1588 * parser.c (declarator_can_be_parameter_pack): False if
1589 parameter_pack_p is set.
1590 (make_parameter_declarator): Add template_parameter_pack_p parm.
1591 (cp_parser_template_parameter): Remove parameter pack parsing.
1592 (cp_parser_parameter_declaration): Handle all parameter packs.
1593 Tweak default argument permerror.
1595 2015-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
1597 * parser.c (cp_parser_default_type_template_argument)
1598 (cp_parser_default_template_template_argument): Factor out from
1599 cp_parser_type_parameter.
1601 2015-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1603 * typeck.c (warn_args_num): Rename to error_args_num.
1604 (convert_arguments): Adjust calls.
1606 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
1608 * cp-ubsan.c: Don't include alloc-pool.h or lto-streamer.h.
1610 2015-07-08 Eric Botcazou <ebotcazou@adacore.com>
1612 * decl2.c (cpp_check): Deal with IS_CONSTEXPR.
1614 2015-07-08 Jakub Jelinek <jakub@redhat.com>
1616 * decl.c (grokfndecl): Handle flag_openmp_simd like flag_openmp.
1617 * pt.c (apply_late_template_attributes): Likewise.
1619 2015-07-08 Marek Polacek <polacek@redhat.com>
1622 * tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before
1623 accessing TYPE_LANG_SPECIFIC node.
1625 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
1627 * call.c: Adjust includes.
1628 * class.c: Likewise.
1629 * constexpr.c: Likewise.
1630 * cp-array-notation.c: Likewise.
1631 * cp-gimplify.c: Likewise.
1632 * cp-lang.c: Likewise.
1633 * cp-objcp-common.c: Likewise.
1634 * cp-ubsan.c: Likewise.
1637 * decl2.c: Likewise.
1639 * error.c: Likewise.
1640 * except.c: Likewise.
1642 * friend.c: Likewise.
1644 * lambda.c: Likewise.
1646 * mangle.c: Likewise.
1647 * method.c: Likewise.
1648 * name-lookup.c: Likewise.
1649 * optimize.c: Likewise.
1650 * parser.c: Likewise.
1652 * ptree.c: Likewise.
1655 * search.c: Likewise.
1656 * semantics.c: Likewise.
1658 * typeck.c: Likewise.
1659 * typeck2.c: Likewise.
1661 2015-07-07 Eric Botcazou <ebotcazou@adacore.com>
1663 * decl2.c (cpp_check): Deal with IS_MOVE_CONSTRUCTOR.
1665 2015-07-06 Jason Merrill <jason@redhat.com>
1667 * pt.c (reduce_template_parm_level): Also build the TYPE_DECL
1668 for a template template parameter.
1669 (tsubst_decl) [TEMPLATE_DECL]: Use the TEMPLATE_DECL built
1670 by reduce_template_parm_level.
1672 * pt.c (argument_pack_element_is_expansion_p): A decl pack is an
1675 2015-07-02 Jason Merrill <jason@redhat.com>
1678 * pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
1679 TYPE_VALUES_RAW rather than TYPE_FIELDS.
1681 2015-07-02 Andrew Sutton <andrew.n.sutton@gmail.com>
1683 * pt.c (type_dependent_expression_p): Handle expressions
1684 that refer to variable templates.
1686 2015-07-01 Jason Merrill <jason@redhat.com>
1688 * lex.c (init_reswords): s/CXX0X/CXX11/.
1689 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1691 * mangle.c (write_CV_qualifiers_for_type, write_nested_name):
1692 Attribute mangling is now -fabi-version=10.
1695 * decl.c (cxx_init_decl_processing): Set TYPE_ALIGN of nullptr_t.
1696 * class.c (layout_nonempty_base_or_field): Warn if that affects
1697 the offset of a field.
1699 2015-07-01 Paolo Carlini <paolo.carlini@oracle.com>
1702 * parser.c (cp_parser_check_std_attribute): New.
1703 (cp_parser_std_attribute_list): Call it.
1705 2015-07-01 Patrick Palka <ppalka@gcc.gnu.org>
1708 * pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
1709 return 0 if tsubst returns a dependent type.
1711 2015-06-30 Jason Merrill <jason@redhat.com>
1714 * decl2.c (is_late_template_attribute): True for tls_model.
1717 * cp-tree.h (CP_DECL_THREAD_LOCAL_P): New.
1718 (DECL_GNU_TLS_P): Use DECL_LANG_SPECIFIC field.
1719 (SET_DECL_GNU_TLS_P): New.
1720 * call.c (make_temporary_var_for_ref_to_temp): Use
1721 CP_DECL_THREAD_LOCAL_P.
1722 (set_up_extended_ref_temp): Likewise.
1723 * decl.c (duplicate_decls, expand_static_init): Likewise.
1724 (redeclaration_error_message, grokvardecl): Likewise.
1725 (start_decl, register_dtor_fn, grokdeclarator): Likewise.
1726 * decl2.c (get_guard, var_needs_tls_wrapper): Likewise.
1727 (handle_tls_init): Likewise.
1728 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
1729 * semantics.c (finish_id_expression): Likewise.
1730 (handle_omp_array_sections_1, finish_omp_clauses): Likewise.
1731 (finish_omp_threadprivate): Likewise.
1732 * tree.c (decl_storage_duration): Likewise.
1733 * cp-gimplify.c (omp_var_to_track): Likewise.
1734 (cp_genericize_r): Check that it matches DECL_THREAD_LOCAL_P.
1735 * lex.c (retrofit_lang_decl): Return if DECL_LANG_SPECIFIC is
1738 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1740 Implement N4197 - Adding u8 character literals
1741 * parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
1742 and CPP_UTF8CHAR_USERDEF tokens;
1743 (cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.
1745 2015-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1748 * decl.c (grokfndecl): Allow constexpr declarations of friend
1749 template specializations.
1751 2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1754 * decl.c (finish_function): Call do_warn_unused_parameter.
1756 2015-06-29 Marek Polacek <polacek@redhat.com>
1759 * decl.c (struct cp_switch): Add OUTSIDE_RANGE_P.
1760 (push_switch): Set OUTSIDE_RANGE_P.
1761 (pop_switch): Update c_do_switch_warnings call.
1762 (finish_case_label): Update c_add_case_label call.
1763 * semantics.c (finish_switch_cond): Don't warn about -Wswitch-bool
1766 2015-06-27 Marek Polacek <polacek@redhat.com>
1768 * call.c: Use VECTOR_TYPE_P.
1769 * constexpr.c: Likewise.
1772 * decl2.c: Likewise.
1774 * semantics.c: Likewise.
1776 * typeck.c: Likewise.
1777 * typeck2.c: Likewise.
1779 2015-06-27 Marek Polacek <polacek@redhat.com>
1781 * call.c (set_up_extended_ref_temp): Use VAR_P.
1782 * class.c: Use VAR_P throughout.
1783 * constexpr.c (cxx_eval_constant_expression): Use VAR_P.
1784 * cp-array-notation.c (make_triplet_val_inv): Likewise.
1785 * decl.c: Use VAR_OR_FUNCTION_DECL_P or VAR_P
1787 * decl2.c: Likewise.
1788 * error.c (dump_decl): Use VAR_P.
1789 * mangle.c (decl_implicit_alias_p): Likewise.
1790 * parser.c: Use VAR_P throughout.
1792 * semantics.c: Likewise.
1793 * vtable-class-hierarchy.c: Likewise.
1794 * tree.c (handle_abi_tag_attribute): Use VAR_OR_FUNCTION_DECL_P.
1796 2015-06-27 Andreas Schwab <schwab@linux-m68k.org>
1798 * pt.c (check_unstripped_args): Mark parameter as unused.
1800 2015-06-26 Jason Merrill <jason@redhat.com>
1803 * class.c (finish_struct): Call fixup_attribute_variants.
1806 * typeck2.c (merge_exception_specifiers): Allow different
1807 noexcept-specifiers if we've had errors.
1810 * pt.c (check_unstripped_args): Split out from...
1811 (retrieve_specialization): ...here. Allow typedefs in the type of
1812 a non-type argument.
1815 * mangle.c (write_nested_name): Limit TYPENAME_TYPE handling to
1817 * mangle.c (write_template_args): Handle 0 length TREE_VEC.
1820 * typeck2.c (digest_init_r): Only expect reshaping if the class is
1823 2015-06-26 Marek Polacek <polacek@redhat.com>
1825 * cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P.
1826 * cp-ubsan.c (cp_ubsan_check_member_access_r): Likewise.
1828 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
1830 * call.c: Remove ipa-ref.h and plugin-api.h from include list.
1831 * class.c: Likewise.
1832 * cp-ubsan.c: Likewise.
1834 * decl2.c: Likewise.
1835 * lambda.c: Likewise.
1836 * mangle.c: Likewise.
1837 * method.c: Likewise.
1838 * optimize.c: Likewise.
1839 * parser.c: Likewise.
1840 * semantics.c: Likewise.
1842 * vtable-class-hierarchy.c: Likewise.
1844 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
1846 * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash
1847 rather than ggc_hasher.
1848 (constexpr_call_hasher): Likewise.
1849 * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise.
1850 * decl.c (typename_hasher): Likewise.
1851 * mangle.c (conv_type_hasher): Likewise.
1852 * pt.c (spec_hasher): Likewise.
1853 * tree.c (cplus_array_hasher, list_hasher): Likewise.
1854 * typeck2.c (abstract_type_hasher): Likewise.
1856 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
1858 * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
1859 rather than pointer_hash.
1860 (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash.
1861 * semantics.c (nrv_data): Likewise.
1862 * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise.
1864 2015-06-24 Jason Merrill <jason@redhat.com>
1867 * pt.c (dependent_type_p_r): Check for dependent alias template
1868 specialization sooner.
1871 * class.c (type_has_nontrivial_assignment): Remove.
1872 * cp-tree.h: Remove declaration.
1873 * init.c (vec_copy_assign_is_trivial): New.
1874 (build_vec_init): Use it.
1876 2015-06-24 Edward Smith-Rowland <3dw4rd@verizon.net>
1878 Implement N3928 - Extending static_assert
1879 * parser.c (cp_parser_static_assert): Support static_assert with
1880 no message string. Supply an empty string in this case.
1881 * semantics.c (finish_static_assert): Don't try to print a message if
1882 the message strnig is empty.
1884 2015-06-24 Adam Butcher <adam@jessamine.co.uk>
1887 * parser.c (cp_parser_simple_type_specifier): Don't synthesize
1888 implicit template parm if 'auto' is a placeholder for trailing
1891 2015-06-24 Patrick Palka <ppalka@gcc.gnu.org>
1894 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
1897 * parser.c (cp_parser_template_parameter_list): Update
1898 current_template_parms right after processing a paramater.
1899 * pt.c (template_parms_to_args): Remove obsolete hack for
1900 giving template template arguments the proper level.
1901 (check_default_tmpl_args): Account for tested template
1903 (splite_late_return_type): Remove obsolete hack for giving
1904 template template arguments the proper level.
1906 2015-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1909 * decl.c (duplicate_decls): Adjust DECL_COMDAT of newdecl.
1911 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
1914 * parser.c (cp_parser_template_parameter_list): Update
1915 current_template_parms right after processing a paramater.
1916 * pt.c (template_parms_to_args): Remove obsolete hack for
1917 giving template template arguments the proper level.
1918 (check_default_tmpl_args): Account for tested template
1920 (splite_late_return_type): Remove obsolete hack for giving
1921 template template arguments the proper level.
1923 2015-06-23 Jason Merrill <jason@redhat.com>
1926 * decl.c (grokfndecl): Check the linkage of ctype, not just
1928 * tree.c (no_linkage_check): Skip the 'this' pointer.
1931 * class.c (type_has_nontrivial_assignment): New.
1932 * init.c (build_vec_init): Use it.
1933 * cp-tree.h: Declare it.
1934 * method.c (trivial_fn_p): Templates aren't trivial.
1937 * decl.c (expand_static_init): Make sure the destructor is callable
1938 here even if we have an initializer.
1940 2015-06-04 Pierre-Marie de Rodat <derodat@adacore.com>
1942 * lang-specs.h: Pass "-o %g.s" to cc1plus for headers even if
1943 -fdump-ada-spec is passed.
1945 2015-06-22 Pierre-Marie de Rodat <derodat@adacore.com>
1947 * decl2.c (cpp_check): Deal with HAS_DEPENDENT_TEMPLATE_ARGS.
1949 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
1951 * decl.c (grokdeclarator): Use declspecs->locations[ds_virtual].
1953 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
1955 * decl.c (grokdeclarator): Remove pointless code.
1957 2015-06-22 Jason Merrill <jason@redhat.com>
1960 * call.c (implicit_conversion): Only reshape for classes.
1962 2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
1964 * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of
1966 * semantics.c (finish_omp_atomic): Likewise.
1967 * typeck.c (cp_build_array_ref): Likewise.
1969 2015-06-20 Mikhail Maltsev <maltsevm@gmail.com>
1972 * call.c (build_new_op_1): Check tf_warning flag in all cases.
1974 2015-06-19 Jason Merrill <jason@redhat.com>
1977 * pt.c (instantiate_class_template_1): Clear
1978 cp_unevaluated_operand and c_inhibit_evaluation_warnings.
1981 * decl.c (build_ptrmemfunc_type): Check TYPE_GET_PTRMEMFUNC_TYPE after
1983 * typeck.c (merge_types): build_ptrmemfunc_type before applying
1984 quals and attributes.
1987 * constexpr.c (build_constexpr_constructor_member_initializers):
1988 Handle an empty STATEMENT_LIST.
1991 * pt.c (tsubst_copy_and_build): Register a capture proxy in
1992 local_specializations.
1994 2015-06-17 Jason Merrill <jason@redhat.com>
1997 * constexpr.c (cxx_eval_constant_expression): Handle TRY_BLOCK and
1999 (potential_constant_expression_1): Likewise.
2001 2015-06-17 Jason Merrill <jason@redhat.com>
2004 * call.c (implicit_conversion): Call reshape_init here, early.
2005 (build_aggr_conv): Not here.
2007 2015-06-17 Jakub Jelinek <jakub@redhat.com>
2010 * pt.c (tsubst_omp_clause_decl): New function.
2011 (tsubst_omp_clauses): Use it or tsubst_copy instead of
2012 tsubst_expr on OMP_CLAUSE_DECL.
2014 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2016 * cp-lang.c (cxx_dwarf_name): Use anon_aggrname_p.
2017 * cp-tree.h (TYPE_ANONYMOUS_P): Likewise.
2018 * decl.c (grokdeclarator, xref_tag_1): Likewise.
2019 * error.c (dump_aggr_type): likewise.
2020 * pt.c (push_template_decl_real): Likewise.
2021 * name-lookup.c (make_anon_name): Use anon_aggrname_format.
2023 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2025 * call.c: Do not include input.h, line-map.h or is-a.h.
2026 * class.c: Likewise.
2027 * constexpr.c: Likewise.
2028 * cp-array-notation.c: Likewise.
2029 * cp-gimplify.c: Likewise.
2030 * cp-lang.c: Likewise.
2031 * cp-objcp-common.c: Likewise.
2032 * cp-tree.h: Likewise.
2033 * cp-ubsan.c: Likewise.
2036 * decl2.c: Likewise.
2038 * error.c: Likewise.
2039 * except.c: Likewise.
2041 * friend.c: Likewise.
2043 * lambda.c: Likewise.
2045 * mangle.c: Likewise.
2046 * method.c: Likewise.
2047 * name-lookup.c: Likewise.
2048 * optimize.c: Likewise.
2049 * parser.c: Likewise.
2051 * ptree.c: Likewise.
2054 * search.c: Likewise.
2055 * semantics.c: Likewise.
2057 * typeck.c: Likewise.
2058 * typeck2.c: Likewise.
2059 * vtable-class-hierarchy.c: Likewise.
2061 2015-06-16 Paolo Carlini <paolo.carlini@oracle.com>
2064 * parser.c (cp_parser_new_placement): Reject an empty expression-list.
2066 2015-06-16 Jason Merrill <jason@redhat.com>
2069 * tree.c (replace_placeholders_r) [CONSTRUCTOR]: Handle type
2073 * tree.c (bot_manip): Remap SAVE_EXPR.
2076 * pt.c (tsubst_copy) [VAR_DECL]: Use process_outer_var_ref.
2078 2015-06-15 Nathan Sidwell <nathan@acm.org>
2081 * cp-tree.h (DECL_INSTANTIATING_NSDMI_P): New.
2082 * init.c (get_nsdmi): Check for DEFAULT_ARG in template case and
2083 protect it from recursive instantiation.
2085 2015-06-15 Paolo Carlini <paolo.carlini@oracle.com>
2088 * decl2.c (no_linkage_error): Do not issue a permerror if the DECL
2089 using a local type is pure virtual.
2091 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
2093 * call.c: Remove comment documenting the long-deleted
2094 function build_method_call.
2096 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
2099 * typeck.c (cp_build_binary_op): Warn when comparing an address
2100 of a reference against NULL.
2102 2015-06-12 Jason Merrill <jason@redhat.com>
2105 * pt.c (tsubst_decl) [VAR_DECL]: Mark namespace-scope
2106 variables as DECL_NOT_REALLY_EXTERN.
2108 2015-06-11 Jason Merrill <jason@redhat.com>
2111 * constexpr.c (potential_constant_expression_1): Handle a
2112 DECL_EXPR of TYPE_DECL.
2115 * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
2118 2015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
2120 * decl.c (cxx_init_decl_processing): Register the main
2121 translation unit through the new debug hook.
2123 2015-06-10 Jason Merrill <jason@redhat.com>
2126 * cp-tree.h (TEMPLATE_DECL_COMPLEX_ALIAS_P): New.
2127 * pt.c (push_template_decl_real): Set it.
2128 (dependent_alias_template_spec_p): Use it.
2129 (dependent_type_p_r): Use dependent_alias_template_spec_p.
2130 (uses_all_template_parms_data, uses_all_template_parms_r)
2131 (complex_alias_template_p): New.
2132 (get_template_parm_index): Handle BOUND_TEMPLATE_TEMPLATE_PARM.
2134 2015-06-09 Jason Merrill <jason@redhat.com>
2138 * typeck2.c (digest_init_r): Replace previous change with
2142 * semantics.c (process_outer_var_ref): Make sure the value is
2143 actually constant before returning it.
2144 * typeck.c (cp_build_array_ref): Allow subscripting non-lvalue
2147 2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
2150 * typeck2.c (digest_nsdmi_init): On aggregates use reshape_init.
2151 * init.c (expand_default_init): Likewise.
2153 2015-06-09 Jason Merrill <jason@redhat.com>
2156 * tree.c (replace_placeholders_r): Handle placeholders for an
2158 * typeck2.c (store_init_value): Only replace_placeholders for
2159 objects of class type.
2161 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
2163 * call.c : Adjust include files.
2164 * class.c : Likewise.
2165 * constexpr.c : Likewise.
2166 * cp-array-notation.c : Likewise.
2167 * cp-cilkplus.c : Likewise.
2168 * cp-gimplify.c : Likewise.
2169 * cp-lang.c : Likewise.
2170 * cp-objcp-common.c : Likewise.
2171 * cp-tree.h : Likewise.
2172 * cp-ubsan.c : Likewise.
2174 * decl.c : Likewise.
2175 * decl2.c : Likewise.
2176 * dump.c : Likewise.
2177 * error.c : Likewise.
2178 * except.c : Likewise.
2179 * expr.c : Likewise.
2180 * friend.c : Likewise.
2181 * init.c : Likewise.
2182 * lambda.c : Likewise.
2184 * mangle.c : Likewise.
2185 * method.c : Likewise.
2186 * name-lookup.c : Likewise.
2187 * optimize.c : Likewise.
2188 * parser.c : Likewise.
2190 * ptree.c : Likewise.
2191 * repo.c : Likewise.
2192 * rtti.c : Likewise.
2193 * search.c : Likewise.
2194 * semantics.c : Likewise.
2195 * tree.c : Likewise.
2196 * typeck.c : Likewise.
2197 * typeck2.c : Likewise.
2198 * vtable-class-hierarchy.c : Likewise.
2200 2015-06-05 Jason Merrill <jason@redhat.com>
2203 * pt.c (argument_pack_element_is_expansion_p): Return 2 if
2204 the expansion has extra args.
2205 (use_pack_expansion_extra_args_p): Return true in that case.
2208 * pt.c (type_dependent_expression_p): EXPR_PACK_EXPANSION is
2209 dependent even if it has a type.
2211 2015-06-05 Aldy Hernandez <aldyh@redhat.com>
2213 * cp-objcp-common.c: Adjust comment for
2214 cxx_warn_unused_global_decl.
2215 * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Remove
2216 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): New.
2217 * cp-tree.h (note_mangling_alias): Protoize.
2218 (cp_write_global_declarations): Remove.
2219 (cxx_post_compilation_parsing_cleanups): Protoize.
2220 * decl.c (wrapup_globals_for_namespace): Remove use of DATA
2222 * decl2.c (mangling_aliases): New global.
2223 (build_java_method_aliases): New. Adapted from
2224 collect_candidates_for_java_method_aliases.
2225 (collect_candidates_for_java_method_aliases): Remove.
2226 (build_java_method_aliases): Remove.
2227 (generate_mangling_aliases): New.
2228 (note_mangling_alias): New. Moved from mangle_decl.
2229 (locus_at_end_of_parsing): New global.
2230 (c_parse_final_cleanups): Rename from
2231 cp_write_global_declarations.
2232 Use locus_at_end_of_parsing.
2233 Call generate_mangling_aliases.
2234 Rename call to collect_candidates_for_java_method_aliases into
2235 build_java_method_aliases.
2236 Remove call to finalize_compilation_unit.
2237 Move vtable handling into cxx_post_compilation_parsing_cleanups.
2238 Do not call check_global_declarations or
2239 emit_debug_global_declarations.
2240 (cxx_post_compilation_parsing_cleanups): New.
2241 * mangle.c (mangle_decl): Move code to note_mangling_alias.
2242 * name-lookup.c (do_namespace_alias): Call early_global_decl.
2244 2015-06-05 Nathan Sidwell <nathan@acm.org>
2247 * parser.c (cp_parser_cache_defarg): Continue looking for
2248 declarators when scanning a potential template argument list of an
2251 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
2253 * call.c: Adjust includes for restructured coretypes.h.
2254 * class.c: Likewise.
2255 * constexpr.c: Likewise.
2256 * cp-array-notation.c: Likewise.
2257 * cp-gimplify.c: Likewise.
2258 * cp-lang.c: Likewise.
2259 * cp-objcp-common.c: Likewise.
2260 * cp-tree.h: Likewise.
2261 * cp-ubsan.c: Likewise.
2264 * decl2.c: Likewise.
2266 * error.c: Likewise.
2267 * except.c: Likewise.
2269 * friend.c: Likewise.
2271 * lambda.c: Likewise.
2273 * mangle.c: Likewise.
2274 * method.c: Likewise.
2275 * name-lookup.c: Likewise.
2276 * optimize.c: Likewise.
2277 * parser.c: Likewise.
2279 * ptree.c: Likewise.
2282 * search.c: Likewise.
2283 * semantics.c: Likewise.
2285 * typeck.c: Likewise.
2286 * typeck2.c: Likewise.
2287 * vtable-class-hierarchy.c: Likewise.
2289 2015-06-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
2293 * cp-tree.h (get_guard_cond): Adjust declaration
2294 * decl.c (expand_static_init): Use atomic load acquire
2295 and adjust call to get_guard_cond.
2296 * decl2.c (build_atomic_load_byte): New function.
2297 (get_guard_cond): Handle thread_safety.
2298 (one_static_initialization_or_destruction): Adjust call to
2301 2015-06-03 Jason Merrill <jason@redhat.com>
2304 * mangle.c (mangle_decl): Always SET_IDENTIFIER_GLOBAL_VALUE.
2305 (write_CV_qualifiers_for_type): Set G.need_abi_warning.
2306 (decl_implicit_alias_p): Split out from maybe_remove_implicit_alias.
2307 * cp-tree.h (DECL_REALLY_EXTERN): Handle null DECL_LANG_SPECIFIC.
2309 2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
2310 Paolo Carlini <paolo.carlini@oracle.com>
2313 * typeck.c (invalid_nonstatic_memfn_p): Add location_t parameter and
2314 use it in the diagnostic.
2315 (decay_conversion): Adjust call.
2316 * semantics.c (finish_decltype_type): Likewise.
2317 * call.c (resolve_args, build_new_op_1,
2318 perform_implicit_conversion_flags): Adjust calls.
2319 * cvt.c (ocp_convert, convert_to_void): Likewise.
2320 * cp-tree.h (invalid_nonstatic_memfn_p): Update declaration.
2322 2015-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2324 * decl.c (check_tag_decl): Use declspecs->locations as locations in
2325 error_at and warning_at calls.
2327 2015-06-03 Marek Polacek <polacek@redhat.com>
2330 * cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
2331 (cp_genericize_r): Don't instrument static initializers.
2332 (cp_genericize_tree): Initialize wtd.no_sanitize_p.
2334 2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
2336 * decl.c (start_function): Call plugin before parsing.
2337 (finish_function): Call plugin after parsing.
2339 2015-06-02 Patrick Palka <patrick@parcs.ath.cx>
2341 * cp-tree.h (init_error): Remove declaration.
2342 * error.c (scratch_pretty_printer): Rename to ...
2343 (actual_pretty_printer): ... this.
2344 (cxx_pp): Constify and update accordingly.
2345 (init_error): Remove definition.
2346 * lex.c (cxx_init): Do not call init_error.
2348 2015-06-02 Paolo Carlini <paolo.carlini@oracle.com>
2351 * parser.c (cp_parser_mem_initializer): Allow for decltype-specifier.
2353 2015-06-01 Jason Merrill <jason@redhat.com>
2356 * decl2.c (mark_used): Don't always instantiate constexpr fns.
2357 * constexpr.c (cxx_eval_call_expression): Instantiate them here.
2360 * mangle.c (attr_strcmp): New.
2361 (write_CV_qualifiers_for_type): Also write out attributes that
2362 affect type identity.
2363 (write_type): Strip all attributes after writing qualifiers.
2365 2015-05-31 Jason Merrill <jason@redhat.com>
2367 * constexpr.c (cxx_eval_indirect_ref): Try folding first.
2370 * constexpr.c (cxx_eval_constant_expression): Treat a placeholder
2371 with the wrong type as non-constant.
2373 2015-05-27 Jason Merrill <jason@redhat.com>
2375 * decl.c (check_redeclaration_exception_specification): Depend on
2376 -Wsystem-headers rather than -pedantic.
2378 * decl.c (warn_extern_redeclared_static): Use the location of
2379 newdecl in diagnostics, not input_location.
2380 (validate_constexpr_redeclaration): Likewise.
2381 (check_redeclaration_no_default_args): Likewise.
2382 (duplicate_decls): Likewise.
2383 (check_redeclaration_exception_specification): Likewise.
2384 Change second diagnostic to inform.
2386 2015-05-24 Nathan Sidwell <nathan@acm.org>
2389 * decl.c (build_enumerator): Don't silently convert scoped enums.
2391 2015-05-24 Jan Hubicka <hubicka@ucw.cz>
2394 * mangle.c (mangle_decl): Mangle anonymous namespace types as
2397 2015-05-23 Nathan Sidwell <nathan@acm.org>
2400 * pt.c (lookup_template_class_1): Copy may_alias attribute too.
2402 2015-05-22 Jim Wilson <jim.wilson@linaro.org>
2404 * Make-lang.in (check_g++_parallelize): Update comment.
2406 2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2409 * decl.c (grokdeclarator): Use the correct location in error
2410 messages about 'explicit'.
2412 2015-05-22 Marek Polacek <polacek@redhat.com>
2413 Edward Smith-Rowland <3dw4rd@verizon.net>
2416 * cp-tree.h (build_enumerator): Update declaration.
2417 * decl.c (build_enumerator): Add attributes parameter. Call
2418 cplus_decl_attributes.
2419 * init.c (constant_value_1): Pass tf_none to mark_used.
2420 * parser.c (cp_parser_enumerator_definition): Parse attributes and
2421 pass them down to build_enumerator.
2422 * pt.c (tsubst_enum): Pass decl attributes to build_enumerator.
2423 * semantics.c (finish_id_expression): Don't warn_deprecated_use here.
2425 2015-05-21 Nathan Sidwell <nathan@acm.org>
2428 * decl2.c (change_return_type): Propagate FUNCTION_REF_QUALIFIED.
2430 2015-05-21 Marek Polacek <polacek@redhat.com>
2432 * typeck.c (warn_args_num): Don't print "declare here" for builtins.
2434 2015-05-20 Jason Merrill <jason@redhat.com>
2436 * pt.c (tsubst_decl) [VAR_DECL]: SET_DECL_IMPLICIT_INSTANTIATION
2437 before register_specialization.
2439 * decl.c (grok_op_properties): Don't complain about size_t
2440 placement delete here.
2441 * call.c (second_parm_is_size_t): Split out from...
2442 (non_placement_deallocation_fn_p): ...here.
2443 (build_op_delete_call): Warn about size_t placement delete with
2446 2015-05-19 Nathan Sidwell <nathan@acm.org>
2449 * typeck.c (finish_class_member_access_expr): Diagnose failed
2450 lookup of enum class member.
2452 2015-05-19 Jakub Jelinek <jakub@redhat.com>
2455 * parser.c (cp_parser_omp_for_loop): Don't add
2456 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
2457 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
2458 (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
2461 2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
2463 * typeck.c (composite_pointer_type): Use std::swap instead of explicit
2466 2015-05-18 Jason Merrill <jason@redhat.com>
2468 * pt.c (retrieve_specialization): Make sure our arguments have
2469 gone through strip_typedefs.
2471 * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
2472 (determine_specialization): Call coerce_template_parms.
2475 * pt.c (type_unification_real): Check convertibility here.
2476 (unify_one_argument): Not here.
2478 * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo.
2479 (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype.
2480 [TREE_LIST]: Fix no-change case.
2482 * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.
2484 2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
2487 * error.c (cp_diagnostic_starter): Use diagnostic_location
2489 (cp_print_error_function): Likewise.
2490 (cp_printer): Replace locus pointer with accessor function.
2492 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2494 * parser.c (cp_parser_selection_statement): Add location and
2495 guard_kind arguments to calls to
2496 cp_parser_implicitly_scoped_statement.
2497 (cp_parser_iteration_statement): Likewise for calls to
2498 cp_parser_already_scoped_statement.
2499 (cp_parser_implicitly_scoped_statement): Add "guard_loc" and
2500 "guard_kind" params; use them to warn for misleading
2502 (cp_parser_already_scoped_statement): Likewise.
2504 2015-05-11 Jan Hubicka <hubicka@ucw.cz>
2506 * class.c (fixup_type_variants): Do not copy TYPE_METHODS
2507 (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant.
2508 * semantics.c (finish_member_declaration): Likewise.
2509 * method.c (lazily_declare_fn): Allways add method to main variant list.
2511 2015-05-09 Aldy Hernandez <aldyh@redhat.com>
2514 * decl2.c (note_mangling_alias): Declare arguments as unused.
2516 2015-05-08 Jason Merrill <jason@redhat.com>
2518 * cp-gimplify.c, parser.c: Adjust to -Wc++11-compat replacing
2521 2015-05-08 Jason Merrill <jason@redhat.com>
2523 * decl2.c (mangling_aliases): New variable.
2524 (note_mangling_alias, generate_mangling_aliases): New.
2525 (cp_write_global_declarations): Call generate_mangling_aliases.
2526 (generate_mangling_alias): Split out from...
2527 * mangle.c (mangle_decl): ...here.
2528 * cp-tree.h: Declare note_mangling_alias.
2530 2015-05-08 Aldy Hernandez <aldyh@redhat.com>
2532 * decl2.c (collect_candidates_for_java_method_aliases): Remove.
2533 (build_java_method_aliases): Adapt to use create_same_body_alias
2534 instead of assemble_alias. Move variable declarations to
2535 definition and tidy up.
2536 (cp_write_global_declarations): Call build_java_method_aliases
2537 instead of collecting candidates first.
2539 2015-05-07 Jason Merrill <jason@redhat.com>
2542 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion.
2543 (cp_parser_std_attribute_spec): Handle alignas pack expansion.
2544 * decl2.c (is_late_template_attribute): An attribute exp is dependent.
2545 * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion.
2546 (apply_late_template_attributes): Handle attribute pack expansion.
2548 2015-05-07 Marek Polacek <polacek@redhat.com>
2551 * typeck.c (cp_build_binary_op): Warn when left shifting a negative
2554 2015-05-07 Jason Merrill <jason@redhat.com>
2558 * typeck2.c (digest_init_r): Fix single element list.
2560 2015-05-05 Jason Merrill <jason@redhat.com>
2562 * cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and
2563 MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a
2564 MUST_NOT_THROW_EXPR.
2565 (cp_genericize_data): Add try_block field.
2566 (cp_genericize_tree): Initialize it.
2567 * except.c (expand_end_catch_block): Set TREE_NO_WARNING on
2570 * constexpr.c (potential_constant_expression_1) [AT_ENCODE_EXPR]:
2573 * semantics.c (finish_call_expr): Check complain.
2575 * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
2576 maybe-in-charge constructor.
2578 * decl.c (start_decl): Don't push the plain VAR_DECL for a
2585 * call.c (convert_like_real): Check value-initialization before
2587 * typeck2.c (process_init_constructor_record): Don't set
2588 CONSTRUCTOR_IS_DIRECT_INIT.
2589 (process_init_constructor_array): Likewise.
2590 * init.c (build_vec_init): Likewise.
2592 2015-05-05 David Malcolm <dmalcolm@redhat.com>
2594 * parser.c (cp_parser_asm_definition): Only test for
2595 error_mark_node if "outputs" was just set. Likewise for "inputs".
2597 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2598 Jakub Jelinek <jakub@redhat.com>
2601 * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't
2602 result in an actual error.
2604 2015-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2605 Prathamesh Kulharni <prathamesh.kulkarni@linaro.org>
2608 * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
2611 2015-04-30 David Malcolm <dmalcolm@redhat.com>
2613 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove spurious
2616 2015-04-29 Jason Merrill <jason@redhat.com>
2619 * tree.c (apply_identity_attributes): Fix handling of classes.
2621 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
2623 * parser.c (cp_parser_oacc_enter_exit_data): Use
2624 OMP_STANDALONE_CLAUSES.
2626 2015-04-29 Paolo Carlini <paolo.carlini@oracle.com>
2629 * init.c (perform_member_init): Handle references for -Winit-self.
2631 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
2633 * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
2634 OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
2636 2015-04-28 Jason Merrill <jason@redhat.com>
2639 * constexpr.c (cxx_eval_store_expression): Don't try to actually
2640 store an empty class.
2643 * constexpr.c (cxx_eval_builtin_function_call): Fix
2644 __builtin_constant_p.
2647 * tree.c (strip_typedefs): Add remove_attributes parm.
2648 (strip_typedefs_expr): Likewise.
2649 (apply_identity_attributes): New subroutine of strip_typedefs.
2650 * pt.c (canonicalize_type_argument): Let strip_typedefs handle attrs.
2651 (convert_nontype_argument, unify): Likewise.
2652 * cp-tree.h: Adjust.
2655 * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
2657 2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2659 * class.c (layout_class_type): Remove check if
2660 PCC_BITFIELD_TYPE_MATTERS is defined.
2662 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
2664 * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus.
2666 2015-04-24 Jason Merrill <jason@redhat.com>
2669 * typeck.c (structural_comptypes): Don't check TYPE_REF_CAN_ALIAS_ALL.
2671 * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
2672 Remove obsolete code.
2673 [NE_EXPR]: Likewise.
2675 2015-04-23 Jason Merrill <jason@redhat.com>
2678 * pt.c (check_explicit_specialization): Don't
2679 SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
2681 * decl.c (grokvardecl): Revert earlier fix.
2683 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com>
2686 * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
2687 suppresses the diagnostic.
2689 2015-04-20 Ville Voutilainen <ville.voutilainen@gmail.com>
2691 Reject trailing return type for an operator auto().
2692 * decl.c (grokdeclarator): Reject trailing return types for
2693 all conversion operators, don't handle conversion operators
2694 in the previous checks that deal with auto.
2696 2015-04-20 Ilya Verbin <ilya.verbin@intel.com>
2698 * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
2700 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2702 * class.c (resolve_address_of_overloaded_function, instantiate_type):
2703 Rename tsubst_flags_t parameter flags -> complain.
2705 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2707 * call.c (build_op_delete_call, build_over_call): Check mark_used
2709 * class.c (resolve_address_of_overloaded_function): Likewise.
2710 * decl.c (cxx_maybe_build_cleanup): Likewise.
2711 * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
2712 tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
2713 * rtti.c (build_dynamic_cast_1): Likewise.
2714 * semantics.c (process_outer_var_ref): Likewise.
2715 * typeck.c (build_class_member_access_expr,
2716 cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
2718 2015-04-15 Jason Merrill <jason@redhat.com>
2720 * constexpr.c (cxx_eval_store_expression): Ignore clobbers.
2721 (build_constexpr_constructor_member_initializers): Loop to find
2723 * decl.c (start_preparsed_function): Clobber the object at the
2724 beginning of a constructor.
2726 * decl.c (grokmethod): Only set DECL_COMDAT if TREE_PUBLIC is set.
2727 * method.c (implicitly_declare_fn): Likewise.
2728 * decl2.c (vague_linkage_p): Check TREE_PUBLIC first.
2730 * decl2.c (determine_visibility): Use get_template_info.
2732 2015-04-15 Jason Merrill <jason@redhat.com>
2733 Marek Polacek <polacek@redhat.com>
2736 * lambda.c (lambda_expr_this_capture): In unevaluated context go
2737 through the normal loop, just don't capture.
2738 (maybe_resolve_dummy): Handle null return.
2740 2015-04-15 Paolo Carlini <paolo.carlini@oracle.com>
2742 * call.c (enforce_access): Emit error + inform.
2744 2015-04-15 Marek Polacek <polacek@redhat.com>
2746 * constexpr.c (use_new_call): Remove #define.
2747 (lookup_parameter_binding): Remove function.
2748 (cxx_bind_parameters_in_call): Remove unused code.
2749 (cxx_eval_call_expression): Likewise.
2750 (cxx_eval_constant_expression): Likewise.
2752 2015-04-14 Mikhail Maltsev <maltsevm@gmail.com>
2754 * tree.c (replace_placeholders_t): Remove unused type.
2755 (replace_placeholders): Remove unused pset.
2757 2015-04-14 Jason Merrill <jason@redhat.com>
2759 * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
2762 * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
2765 * name-lookup.c (do_class_using_decl): Complain about specifying
2766 the current class even if there are dependent bases.
2768 2015-04-14 David Krauss <david_work@me.com>
2771 * decl.c (grokdeclarator): Do not flag friends with deduced return.
2773 2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
2774 Jason Merrill <jason@redhat.com>
2777 * parser.c (cp_parser_class_name): Add enum_ok parameter.
2778 (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
2779 (cp_parser_diagnose_invalid_type_name): Don't assume a template is
2782 2015-04-12 Jakub Jelinek <jakub@redhat.com>
2785 * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
2786 don't fold if op01 isn't divisible by TYPE_SIZE_UNIT. Convert
2787 the expression to the original type at the end.
2789 2015-04-09 Jakub Jelinek <jakub@redhat.com>
2792 * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
2796 * tree.c (build_cplus_array_type): Layout type before variants are
2797 set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
2800 2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
2803 * lambda.c (add_capture): Use dependent_type_p for capture by
2806 2015-04-02 Marek Polacek <polacek@redhat.com>
2809 * constexpr.c (cxx_eval_pointer_plus_expression): Call
2810 cxx_eval_constant_expression on the first operand.
2812 2015-04-01 Jason Merrill <jason@redhat.com>
2815 * decl.c (make_typename_type): Handle seeing a variable template.
2817 2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2820 * pt.c (instantiating_current_function_p): New.
2821 * name-lookup.c (pushdecl_maybe_friend_1): Use it.
2822 * cp-tree.h (instantiating_current_function_p): Declare.
2824 2015-04-01 Jason Merrill <jason@redhat.com>
2827 * decl.c (grokvardecl): Don't call check_explicit_specialization
2828 for non-template members of a class template.
2830 2015-04-01 Marek Polacek <polacek@redhat.com>
2833 * class.c (finish_struct): Require that the second field of a
2834 user-defined initializer_list be of size type.
2836 2015-03-31 Marek Polacek <polacek@redhat.com>
2839 * tree.c (build_cplus_array_type): Use dependent_type_p rather than
2840 checking for constness.
2842 2015-03-30 Marek Polacek <polacek@redhat.com>
2845 * constexpr.c (cxx_fold_indirect_ref): Don't perform the
2846 *(&A[i] p+ j) => A[i + j] transformation here.
2847 (cxx_eval_pointer_plus_expression): New function.
2848 (cxx_eval_constant_expression): Use it here.
2850 2015-03-27 Tobias Burnus <burnus@net-b.de>
2853 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
2854 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
2855 cp_parser_omp_declare): Don't show error for skipped omp pragmas with
2858 2015-03-27 Marek Polacek <polacek@redhat.com>
2861 * semantics.c (finish_switch_cond): If the unlowered type is not an
2862 enum, use the type of the condition.
2864 2015-03-27 Jason Merrill <jason@redhat.com>
2867 * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
2870 2015-03-26 Mikhail Maltsev <maltsevm@gmail.com>
2873 * init.c (build_vec_init): Fix initializing aggregates
2874 with empty init list.
2876 2015-03-26 Jason Merrill <jason@redhat.com>
2879 * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
2881 2015-03-25 Marek Polacek <polacek@redhat.com>
2884 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
2885 on an anonymous namespace.
2887 2015-03-25 Marek Polacek <polacek@redhat.com>
2890 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
2892 2015-03-24 Jason Merrill <jason@redhat.com>
2895 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
2896 * parser.c (cp_parser_namespace_definition): Don't set it.
2897 * name-lookup.c (handle_namespace_attrs): Check
2898 DECL_NAMESPACE_ASSOCIATIONS instead.
2901 * pt.c (get_mostly_instantiated_function_type): Just return the
2902 type of the partially instantiated template in DECL_TI_TEMPLATE.
2904 2015-03-20 Marek Polacek <polacek@redhat.com>
2907 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
2910 2015-03-20 Marek Polacek <polacek@redhat.com>
2913 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
2916 2015-03-19 Jason Merrill <jason@redhat.com>
2919 Automatically propagate ABI tags to variables and functions
2920 from their (return) type.
2921 * class.c (check_tag): Handle variables and functions.
2922 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
2923 (mark_or_check_tags): Likewise.
2924 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
2925 (check_abi_tags): Add single argument overload for decls.
2926 Handle inheriting tags for decls.
2927 * mangle.c (write_mangled_name): Call it.
2928 (mangle_return_type_p): Split out from write_encoding.
2929 (unmangled_name_p): Split out from write_mangled_name.
2930 (write_mangled_name): Ignore abi_tag on namespace.
2931 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
2932 * parser.c (cp_parser_namespace_definition): Set it.
2933 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
2934 about abi_tag attribute on non-inline namespace.
2935 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
2936 (handle_abi_tag_attribute): Allow tags on variables.
2938 2015-03-19 Jakub Jelinek <jakub@redhat.com>
2940 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
2941 attribute for DECL_EXTERNAL VAR_DECLs.
2943 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2946 * call.c (build_over_call): Pass the tsubst_flags_t argument to
2948 * decl2.c (mark_used): Inline the require_deduced_type call and
2949 guard the error call.
2951 2015-03-16 Jason Merrill <jason@redhat.com>
2954 * parser.c (cp_parser_template_name): Call strip_using_decl.
2956 2015-03-16 Marek Polacek <polacek@redhat.com>
2960 * decl.c (grokdeclarator): Allow volatile and constexpr together.
2962 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
2965 * decl.c (check_default_argument): Don't call
2966 maybe_warn_zero_as_null_pointer_constant.
2968 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
2970 * cp-gimplify.c (simple_empty_class_p): New.
2971 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
2972 the code for empty class copies into simple_empty_class_p, and
2973 adapt it to handle COMPOUND_EXPRs.
2975 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
2978 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
2979 only if the location of newdecl doesn't match the location of olddecl.
2981 2015-03-10 Jakub Jelinek <jakub@redhat.com>
2984 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
2987 2015-03-10 Jason Merrill <jason@redhat.com>
2991 * pt.c (dependent_type_p_r): Check both class and alias template args.
2993 2015-03-10 Jakub Jelinek <jakub@redhat.com>
2996 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
2997 before preparing arguments to warn_logical_not_parentheses.
2998 Use maybe_constant_value on rhs.
3000 2015-03-09 Jason Merrill <jason@redhat.com>
3003 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
3005 2015-03-09 Jakub Jelinek <jakub@redhat.com>
3008 * parser.c (cp_parser_binary_expression): Don't warn for
3009 !!x == y or !b == y where b is bool.
3011 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
3013 * ptree.c (cxx_print_lambda_node): New.
3014 (cxx_print_xnode): Handle LAMBDA_EXPR.
3016 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
3019 * constexpr.c (cxx_eval_constant_expression): Remove assert in
3020 RESULT_DECL handling.
3022 2015-02-26 Marek Polacek <polacek@redhat.com>
3025 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
3026 a RETURN_EXPR if its operand is null.
3028 2015-02-25 Jason Merrill <jason@redhat.com>
3031 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
3033 (constrain_visibility_for_template): Handle reference arguments.
3036 * decl.c (start_preparsed_function): Use create_artificial_label
3039 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
3040 Jakub Jelinek <jakub@redhat.com>
3043 * constexpr.c (check_constexpr_bind_expr_vars): Allow
3044 implicit typedefs for lambda types.
3046 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
3049 * decl.c (lookup_and_check_tag): Use strip_using_decl.
3051 2015-02-13 Jason Merrill <jason@redhat.com>
3054 * pt.c (template_args_equal): Look through conversions here.
3055 * tree.c (cp_tree_equal): Not here.
3057 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
3060 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
3061 pragma_external context.
3063 2015-02-13 Jason Merrill <jason@redhat.com>
3066 * call.c (reference_binding): Don't look for bad conversion
3067 if TO is incomplete.
3069 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
3072 * decl.c (make_typename_type): Pass tsubst_flags_t argument
3073 to lookup_template_class.
3075 2015-02-13 Jakub Jelinek <jakub@redhat.com>
3078 * decl.c (start_preparsed_function): Use void_type_node instead
3079 of NULL_TREE as LABEL_DECL type.
3081 2015-02-12 Jason Merrill <jason@redhat.com>
3084 * mangle.c (write_mangled_name): Fix test for variable template
3087 * decl.c (begin_destructor_body): Condition clobber on
3090 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
3093 * parser.c (lookup_literal_operator): Return all candidates.
3094 (cp_parser_userdef_char_literal): Simplify error handling.
3095 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
3096 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
3097 Also give higher priority to standard string UDL operator.
3099 2015-02-12 Jakub Jelinek <jakub@redhat.com>
3102 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
3103 * decl.c (poplevel): If functionbody, try not to create an extra
3104 BLOCK for function body and use subblocks as that, if it is non-NULL
3105 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
3106 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
3109 * except.c (check_noexcept_r): Return NULL for internal
3112 2015-02-10 Jason Merrill <jason@redhat.com>
3115 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
3117 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
3120 * method.c (use_thunk): Do not check for stdarg thunks.
3122 2015-02-06 Jason Merrill <jason@redhat.com>
3125 * init.c (build_vec_init): Handle default-initialized array with
3126 constexpr default constructor.
3128 2015-02-04 Jakub Jelinek <jakub@redhat.com>
3132 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
3134 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
3137 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
3138 for generated expressions.
3140 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
3143 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
3146 2015-02-02 Jason Merrill <jason@redhat.com>
3148 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
3150 2015-01-30 Joseph Myers <joseph@codesourcery.com>
3152 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
3153 changed to pass input_location as first argument.
3155 2015-01-29 Jakub Jelinek <jakub@redhat.com>
3158 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
3161 2015-01-29 Jason Merrill <jason@redhat.com>
3164 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
3165 erroneous return statement.
3168 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
3171 2015-01-27 Caroline Tice <cmtice@google.com>
3173 Committing VTV Cywin/Ming patch for Patrick Wollgast
3174 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
3175 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
3177 2015-01-27 Jason Merrill <jason@redhat.com>
3180 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
3181 current_function_decl.
3184 * pt.c (finish_template_variable): Move from semantics.c.
3185 Handle multiple template arg levels. Handle coercion here.
3186 (lookup_template_variable): Not here.
3188 2015-01-23 Jason Merrill <jason@redhat.com>
3192 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
3193 that has been completely split out.
3196 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
3200 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
3203 2015-01-21 Jason Merrill <jason@redhat.com>
3206 * constexpr.c (cxx_eval_constant_expression): Only shortcut
3207 constant CONSTRUCTORs.
3210 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
3211 give a hard error in a template instantiation.
3213 2015-01-21 Richard Biener <rguenther@suse.de>
3216 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
3217 for builtins the user declared correctly.
3219 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
3222 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
3223 TREE_TYPE (elt) == error_mark_node.
3225 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
3227 PR tree-optimization/62053
3228 * tree.c (build_cplus_array_type): Layout type after variants are set.
3230 2015-01-15 Jakub Jelinek <jakub@redhat.com>
3232 * cp-gimplify.c (cp_genericize_r): Call
3233 cp_ubsan_maybe_instrument_member_call for member calls.
3234 (cp_ubsan_check_member_access_r): New function.
3235 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
3236 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
3237 cp_ubsan_instrument_member_accesses,
3238 cp_ubsan_maybe_instrument_downcast,
3239 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
3240 * cp-ubsan.c: New file.
3241 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
3242 * constexpr.c (cxx_eval_call_expression): Return void_node
3244 (potential_constant_expression_1): Return true for
3245 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
3246 * typeck.c (build_class_member_access_expr): Provide locus
3248 (build_static_cast_1): Instrument downcasts.
3249 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
3250 add ubsan instrumentation for virtual_access.
3251 * call.c: Include internal-fn.h.
3252 (set_flags_from_callee): Handle internal calls.
3254 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
3257 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
3258 and function templates, declared only in the class.
3259 * decl.c (duplicate_decls): Reveal hidden friend functions or
3260 function templates, if they are redeclared outside the class.
3262 2015-01-15 Jason Merrill <jason@redhat.com>
3265 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
3268 * constexpr.c (potential_constant_expression_1): Handle reference
3271 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
3272 James Norris <jnorris@codesourcery.com>
3273 Cesar Philippidis <cesar@codesourcery.com>
3274 Ilmir Usmanov <i.usmanov@samsung.com>
3275 Jakub Jelinek <jakub@redhat.com>
3277 * parser.c: Include "gomp-constants.h".
3278 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
3279 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
3280 Use OMP_CLAUSE_SET_MAP_KIND.
3281 (cp_parser_omp_construct, cp_parser_pragma): Handle
3282 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
3283 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
3284 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
3285 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
3286 "create", "delete", "deviceptr", "host", "num_gangs",
3287 "num_workers", "present", "present_or_copy", "pcopy",
3288 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
3289 "present_or_create", "pcreate", "vector_length", "wait".
3290 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
3291 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
3292 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
3293 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
3294 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
3295 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
3296 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
3297 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
3298 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
3299 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
3300 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
3301 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
3302 (cp_parser_oacc_parallel, cp_parser_oacc_update)
3303 (cp_parser_oacc_wait): New functions.
3304 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
3305 (finish_oacc_parallel): New prototypes.
3306 * semantics.c: Include "gomp-constants.h".
3307 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
3308 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
3309 OMP_CLAUSE_SET_MAP_KIND.
3310 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
3311 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
3312 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
3313 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
3316 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
3319 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
3320 self-initialization.
3322 2015-01-13 Jason Merrill <jason@redhat.com>
3326 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
3327 pointer expressions.
3328 (cxx_eval_increment_expression): Likewise.
3331 * pt.c (coerce_template_parameter_pack): Return NULL for a
3332 zero-length fixed parameter pack with a pack expansion arg.
3335 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
3337 2015-01-12 Jason Merrill <jason@redhat.com>
3340 * constexpr.c (cxx_eval_call_expression): A call to a void
3341 function doesn't need to return a value.
3343 2015-01-09 Michael Collison <michael.collison@linaro.org>
3345 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
3346 input.h, alias.h, symtab.h, options.h, fold-const.h,
3347 wide-int.h, and inchash.h due to flattening of tree.h.
3349 * constexpr.c: Ditto.
3350 * cp-array-notation.c: Ditto.
3351 * cp-gimplify.c: Ditto.
3353 * cp-objcp-common.c: Ditto.
3366 * name-lookup.c: Ditto.
3367 * optimize.c: Ditto.
3374 * semantics.c: Ditto.
3379 2015-01-08 Jason Merrill <jason@redhat.com>
3381 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
3382 * decl.c (compute_array_index_type): Likewise.
3383 * init.c (build_vec_init): Likewise.
3384 * typeck.c (cp_build_binary_op): Likewise.
3386 2015-01-08 Jason Merrill <jason@redhat.com>
3388 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
3389 whether an initializer-list is too big for a VLA.
3390 (throw_bad_array_length): Remove.
3391 * cp-tree.h: Remove prototype.
3393 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
3396 * decl.c (grokfndecl): Add bool parameter.
3397 (grokdeclarator): Adjust calls.
3398 (start_decl): Don't set DECL_DELETED_FN here.
3400 2015-01-06 Jason Merrill <jason@redhat.com>
3402 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
3406 * pt.c (type_dependent_expression_p): Handle variable templates.
3407 * constexpr.c (potential_constant_expression_1): Use it.
3410 * semantics.c (finish_offsetof): Handle templates here.
3411 * parser.c (cp_parser_builtin_offsetof): Not here.
3414 * semantics.c (process_outer_var_ref): Diagnose lambda in local
3417 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
3420 * class.c (check_field_decls): Make copy assignment operators
3421 complex only in c++98 mode.
3423 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
3426 * class.c (check_for_override): Warn when a virtual function is an
3427 override not marked override.
3429 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
3431 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
3433 (get_basefndecls): Adjust.
3435 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3437 Update copyright years.
3439 2015-01-05 Marek Polacek <polacek@redhat.com>
3442 * typeck.c (cp_build_array_ref): Pass loc down to
3443 warn_array_subscript_with_type_char.
3446 Copyright (C) 2015 Free Software Foundation, Inc.
3448 Copying and distribution of this file, with or without modification,
3449 are permitted in any medium without royalty provided the copyright
3450 notice and this notice are preserved.