]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
c-pragma.c (oacc_pragmas): Add entry for declare directive.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2015-11-12 James Norris <jnorris@codesourcery.com>
2 Joseph Myers <joseph@codesourcery.com>
3
4 * parser.c (cp_parser_omp_clause_name): Handle 'device_resident'
5 clause.
6 (cp_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
7 and PRAGMA_OMP_CLAUSE_LINK.
8 (cp_paser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
9 and PRAGMA_OMP_CLAUSE_LINK.
10 (OACC_DECLARE_CLAUSE_MASK): New definition.
11 (cp_parser_oacc_declare): New function.
12 (cp_parser_pragma): Handle PRAGMA_OACC_DECLARE.
13 * pt.c (tsubst_expr): Handle OACC_DECLARE.
14
15 2015-11-12 Jason Merrill <jason@redhat.com>
16
17 * pt.c (check_explicit_specialization): Check the namespace after
18 we choose a template.
19
20 2015-11-11 Jason Merrill <jason@redhat.com>
21
22 * decl.c (duplicate_decls): When combining typedefs, remove the
23 new type from the variants list.
24
25 2015-11-11 Jason Merrill <jason@redhat.com>
26
27 * pt.c (instantiate_class_template_1): Set function_depth around
28 instantiation of lambda op().
29
30 2015-11-11 Marek Polacek <polacek@redhat.com>
31
32 PR c/68107
33 PR c++/68266
34 * decl.c (grokdeclarator): Call valid_array_size_p. Remove code
35 checking the size of an array.
36
37 2015-11-11 Dominique d'Humieres <dominiq@lps.ens.fr>
38
39 PR bootstrap/68271
40 * parser.h (cp_token): Update pragma_kind to 8.
41
42 2015-11-11 Andrew MacLeod <amacleod@redhat.com>
43
44 * call.c: Remove unused header files.
45 * class.c: Likewise.
46 * constexpr.c: Likewise.
47 * cp-array-notation.c: Likewise.
48 * cp-cilkplus.c: Likewise.
49 * cp-gimplify.c: Likewise.
50 * cp-lang.c: Likewise.
51 * cp-objcp-common.c: Likewise.
52 * cp-ubsan.c: Likewise.
53 * cvt.c: Likewise.
54 * cxx-pretty-print.c: Likewise.
55 * decl.c: Likewise.
56 * decl2.c: Likewise.
57 * dump.c: Likewise.
58 * error.c: Likewise.
59 * except.c: Likewise.
60 * expr.c: Likewise.
61 * friend.c: Likewise.
62 * g++spec.c: Likewise.
63 * init.c: Likewise.
64 * lambda.c: Likewise.
65 * lex.c: Likewise.
66 * mangle.c: Likewise.
67 * method.c: Likewise.
68 * name-lookup.c: Likewise.
69 * optimize.c: Likewise.
70 * parser.c: Likewise.
71 * pt.c: Likewise.
72 * ptree.c: Likewise.
73 * repo.c: Likewise.
74 * rtti.c: Likewise.
75 * search.c: Likewise.
76 * semantics.c: Likewise.
77 * tree.c: Likewise.
78 * typeck.c: Likewise.
79 * typeck2.c: Likewise.
80 * vtable-class-hierarchy.c: Likewise.
81
82 2015-11-09 Cesar Philippidis <cesar@codesourcery.com>
83
84 * parser.c (cp_finalize_oacc_routine): New boolean first argument.
85 (cp_ensure_no_oacc_routine): Update call to cp_finalize_oacc_routine.
86 (cp_parser_simple_declaration): Maintain a boolean first to keep track
87 of each new declarator. Propagate it to cp_parser_init_declarator.
88 (cp_parser_init_declarator): New boolean first argument. Propagate it
89 to cp_parser_save_member_function_body and cp_finalize_oacc_routine.
90 (cp_parser_member_declaration): Likewise.
91 (cp_parser_single_declaration): Update call to
92 cp_parser_init_declarator.
93 (cp_parser_save_member_function_body): New boolean first_decl argument.
94 Propagate it to cp_finalize_oacc_routine.
95 (cp_parser_finish_oacc_routine): New boolean first argument. Use it to
96 determine if multiple declarators follow a routine construct.
97 (cp_parser_oacc_routine): Update call to cp_parser_finish_oacc_routine.
98
99 2015-10-19 Martin Sebor <msebor@redhat.com>
100
101 PR c++/67913
102 PR c++/67927
103 * call.c (build_operator_new_call): Do not assume size_check
104 is non-null, analogously to the top half of the function.
105 * init.c (build_new_1): Detect and diagnose array sizes in
106 excess of the maximum of roughly SIZE_MAX / 2.
107 Insert a runtime check only for arrays with a non-constant size.
108 (build_new): Detect and diagnose negative array sizes.
109
110 2015-11-09 Thomas Schwinge <thomas@codesourcery.com>
111 Cesar Philippidis <cesar@codesourcery.com>
112 James Norris <jnorris@codesourcery.com>
113 Julian Brown <julian@codesourcery.com>
114 Nathan Sidwell <nathan@codesourcery.com>
115
116 * parser.h (struct cp_parser): Add oacc_routine field.
117 * parser.c (cp_ensure_no_oacc_routine): New.
118 (cp_parser_new): Initialize oacc_routine field.
119 (cp_parser_linkage_specification): Call cp_ensure_no_oacc_routine.
120 (cp_parser_namespace_definition,
121 cp_parser_class_specifier_1): Likewise.
122 (cp_parser_init_declarator): Call cp_finalize_oacc_routine.
123 (cp_parser_function_definition,
124 cp_parser_save_member_function_body): Likewise.
125 (OACC_ROUTINE_CLAUSE_MASK): New.
126 (cp_parser_finish_oacc_routine, cp_parser_oacc_routine,
127 cp_finalize_oacc_routine): New.
128 (cp_parser_pragma): Adjust omp_declare_simd checking. Call
129 cp_ensure_no_oacc_routine.
130 (cp_parser_pragma): Add OpenACC routine handling.
131
132 2015-11-08 Martin Sebor <msebor@redhat.com>
133
134 PR c++/67942
135 * cp/init.c (warn_placement_new_too_small): Convert integer
136 operand of POINTER_PLUS_EXPR to ssize_t to determine its signed
137 value.
138
139 2015-11-06 David Malcolm <dmalcolm@redhat.com>
140
141 * error.c (cp_printer): Update for new "caret_p" param for
142 textinfo::set_location.
143 (pedwarn_cxx98): Update for change in signature of
144 diagnostic_set_info.
145
146 2015-11-06 Jason Merrill <jason@redhat.com>
147
148 Support non-type constrained-type-specifiers.
149 * parser.c (check_type_concept): Remove.
150 (cp_parser_maybe_constrained_type_specifier): Don't call it.
151 (synthesize_implicit_template_parm): Handle non-type and template
152 template parameters. Also compare extra args. Return the decl.
153 (cp_parser_template_argument): Handle constrained-type-specifiers for
154 non-type template parameters.
155 (finish_constrained_template_template_parm): Split out from
156 cp_parser_constrained_template_template_parm.
157 (cp_parser_nonclass_name): Move some logic into
158 cp_parser_maybe_concept_name.
159 (cp_parser_init_declarator): Fix error recovery.
160 (get_concept_from_constraint): Remove.
161 (cp_parser_simple_type_specifier): Adjust for
162 synthesize_implicit_template_parm returning the decl.
163 * constraint.cc (placeholder_extract_concept_and_args)
164 (equivalent_placeholder_constraints): Also handle TYPE_DECL
165 constrained parms.
166
167 * pt.c (push_inline_template_parms_recursive): Don't recreate the
168 CONST_DECL.
169
170 2015-11-06 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
171
172 * init.c (warn_placement_new_too_small): Use %wu format
173 rather than %lu when printing bytes_avail.
174
175 2015-11-05 Cesar Philippidis <cesar@codesourcery.com>
176 Thomas Schwinge <thomas@codesourcery.com>
177 James Norris <jnorris@codesourcery.com>
178
179 * parser.c (cp_parser_omp_clause_name): Add support for
180 PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
181 (cp_parser_oacc_shape_clause): Allow pointer variables as gang static
182 arguments.
183 (cp_parser_oacc_clause_tile): New function.
184 (cp_parser_omp_clause_default): Add is_oacc argument. Handle
185 default(none) in OpenACC.
186 (cp_parser_oacc_all_clauses): Add support for
187 (cp_parser_omp_all_clauses): Update call to
188 cp_parser_omp_clause_default.
189 PRAGMA_OACC_CLAUSE_{DEFAULT,INDEPENDENT,TILE,PRIVATE,FIRSTPRIVATE}.
190 (OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
191 TILE}.
192 (OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
193 (OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
194 FIRSTPRIVATE}.
195 (cp_parser_oacc_update): Update the error message for missing clauses.
196 * semantics.c (finish_omp_clauses): Add support for
197 OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
198
199 2015-11-05 Martin Sebor <msebor@redhat.com>
200
201 PR c++/67942
202 * cp/init.c (warn_placement_new_too_small): Avoid assuming
203 the size of the first operand of placement new or its type
204 is known.
205
206 2015-11-05 Martin Sebor <msebor@redhat.com>
207
208 PR c++/67942
209 * cp/init.c (warn_placement_new_too_small): New function.
210 (build_new_1): Call it.
211
212 2015-11-05 Paolo Carlini <paolo.carlini@oracle.com>
213
214 PR c++/67846
215 * parser.c (cp_parser_lambda_body): Check lambda_return_type
216 return value.
217 * typeck2.c (cxx_incomplete_type_diagnostic): Print member or
218 member function used invalidly.
219
220 2015-11-05 Jakub Jelinek <jakub@redhat.com>
221 Ilya Verbin <ilya.verbin@intel.com>
222
223 * cp-tree.h (finish_omp_for): Add ORIG_INITS argument.
224 (omp_privatize_field): Add SHARED argument.
225 * parser.c: Include context.h.
226 (cp_parser_omp_clause_schedule): Parse schedule
227 modifiers, diagnose monotonic together with nonmonotonic.
228 (cp_parser_omp_clause_linear): Add DECLARE_SIMD argument. Parse
229 parameter name as linear step as id-expression rather than expression.
230 (cp_parser_omp_all_clauses): Adjust caller.
231 (cp_parser_omp_for_loop_init): Add ORIG_INIT argument,
232 initialize it. Adjust omp_privatize_field caller.
233 (cp_parser_omp_for_loop): Compute orig_inits, pass it's address
234 to finish_omp_for.
235 (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
236 (cp_parser_omp_target_data,
237 cp_parser_omp_target_enter_data,
238 cp_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER
239 and GOMP_MAP_FIRSTPRIVATE_REFERENCE.
240 (cp_parser_omp_target): Likewise. Evaluate num_teams and
241 thread_limit expressions on combined target teams before the target.
242 (cp_parser_omp_declare_target): If decl has "omp declare target" or
243 "omp declare target link" attribute, and cgraph or varpool node already
244 exists, then set corresponding flags. Call finish_omp_clauses
245 in the parenthesized extended-list syntax case. Call
246 cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol.
247 (cp_parser_omp_end_declare_target): Call cp_parser_require_pragma_eol
248 instead of cp_parser_skip_to_pragma_eol.
249 * decl2.c (cplus_decl_attributes): Don't diagnose block scope vars
250 inside declare target.
251 * pt.c (tsubst_omp_clauses): If OMP_CLAUSE_LINEAR_VARIABLE_STRIDE,
252 use tsubst_omp_clause_decl instead of tsubst_expr on
253 OMP_CLAUSE_LINEAR_STEP. Handle non-static data members in shared
254 clauses.
255 (tsubst_omp_for_iterator): Adjust omp_privatize_field caller.
256 (tsubst_find_omp_teams): New function.
257 (tsubst_expr): Evaluate num_teams and thread_limit expressions on
258 combined target teams before the target. Use OMP_FOR_ORIG_DECLS for
259 all OpenMP/OpenACC/Cilk+ looping constructs. Adjust finish_omp_for
260 caller.
261 * semantics.c (omp_privatize_field): Add SHARED argument, if true,
262 always create artificial var and never put it into the hash table
263 or vector.
264 (handle_omp_array_sections_1): Adjust omp_privatize_field caller.
265 Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections.
266 (handle_omp_array_sections): For structure element
267 based array sections use GOMP_MAP_ALWAYS_POINTER instead of
268 GOMP_MAP_FIRSTPRIVATE_POINTER. Encode low-bound into the MEM_REF,
269 either into the constant offset, or for variable low-bound using
270 POINTER_PLUS_EXPR.
271 (finish_omp_clauses): Adjust omp_privatize_field caller. Drop
272 generic_field_head, structure elements are now always mapped even
273 as array section bases, diagnose same var in data sharing and
274 mapping clauses. For references map what they refer to using
275 GOMP_MAP_ALWAYS_POINTER for structure elements and
276 GOMP_MAP_FIRSTPRIVATE_REFERENCE otherwise. Diagnose if linear step
277 on declare simd is neither a constant nor a uniform parameter.
278 Allow non-static data members on shared clauses. Look through
279 POINTER_PLUS_EXPR for array section reductions. Diagnose nonmonotonic
280 modifier on kinds other than dynamic or guided or nonmonotonic
281 modifier together with ordered clause. Diagnose the same var or
282 function appearing multiple times on the same directive. Fix up
283 wording for the to clause if t is neither a FUNCTION_DECL nor a
284 VAR_DECL, use special wording for OVERLOADs and TEMPLATE_ID_EXPR.
285 (handle_omp_for_class_iterator): Add ORIG_DECLS argument. Call
286 c_omp_check_loop_iv_exprs on cond.
287 (finish_omp_for): Add ORIG_INITS argument. Call
288 c_omp_check_loop_iv_exprs on ORIG_INITS elements. Adjust
289 handle_omp_for_class_iterator caller. Call c_omp_check_loop_iv.
290 Call add_stmt.
291 (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
292
293 2015-11-04 Cesar Philippidis <cesar@codesourcery.com>
294
295 * (cp_parser_oacc_single_int_clause): New function.
296 (cp_parser_oacc_clause_vector_length): Delete.
297 (cp_parser_omp_clause_num_gangs): Delete.
298 (cp_parser_omp_clause_num_workers): Delete.
299 (cp_parser_oacc_all_clauses): Use cp_parser_oacc_single_int_clause
300 for num_gangs, num_workers and vector_length.
301
302 2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
303
304 * call.c (validate_conversion_obstack): Define unconditionally.
305 * constexpr.c (maybe_constant_value, fold_non_dependent_expr): Use
306 gcc_checking_assert.
307 * cp-tree.h: Use CHECKING_P instead of ENABLE_CHECKING.
308 * decl2.c (cxx_post_compilation_parsing_cleanups): Use flag_checking.
309 * mangle.c (add_substitution): Likewise.
310 * method.c (maybe_explain_implicit_delete): Likewise.
311 * parser.c (cp_parser_template_argument_list): Remove conditional
312 compilation.
313 * pt.c (check_unstripped_args): Rename to...
314 (verify_unstripped_args): ... this and remove conditional compilation.
315 (retrieve_specialization): Guard call of verify_unstripped_args with
316 flag_checking.
317 (template_parm_to_arg): Remove conditional compilation.
318 (template_parms_to_args, coerce_template_parameter_pack,
319 coerce_template_parms): Likewise.
320 (tsubst_copy): Use flag_checking.
321 (type_unification_real): Remove conditional compilation.
322 (build_non_dependent_expr): Use flag_checking.
323 * tree.c (build_target_expr): Remove conditional compilation, use
324 gcc_checking_assert.
325 * typeck.c (comptypes): Likewise.
326 * typeck2.c (digest_init_r): Likewise.
327
328 2015-11-03 Jason Merrill <jason@redhat.com>
329
330 * pt.c (struct find_parameter_pack_data): Add
331 type_pack_expansion_p field.
332 (find_parameter_packs_r): Use it to turn 'auto' into a parameter pack.
333 (uses_parameter_packs, make_pack_expansion)
334 (check_for_bare_parameter_packs, fixed_parameter_pack_p): Set it.
335
336 2015-11-03 Thomas Schwinge <thomas@codesourcery.com>
337 Chung-Lin Tang <cltang@codesourcery.com>
338
339 * parser.c (cp_parser_omp_construct, cp_parser_pragma): Handle
340 PRAGMA_OACC_ATOMIC.
341
342 2015-10-31 Ville Voutilainen <ville.voutilainen@gmail.com>
343
344 Remove the implementation of N3994, terse range-for loops.
345 * parser.c (cp_parser_for_init_statement): Remove the parsing
346 of a terse range-for.
347
348 2015-10-31 Jason Merrill <jason@redhat.com>
349
350 Implement multiple 'auto' feature from Concepts TS.
351 * parser.c (cp_parser_type_id_1): Allow 'auto' if -fconcepts.
352 (cp_parser_template_type_arg): Likewise.
353 (get_concept_from_constraint): Split out most logic to...
354 * constraint.cc (placeholder_extract_concept_and_args): ...here.
355 (equivalent_placeholder_constraints, hash_placeholder_constraint): New.
356 * cxx-pretty-print.c (pp_cxx_constrained_type_spec): New.
357 * cxx-pretty-print.h: Declare it.
358 * error.c (dump_type) [TEMPLATE_TYPE_PARM]: Call it.
359 * pt.c (is_auto_r, extract_autos_r, extract_autos, auto_hash): New.
360 (type_uses_auto): Use is_auto_r.
361 (do_auto_deduction): Handle multiple 'auto's if -fconcepts.
362 * typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Compare
363 constraints.
364
365 * pt.c (for_each_template_parm_r): Use WALK_SUBTREE.
366 Return a meaningful value rather than error_mark_node.
367 (for_each_template_parm): Return a tree.
368 (uses_template_parms_level): Return bool.
369 * cp-tree.h: Adjust.
370
371 * pt.c (unify): Don't diagnose no common base if we already have
372 the same template.
373 (do_auto_deduction): Explain deduction failure.
374
375 * pt.c (hash_tmpl_and_args): Use iterative_hash_object on template
376 uid.
377
378 * parser.c (synthesize_implicit_template_parm)
379 (finish_fully_implicit_template): Make static.
380
381 2015-10-29 Andrew MacLeod <amacleod@redhat.com>
382
383 * call.c: Reorder #include's and remove duplicates.
384 * class.c: Likewise.
385 * constexpr.c: Likewise.
386 * cp-array-notation.c: Likewise.
387 * cp-cilkplus.c: Likewise.
388 * cp-gimplify.c: Likewise.
389 * cp-lang.c: Likewise.
390 * cp-objcp-common.c: Likewise.
391 * cp-ubsan.c: Likewise.
392 * cvt.c: Likewise.
393 * cxx-pretty-print.c: Likewise.
394 * decl.c: Likewise.
395 * decl2.c: Likewise.
396 * dump.c: Likewise.
397 * error.c: Likewise.
398 * except.c: Likewise.
399 * expr.c: Likewise.
400 * friend.c: Likewise.
401 * init.c: Likewise.
402 * lambda.c: Likewise.
403 * lex.c: Likewise.
404 * mangle.c: Likewise.
405 * method.c: Likewise.
406 * name-lookup.c: Likewise.
407 * optimize.c: Likewise.
408 * parser.c: Likewise.
409 * pt.c: Likewise.
410 * ptree.c: Likewise.
411 * repo.c: Likewise.
412 * rtti.c: Likewise.
413 * search.c: Likewise.
414 * semantics.c: Likewise.
415 * tree.c: Likewise.
416 * typeck.c: Likewise.
417 * typeck2.c: Likewise.
418 * vtable-class-hierarchy.c: Likewise.
419
420 2015-10-29 Paolo Carlini <paolo.carlini@oracle.com>
421
422 PR c++/67845
423 * decl.c (grokfndecl): In case of erroneous cv-qualified non-member
424 functions consistently reset TREE_TYPE (decl) too.
425
426 2015-10-28 Jason Merrill <jason@redhat.com>
427
428 DR 1518
429 * class.c (type_has_user_provided_or_explicit_constructor): New.
430 (check_bases_and_members): Use it.
431 * cp-tree.h: Declare it.
432
433 2015-10-27 Cesar Philippidis <cesar@codesourcery.com>
434 Thomas Schwinge <thomas@codesourcery.com>
435 James Norris <jnorris@codesourcery.com>
436 Joseph Myers <joseph@codesourcery.com>
437 Julian Brown <julian@codesourcery.com>
438 Nathan Sidwell <nathan@codesourcery.com>
439 Bernd Schmidt <bschmidt@redhat.com>
440
441 * parser.c (cp_parser_omp_clause_name): Add auto, gang, seq,
442 vector, worker.
443 (cp_parser_oacc_simple_clause): New.
444 (cp_parser_oacc_shape_clause): New.
445 (cp_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
446 (OACC_LOOP_CLAUSE_MASK): Likewise.
447 * semantics.c (finish_omp_clauses): Add auto, gang, seq, vector,
448 worker. Unify the handling of teams, tasks and vector_length with
449 the other loop shape clauses.
450
451 2015-10-27 Thomas Schwinge <thomas@codesourcery.com>
452 James Norris <jnorris@codesourcery.com>
453 Cesar Philippidis <cesar@codesourcery.com>
454
455 PR c/64765
456 PR c/64880
457 * cp-tree.h (finish_oacc_kernels, finish_oacc_parallel): Don't
458 declare functions.
459 (finish_omp_construct): Declare function.
460 * parser.c (cp_parser_oacc_loop): Add p_name, mask, cclauses
461 formal parameters, and handle these. Adjust all users.
462 (cp_parser_oacc_kernels, cp_parser_oacc_parallel): Merge functions
463 into...
464 (cp_parser_oacc_kernels_parallel): ... this new function. Adjust
465 all users.
466 * semantics.c (finish_oacc_kernels, finish_oacc_parallel): Merge functions into...
467 (finish_omp_construct): ... this new function.
468
469 2015-10-25 Jason Merrill <jason@redhat.com>
470
471 DR 2179
472 * pt.c (process_partial_specialization): Handle error_mark_node
473 from most_specialized_partial_spec.
474
475 2015-10-23 Jason Merrill <jason@redhat.com>
476
477 DR 1518
478 DR 1630
479 PR c++/54835
480 PR c++/60417
481 * call.c (convert_like_real): Value-initialization can't use
482 explicit constructors in C++11 and up.
483
484 PR c++/67813
485 * constexpr.c (cxx_eval_store_expression): Always use *valp if
486 set.
487
488 2015-10-22 Jason Merrill <jason@redhat.com>
489
490 * call.c (add_template_conv_candidate): Pass DEDUCE_CALL.
491 (add_template_candidate_real): Handle it.
492 * pt.c (fn_type_unification): Handle it.
493
494 * call.c (add_conv_candidate): Remove first_arg parm.
495 (add_template_conv_candidate): Likewise.
496 (add_template_candidate_real): Don't pass it.
497 (build_op_call_1): Likewise.
498
499 2015-10-22 Richard Biener <rguenther@suse.de>
500
501 * semantics.c (cp_finish_omp_clause_depend_sink): Properly convert
502 before folding a MINUS_EXPR.
503 (finish_omp_clauses): Likewise.
504
505 2015-10-21 Paolo Carlini <paolo.carlini@oracle.com>
506
507 PR c++/66781
508 * parser.c (cp_parser_enum_specifier): Upon error_at set
509 nested_name_specifier to error_mark_node; improve error message.
510
511 2015-10-21 Paolo Carlini <paolo.carlini@oracle.com>
512
513 PR c++/67847
514 * parser.c (cp_parser_enum_specifier): Reject a nested_name_specifier
515 which doesn't name a class or namespace.
516
517 2015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
518
519 * call.c (build_conditional_expr_1): Use boolean vector
520 type for vector comparison.
521 * typeck.c (build_vec_cmp): New.
522 (cp_build_binary_op): Use build_vec_cmp for comparison.
523
524 2015-10-20 Jason Merrill <jason@redhat.com>
525
526 PR c++/66583
527 * init.c (innermost_aggr_scope): New.
528 (build_field_list): Change uses_unions_p to uses_unions_or_anon_p.
529 (sort_mem_initializers): Handle initializers for entire anonymous
530 aggregates.
531
532 2015-10-20 Marek Polacek <polacek@redhat.com>
533
534 * parser.c (is_cilkplus_vector_p): Don't define here.
535
536 2015-10-19 Jason Merrill <jason@redhat.com>
537
538 PR c++/67064
539 * semantics.c (force_paren_expr): Don't mess with hard register vars.
540
541 Implement N4268, Do constant evaluation of all non-type template args.
542 * parser.c (cp_parser_template_argument): For C++1z just parse a
543 constant-expression.
544 * pt.c (convert_nontype_argument): For C++1z always call
545 maybe_constant_value.
546
547 * constexpr.c (cxx_eval_constant_expression): Expand PTRMEM_CST
548 only when necessary.
549 (cxx_eval_component_reference): Like here.
550 * decl2.c (lower_var_init): And here.
551 (c_parse_final_cleanups): Call it.
552 * typeck2.c (digest_init_r): Not here.
553 * decl.c (complete_vars): Or here.
554 (cp_finish_decl): Add local statics to symbol table.
555
556 2015-10-17 Jason Merrill <jason@redhat.com>
557
558 PR c++/68006
559 * decl.c (implicit_default_ctor_p): New.
560 (start_preparsed_function): Don't clobber on entry to one.
561
562 2015-10-16 Paolo Carlini <paolo.carlini@oracle.com>
563
564 PR c++/67926
565 * constexpr.c (potential_constant_expression_1): Handle
566 UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR, BINARY_LEFT_FOLD_EXPR,
567 BINARY_RIGHT_FOLD_EXPR.
568
569 2015-10-13 Jakub Jelinek <jakub@redhat.com>
570 Aldy Hernandez <aldyh@redhat.com>
571
572 * class.c (finish_struct_1): Call finish_omp_declare_simd_methods.
573 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_TASKLOOP.
574 (cp_genericize_r): Likewise.
575 (cxx_omp_finish_clause): Don't diagnose references.
576 (cxx_omp_disregard_value_expr): New function.
577 * cp-objcp-common.h (LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR): Redefine.
578 * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Document for OMP_TASKLOOP.
579 (DECL_OMP_PRIVATIZED_MEMBER): Define.
580 (finish_omp_declare_simd_methods, push_omp_privatization_clauses,
581 pop_omp_privatization_clauses, save_omp_privatization_clauses,
582 restore_omp_privatization_clauses, omp_privatize_field,
583 cxx_omp_disregard_value_expr): New prototypes.
584 (finish_omp_clauses): Add two new arguments.
585 (finish_omp_for): Add ORIG_DECLV argument.
586 * parser.c (cp_parser_lambda_body): Call
587 save_omp_privatization_clauses and restore_omp_privatization_clauses.
588 (cp_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
589 (cp_parser_omp_var_list_no_open): Handle structure elements for
590 map, to and from clauses. Handle array sections in reduction
591 clause. Parse this keyword. Formatting fixes.
592 (cp_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
593 if clause modifiers.
594 (cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize,
595 cp_parser_omp_clause_priority, cp_parser_omp_clause_hint,
596 cp_parser_omp_clause_defaultmap): New functions.
597 (cp_parser_omp_clause_ordered): Parse optional parameter.
598 (cp_parser_omp_clause_reduction): Handle array reductions.
599 (cp_parser_omp_clause_schedule): Parse optional simd modifier.
600 (cp_parser_omp_clause_nogroup, cp_parser_omp_clause_orderedkind):
601 New functions.
602 (cp_parser_omp_clause_linear): Parse linear clause modifiers.
603 (cp_parser_omp_clause_depend_sink): New function.
604 (cp_parser_omp_clause_depend): Parse source/sink depend kinds.
605 (cp_parser_omp_clause_map): Parse release/delete map kinds and
606 optional always modifier.
607 (cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_if
608 and finish_omp_clauses callers.
609 (cp_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
610 Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
611 (OMP_CRITICAL_CLAUSE_MASK): Define.
612 (cp_parser_omp_critical): Parse critical clauses.
613 (cp_parser_omp_for_incr): Use cp_tree_equal if
614 processing_template_decl.
615 (cp_parser_omp_for_loop_init): Return tree instead of bool. Handle
616 non-static data member iterators.
617 (cp_parser_omp_for_loop): Handle doacross loops, adjust
618 finish_omp_for and finish_omp_clauses callers.
619 (cp_omp_split_clauses): Adjust finish_omp_clauses caller.
620 (OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
621 (cp_parser_omp_simd): Allow ordered clause if it has no parameter.
622 (OMP_FOR_CLAUSE_MASK): Add linear clause.
623 (cp_parser_omp_for): Disallow ordered clause when combined with
624 distribute. Disallow linear clause when combined with distribute
625 and not combined with simd.
626 (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
627 (cp_parser_omp_ordered): Add CONTEXT argument, return bool instead
628 of tree, parse clauses and if depend clause is found, don't parse
629 a body.
630 (cp_parser_omp_parallel): Disallow copyin clause on target parallel.
631 Allow target parallel without for after it.
632 (OMP_TASK_CLAUSE_MASK): Add priority clause.
633 (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
634 (cp_parser_omp_target_data): Diagnose no map clauses or clauses with
635 invalid kinds.
636 (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
637 (OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
638 OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
639 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): New
640 functions.
641 (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
642 defaultmap and is_device_ptr clauses.
643 (cp_parser_omp_target): Parse target parallel and target simd. Set
644 OMP_TARGET_COMBINED on combined constructs. Parse target enter data
645 and target exit data. Diagnose invalid map kinds.
646 (cp_parser_oacc_cache): Adjust finish_omp_clauses caller.
647 (OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
648 (cp_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
649 construct.
650 (OMP_TASKLOOP_CLAUSE_MASK): Define.
651 (cp_parser_omp_taskloop): New function.
652 (cp_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
653 handle PRAGMA_OMP_TASKLOOP.
654 (cp_parser_pragma): Handle PRAGMA_OMP_ORDERED here directly,
655 handle PRAGMA_OMP_TASKLOOP, call push_omp_privatization_clauses
656 and pop_omp_privatization_clauses around parsing calls.
657 (cp_parser_cilk_for): Adjust finish_omp_clauses caller.
658 * pt.c (apply_late_template_attributes): Adjust tsubst_omp_clauses
659 and finish_omp_clauses callers.
660 (tsubst_omp_clause_decl): Return NULL if decl is NULL.
661 For TREE_LIST, copy over OMP_CLAUSE_DEPEND_SINK_NEGATIVE bit.
662 Use tsubst_expr instead of tsubst_copy, undo convert_from_reference
663 effects.
664 (tsubst_omp_clauses): Add ALLOW_FIELDS argument. Handle new
665 OpenMP 4.5 clauses. Use tsubst_omp_clause_decl for more clauses.
666 If ALLOW_FIELDS, handle non-static data members in the clauses.
667 Clear OMP_CLAUSE_LINEAR_STEP if it has been cleared before.
668 (omp_parallel_combined_clauses): New variable.
669 (tsubst_omp_for_iterator): Add ORIG_DECLV argument, recur on
670 OMP_FOR_ORIG_DECLS, handle non-static data member iterators.
671 Improve handling of clauses on combined constructs.
672 (tsubst_expr): Call push_omp_privatization_clauses and
673 pop_omp_privatization_clauses around instantiation of certain
674 OpenMP constructs, improve handling of clauses on combined
675 constructs, handle OMP_TASKLOOP, adjust tsubst_omp_for_iterator,
676 tsubst_omp_clauses and finish_omp_for callers, handle clauses on
677 critical and ordered, handle OMP_TARGET_{ENTER,EXIT}_DATA.
678 (instantiate_decl): Call save_omp_privatization_clauses and
679 restore_omp_privatization_clauses around instantiation.
680 (dependent_omp_for_p): Fix up comment typo. Handle SCOPE_REF.
681 * semantics.c (omp_private_member_map, omp_private_member_vec,
682 omp_private_member_ignore_next): New variables.
683 (finish_non_static_data_member): Return dummy decl for privatized
684 non-static data members.
685 (omp_clause_decl_field, omp_clause_printable_decl,
686 omp_note_field_privatization, omp_privatize_field): New functions.
687 (handle_omp_array_sections_1): Fix comment typo.
688 Add IS_OMP argument, handle structure element bases, diagnose
689 bitfields, pass IS_OMP recursively, diagnose known zero length
690 array sections in depend clauses, handle array sections in reduction
691 clause, diagnose negative length even for pointers.
692 (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
693 types, pass IS_OMP down to handle_omp_array_sections_1, handle
694 array sections in reduction clause, set
695 OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
696 length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
697 (finish_omp_reduction_clause): Handle array sections and arrays.
698 Use omp_clause_printable_decl.
699 (finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink):
700 New functions.
701 (finish_omp_clauses): Add ALLOW_FIELDS and DECLARE_SIMD arguments.
702 Handle new OpenMP 4.5 clauses and new restrictions for the old
703 ones, handle non-static data members, reject this keyword when not
704 allowed.
705 (push_omp_privatization_clauses, pop_omp_privatization_clauses,
706 save_omp_privatization_clauses, restore_omp_privatization_clauses):
707 New functions.
708 (handle_omp_for_class_iterator): Handle OMP_TASKLOOP class iterators.
709 Add collapse and ordered arguments. Fix handling of lastprivate
710 iterators in doacross loops.
711 (finish_omp_for): Add ORIG_DECLV argument, handle doacross loops,
712 adjust c_finish_omp_for, handle_omp_for_class_iterator and
713 finish_omp_clauses callers. Fill in OMP_CLAUSE_LINEAR_STEP on simd
714 loops with non-static data member iterators.
715
716 2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
717
718 PR c++/58566
719 * lambda.c (lambda_return_type): Return error_mark_node
720 instead of void_type_node for the error cases.
721
722 2015-10-08 Jason Merrill <jason@redhat.com>
723
724 * cp-tree.h (SIMPLE_TARGET_EXPR_P): New.
725 * init.c (get_nsdmi): Use it.
726 * typeck2.c (massage_init_elt): Use it.
727
728 2015-10-07 Jason Merrill <jason@redhat.com>
729
730 PR c++/67557
731 * call.c (is_base_field_ref): New.
732 (unsafe_copy_elision_p): New.
733 (build_over_call): Use it.
734
735 2015-10-07 Marek Polacek <polacek@redhat.com>
736
737 PR sanitizer/67867
738 * search.c (accessible_p): Initialize OTYPE to NULL_TREE.
739
740 2015-10-07 Marek Polacek <polacek@redhat.com>
741
742 * cp-gimplify.c (genericize_if_stmt): Use protected_set_expr_location.
743 (genericize_cp_loop): Likewise.
744 * decl.c (cxx_maybe_build_cleanup): Likewise.
745 * parser.c (cp_parser_binary_expression): Likewise.
746 (cp_parser_omp_for_loop): Likewise.
747 (cp_parser_omp_construct): Likewise.
748 * semantics.c (finish_transaction_stmt): Likewise.
749 (build_transaction_expr): Likewise.
750
751 2015-10-06 Jason Merrill <jason@redhat.com>
752
753 PR c++/67810
754 * parser.c (cp_parser_fold_expr_p): Remove.
755 (is_binary_op): New.
756 (cp_parser_fold_expression): Take LHS as parameter.
757 (cp_parser_primary_expression): Call it after parsing an expression.
758 (cp_parser_binary_expression, cp_parser_assignment_operator_opt)
759 (cp_parser_expression): Ignore an operator followed by '...'.
760 (is_binary_op): New.
761 * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
762 (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle errors.
763
764 2015-10-06 Marek Polacek <polacek@redhat.com>
765
766 PR c++/67863
767 * call.c (build_conditional_expr_1): Build the COND_EXPR with
768 a location.
769
770 2015-10-05 Paolo Carlini <paolo.carlini@oracle.com>
771
772 PR c++/53856
773 * pt.c (check_default_tmpl_args): Per [temp.param]/9, do not
774 reject default template arguments in out of class definitions
775 of members of non-template classes.
776
777 2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
778
779 * tree.c (cp_tree_equal): Use real_equal instead of
780 REAL_VALUES_EQUAL.
781
782 2015-10-04 Jason Merrill <jason@redhat.com>
783
784 Implement N4514, C++ Extensions for Transactional Memory.
785 * cp-tree.h (struct cp_declarator): Add tx_qualifier field.
786 (BCS_NORMAL, BCS_TRANSACTION): New enumerators.
787 * lex.c (init_reswords): Limit TM kewords to -fgnu-tm.
788 * parser.c (cp_lexer_get_preprocessor_token): Fix @synchronized.
789 (make_call_declarator): Take tx_qualifier.
790 (cp_parser_tx_qualifier_opt): New.
791 (cp_parser_lambda_declarator_opt): Use it.
792 (cp_parser_direct_declarator): Likewise.
793 (cp_parser_statement): Handle atomic_noexcept, atomic_cancel.
794 (cp_parser_compound_statement): Change in_try parameter to bcs_flags.
795 (cp_parser_std_attribute): Map optimize_for_synchronized to
796 transaction_callable.
797 (cp_parser_transaction): Take the token. Handle atomic_noexcept.
798 * lambda.c (maybe_add_lambda_conv_op): Handle transaction-safety.
799 * call.c (enum conversion_kind): Add ck_tsafe.
800 (standard_conversion): Handle transaction-safety conversion.
801 (convert_like_real, resolve_address_of_overloaded_function): Likewise.
802 (check_methods): Diagnose transaction_safe_dynamic on non-virtual
803 function.
804 (look_for_tm_attr_overrides): Don't inherit transaction_safe_dynamic.
805 * cvt.c (tx_safe_fn_type_p, tx_unsafe_fn_variant)
806 (can_convert_tx_safety): New.
807 * typeck.c (composite_pointer_type): Handle transaction-safety.
808 * name-lookup.h (enum scope_kind): Add sk_transaction.
809 * name-lookup.c (begin_scope): Handle it.
810 * semantics.c (begin_compound_stmt): Pass it.
811 * decl.c (check_previous_goto_1): Check it.
812 (struct named_label_entry): Add in_transaction_scope.
813 (poplevel_named_label_1): Set it.
814 (check_goto): Check it.
815 (duplicate_decls): A specialization can be transaction_safe
816 independently of its template.
817 (grokdeclarator): Handle tx-qualifier.
818 * rtti.c (ptr_initializer): Handle transaction-safe.
819 * search.c (check_final_overrider): Check transaction_safe_dynamic.
820 Don't check transaction_safe.
821 * mangle.c (write_function_type): Mangle transaction_safe here.
822 (write_CV_qualifiers_for_type): Not here.
823 (write_type): Preserve transaction_safe when stripping attributes.
824 * error.c (dump_type_suffix): Print transaction_safe.
825
826 2015-10-02 Marek Polacek <polacek@redhat.com>
827
828 PR c/64249
829 * parser.c (cp_parser_statement): Add CHAIN parameter and pass it
830 down to cp_parser_selection_statement.
831 (cp_parser_selection_statement): Add CHAIN parameter. Add code to
832 warn about duplicated if-else-if conditions.
833 (cp_parser_implicitly_scoped_statement): Add CHAIN parameter and pass
834 it down to cp_parser_statement.
835
836 2015-10-01 Ville Voutilainen <ville.voutilainen@gmail.com>
837
838 PR c++/54430
839 * name-lookup.c (push_binding): Make non-static.
840 * name-lookup.h (push_binding): Declare it.
841 * parser.c (cp_parser_range_for): Use it, get the range
842 declaration away from the scope until the range expression
843 has been parsed, then restore the declaration.
844
845 2015-09-23 Ville Voutilainen <ville.voutilainen@gmail.com>
846
847 Fix small typos in the coding rule enforcement warnings.
848 * parser.c (cp_parser_namespace_definition): Replace 'namepace'
849 with 'namespace'.
850
851 2015-09-22 Nathan Sidwell <nathan@codesourcery.com>
852
853 * decl.c (xref_basetypes): Check virtual and/or multiple
854 inheritance warning.
855 * parser.c (cp_parser_namespace_definition): Check namespaces
856 warning.
857 * pt.c (push_template_decl_real): Check templates warning.
858
859 2015-09-22 Jason Merrill <jason@redhat.com>
860
861 * mangle.c (abi_warn_or_compat_version_crosses): New.
862 Use it instead of abi_version_crosses.
863 (mangle_decl): Deal with -fabi-compat-version and -Wabi separately.
864
865 2015-09-21 Ville Voutilainen <ville.voutilainen@gmail.com>
866
867 Complete the implementation of N4230, Nested namespace definition.
868 * parser.c (cp_parser_namespace_definition): Support namespace
869 attributes both before and after the namespace identifier.
870
871 2015-09-19 Trevor Saunders <tbsaunde@tbsaunde.org>
872
873 * cp-gimplify.c (gimplify_must_not_throw_expr): Adjust.
874
875 2015-09-18 Ville Voutilainen <ville.voutilainen@gmail.com>
876
877 Implement nested namespace definitions.
878 * parser.c (cp_parser_namespace_definition): Grok nested namespace
879 definitions.
880
881 2015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
882
883 * parser.c (pragma_lex): Add loc argument. Rearrange the code to
884 make it more similar to the C version.
885
886 2015-09-17 Andrew Sutton <andrew.n.sutton@gmail.com>
887 Jason Merrill <jason@redhat.com>
888
889 Implement N4295 fold-expressions.
890 * cp-tree.def: Add UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR,
891 BINARY_LEFT_FOLD_EXPR, BINARY_RIGHT_FOLD_EXPR.
892 * cp-objcp-common.c (cp_common_init_ts): Handle them.
893 * cp-tree.h (FOLD_EXPR_CHECK, BINARY_FOLD_EXPR_CHECK, FOLD_EXPR_P)
894 (FOLD_EXPR_MODIFY_P, FOLD_EXPR_OP, FOLD_EXPR_PACK, FOLD_EXPR_INIT): New.
895 * parser.c (cp_parser_skip_to_closing_parenthesis): Split out...
896 (cp_parser_skip_to_closing_parenthesis_1): This function. Change
897 or_comma parameter to or_ttype.
898 (cp_parser_fold_operator, cp_parser_fold_expr_p)
899 (cp_parser_fold_expression): New.
900 (cp_parser_primary_expression): Use them.
901 * pt.c (expand_empty_fold, fold_expression, tsubst_fold_expr_pack)
902 (tsubst_fold_expr_init, expand_left_fold, tsubst_unary_left_fold)
903 (tsubst_binary_left_fold, expand_right_fold)
904 (tsubst_unary_right_fold, tsubst_binary_right_fold): New.
905 (tsubst_copy): Use them.
906 (type_dependent_expression_p): Handle fold-expressions.
907 * semantics.c (finish_unary_fold_expr)
908 (finish_left_unary_fold_expr, finish_right_unary_fold_expr)
909 (finish_binary_fold_expr): New.
910
911 2015-09-17 Richard Biener <rguenther@suse.de>
912
913 * cp-tree.h (note_decl_for_pch): Remove.
914 * class.c (build_clone): Do not call note_decl_for_pch.
915 * semantics.c (finish_member_declaration): Likewise.
916 (note_decl_for_pch): Remove.
917 * decl2.c (c_parse_final_cleanups): Mangle all globals before
918 writing the PCH.
919
920 2015-09-14 Jason Merrill <jason@redhat.com>
921
922 PR c++/44282
923 * mangle.c (write_CV_qualifiers_for_type): Also warn about regparm
924 mangling with lower -fabi-version.
925
926 2015-09-14 Paolo Carlini <paolo.carlini@oracle.com>
927
928 PR c++/51911
929 * parser.c (cp_parser_new_expression): Enforce 5.3.4/2 (as amended
930 per the spirit of DR 1467).
931
932 2015-09-11 Mark Wielaard <mjw@redhat.com>
933
934 PR c/28901
935 * cp-objcp-common.c (cxx_warn_unused_global_decl): Remove hard-coded
936 VAR_P TREE_READONLY override.
937
938 2015-09-10 Paolo Carlini <paolo.carlini@oracle.com>
939
940 PR c++/67318
941 * parser.c (cp_parser_parameter_declaration): Consume the ellipsis
942 and set template_parameter_pack_p also when the type is null.
943
944 2015-09-09 Mark Wielaard <mjw@redhat.com>
945
946 * typeck.c (cp_build_binary_op): Check and warn when nonnull arg
947 parm against NULL.
948
949 2015-09-10 Jakub Jelinek <jakub@redhat.com>
950
951 PR c++/67522
952 * semantics.c (handle_omp_array_sections_1): Only run
953 type_dependent_expression_p on VAR_DECL/PARM_DECLs.
954 (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Likewise.
955 Don't adjust OMP_CLAUSE_LINEAR_STEP if OMP_CLAUSE_DECL
956 is not a VAR_DECL/PARM_DECL.
957
958 PR c++/67511
959 * semantics.c (handle_omp_for_class_iterator): Don't wrap
960 error_mark_node into a NOP_EXPR to void_type_node.
961
962 2015-09-09 Paolo Carlini <paolo.carlini@oracle.com>
963
964 PR c++/53184
965 * decl2.c (constrain_class_visibility): Use Wsubobject-linkage.
966
967 2015-09-09 Jakub Jelinek <jakub@redhat.com>
968
969 PR c++/67504
970 * parser.c (cp_parser_omp_clause_collapse): Test tree_fits_shwi_p
971 before INTEGRAL_TYPE_P test.
972
973 2015-09-08 Jason Merrill <jason@redhat.com>
974
975 PR c++/67041
976 * pt.c (tsubst_copy_and_build): Handle variables like functions.
977
978 2015-09-08 Paolo Carlini <paolo.carlini@oracle.com>
979
980 PR c++/67369
981 * pt.c (tsubst_copy, [case FUNCTION_DECL]): Do not call tsubst
982 if the first argument isn't a template.
983
984 2015-09-03 Martin Sebor <msebor@redhat.com>
985
986 PR c/66516
987 * cp-tree.h (mark_rvalue_use, decay_conversion): Add new
988 argument(s).
989 * expr.c (mark_rvalue_use): Use new argument.
990 * call.c (build_addr_func): Call decay_conversion with new
991 argument.
992 * pt.c (convert_template_argument): Call reject_gcc_builtin.
993 * typeck.c (decay_conversion): Use new argument.
994 (c_decl_implicit): Define.
995
996 2015-09-02 Balaji V. Iyer <balaji.v.iyer@intel.com>
997
998 PR middle-end/60586
999 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): New
1000 function.
1001 (cp_gimplify_expr): Added a call to the function
1002 cilk_cp_gimplify_call_params_in_spawned_fn.
1003
1004 2015-09-01 Paolo Carlini <paolo.carlini@oracle.com>
1005
1006 PR c++/61753
1007 * decl.c (smallest_type_quals_location): New.
1008 (check_special_function_return_type): Use the latter; add int and
1009 const location_t* parameters.
1010 (grokdeclarator): Adjust check_special_function_return_type call.
1011
1012 2015-08-29 Markus Trippelsdorf <markus@trippelsdorf.de>
1013
1014 PR c++/67371
1015 * constexpr.c (potential_constant_expression_1): Remove IF_STMT
1016 case. Move label to COND_EXPR case. Remove checking of
1017 SWITCH_STMT_BODY.
1018
1019 2015-08-22 Paolo Carlini <paolo.carlini@oracle.com>
1020
1021 PR c++/63693
1022 * pt.c (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE_TYPE
1023 only on class types.
1024
1025 2015-08-21 Jason Merrill <jason@redhat.com>
1026
1027 PR c++/67240
1028 * constraint.cc (satisfy_implicit_conversion_constraint): Also
1029 check for NULL_TREE.
1030
1031 2015-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1032
1033 * decl.c (grokvardecl): Simplify the latter.
1034
1035 2015-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1036
1037 * decl.c (grokvardecl): Complete check added for c++/67065.
1038
1039 2015-08-20 Jason Merrill <jason@redhat.com>
1040
1041 * name-lookup.c (hidden_name_p): Handle OVERLOAD.
1042
1043 2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
1044
1045 PR c++/67065
1046 * decl.c (grokvardecl): Reject 'main' as global variable.
1047
1048 2015-08-19 Jason Merrill <jason@redhat.com>
1049
1050 PR c++/66957
1051 * search.c (protected_accessible_p): Remove redundant access_in_type.
1052 Add otype parm instead of walking binfo.
1053 (friend_accessible_p): Check SCOPE itself. Handle class
1054 templates. Pass through otype.
1055 (dfs_accessible_post): Handle all accessibility cases.
1056 (dfs_accessible_pre): New.
1057 (accessible_p): Use it. Don't check protected access here. Pass
1058 decl and otype to dfs_walk.
1059 (member_declared_in_type, dfs_access_in_type_pre): New.
1060 (access_in_type): Use dfs_access_in_type_pre.
1061 * friend.c (add_friend): Fix multiple friends with the same name.
1062
1063 * lambda.c (current_nonlambda_scope): New.
1064
1065 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
1066
1067 * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c,
1068 method.c, name-lookup.h, parser.c, parser.h, rtti.c,
1069 semantics.c, typeck2.c: Remove useless typedefs.
1070
1071 2015-08-18 Jason Merrill <jason@redhat.com>
1072
1073 DR 1155
1074 * pt.c (convert_nontype_argument): Allow internal linkage in C++11
1075 and up.
1076
1077 2015-08-17 Paolo Carlini <paolo.carlini@oracle.com>
1078
1079 PR c++/67216
1080 * call.c (null_ptr_cst_p): In C++11 return 'false' for 'false'.
1081
1082 2015-08-17 Jason Merrill <jason@redhat.com>
1083
1084 PR c++/67244
1085 * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies.
1086
1087 PR c++/67104
1088 * constexpr.c (array_index_cmp, find_array_ctor_elt): New.
1089 (cxx_eval_array_reference, cxx_eval_store_expression): Use them.
1090
1091 * constexpr.c (cxx_eval_store_expression): Don't set
1092 CONSTRUCTOR_NO_IMPLICIT_ZERO if we have an enclosing CONSTRUCTOR
1093 without it.
1094 (cxx_eval_array_reference): Check it.
1095
1096 * except.c (check_noexcept_r): Assert that fn is POINTER_TYPE_P.
1097
1098 2015-08-14 Jason Merrill <jason@redhat.com>
1099
1100 PR c++/65974
1101 * decl2.c (mark_vtable_entries): Suppress -Wdeprecated.
1102
1103 2015-08-12 Jason Merrill <jason@redhat.com>
1104
1105 PR c++/67104
1106 * constexpr.c (cxx_eval_array_reference): Fix typo.
1107
1108 PR c++/67104
1109 * constexpr.c (cxx_eval_array_reference): Handle sparse
1110 CONSTRUCTORs.
1111
1112 PR c++/67108
1113 * decl2.c (c_parse_final_cleanups): Set at_eof to 2 at end.
1114 * error.c (dump_template_bindings): Don't tsubst in that case.
1115
1116 PR c++/67161
1117 * error.c (dump_decl) [TEMPLATE_ID_EXPR]: Pass
1118 TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS.
1119
1120 2015-08-08 Jason Merrill <jason@redhat.com>
1121
1122 PR c++/67152
1123 * pt.c (process_partial_specialization): Call
1124 associate_classtype_constraints.
1125
1126 PR c++/67159
1127 * constraint.cc (finish_template_introduction):
1128 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
1129
1130 PR c++/67142
1131 * pt.c (equal): Make sure tmpl is actually a template.
1132
1133 PR c++/67144
1134 * call.c (joust): Only call more_constrained on decls.
1135
1136 2015-08-06 Andrew Sutton <andrew.n.sutton@gmail.com>
1137 Braden Obrzut <admin@maniacsvault.net>
1138 Jason Merrill <jason@redhat.com>
1139 Ville Voutilainen <ville.voutilainen@gmail.com>
1140
1141 Add C++ Concepts TS support.
1142 * constraint.cc, logic.cc: New files.
1143 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add constraint.o and logic.o.
1144 (c++.tags): Also process .cc files.
1145 * call.c (enum rejection_reason_code): Add rr_constraint_failure.
1146 (print_z_candidate): Handle it.
1147 (constraint_failure): New.
1148 (add_function_candidate): Check constraints.
1149 (build_new_function_call): Handle evaluating concepts.
1150 (joust): Check more_constrained.
1151 * class.c (add_method): Check equivalently_constrained.
1152 (build_clone): Copy constraints.
1153 (currently_open_class): Return tree.
1154 (resolve_address_of_overloaded_function): Check constraints.
1155 * constexpr.c (cxx_eval_constant_expression): Handle REQUIRES_EXPR.
1156 (potential_constant_expression_1): Likewise.
1157 * cp-objcp-common.c (cp_tree_size): Handle CONSTRAINT_INFO.
1158 (cp_common_init_ts): Handle WILDCARD_DECL and REQUIRES_EXPR.
1159 * cp-tree.def: Add CONSTRAINT_INFO, WILDCARD_DECL, REQUIRES_EXPR,
1160 SIMPLE_REQ, TYPE_REQ, COMPOUND_REQ, NESTED_REQ, PRED_CONSTR,
1161 EXPR_CONSTR, TYPE_CONSTR, ICONV_CONSTR, DEDUCT_CONSTR,
1162 EXCEPT_CONSTR, PARM_CONSTR, CONJ_CONSTR, DISJ_CONSTR.
1163 * cp-tree.h (struct tree_constraint_info, check_nonnull)
1164 (check_constraint_info, CI_TEMPLATE_REQS, CI_DECLARATOR_REQS)
1165 (CI_ASSOCIATED_CONSTRAINTS, CI_NORMALIZED_CONSTRAINTS)
1166 (CI_ASSUMPTIONS, TEMPLATE_PARMS_CONSTRAINTS)
1167 (TEMPLATE_PARM_CONSTRAINTS, COMPOUND_REQ_NOEXCEPT_P)
1168 (PLACEHOLDER_TYPE_CONSTRAINTS, PRED_CONSTR_EXPR, EXPR_CONSTR_EXPR)
1169 (TYPE_CONSTR_TYPE, ICONV_CONSTR_EXPR, ICONV_CONSTR_TYPE)
1170 (DEDUCT_CONSTR_EXPR, DEDUCT_CONSTR_PATTERN)
1171 (DEDUCT_CONSTR_PLACEHOLDER, EXCEPT_CONSTR_EXPR, PARM_CONSTR_PARMS)
1172 (PARM_CONSTR_OPERAND, CONSTRAINT_VAR_P, CONSTRAINED_PARM_CONCEPT)
1173 (CONSTRAINED_PARM_EXTRA_ARGS, CONSTRAINED_PARM_PROTOTYPE)
1174 (DECL_DECLARED_CONCEPT_P, WILDCARD_PACK_P, struct cp_unevaluated)
1175 (struct local_specialization_stack, enum auto_deduction_context)
1176 (variable_concept_p, concept_template_p)
1177 (struct deferring_access_check_sentinel): New.
1178 (enum cp_tree_node_structure_enum): Add TS_CP_CONSTRAINT_INFO.
1179 (union lang_tree_node): Add constraint_info field.
1180 (struct lang_decl_base): Add concept_p flag.
1181 (enum cp_decl_spec): Add ds_concept.
1182 (struct cp_declarator): Add requires_clause.
1183 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
1184 (cxx_pretty_printer::expression): Handle REQUIRES_EXPR,
1185 TRAIT_EXPR, *_CONSTR.
1186 (pp_cxx_parameter_declaration_clause): Accept a chain of
1187 PARM_DECLs.
1188 (cxx_pretty_printer::declarator): Print requires-clause.
1189 (pp_cxx_template_declaration): Likewise.
1190 (pp_cxx_trait_expression): Handle CPTK_IS_SAME_AS.
1191 (pp_cxx_requires_clause, pp_cxx_requirement)
1192 (pp_cxx_requirement_list, pp_cxx_requirement_body)
1193 (pp_cxx_requires_expr, pp_cxx_simple_requirement)
1194 (pp_cxx_type_requirement, pp_cxx_compound_requirement)
1195 (pp_cxx_nested_requirement, pp_cxx_predicate_constraint)
1196 (pp_cxx_expression_constraint, pp_cxx_type_constraint)
1197 (pp_cxx_implicit_conversion_constraint)
1198 (pp_cxx_argument_deduction_constraint)
1199 (pp_cxx_exception_constraint, pp_cxx_parameterized_constraint)
1200 (pp_cxx_conjunction, pp_cxx_disjunction, pp_cxx_constraint): New.
1201 * cxx-pretty-print.h: Declare them.
1202 * decl.c (decls_match): Compare constraints.
1203 (duplicate_decls): Likewise. Remove constraints before freeing.
1204 (cxx_init_decl_processing): Call init_constraint_processing.
1205 (cp_finish_decl): Diagnose concept without initializer.
1206 (grokfndecl, grokvardecl): Handle concepts and constraints.
1207 (grokdeclarator): Handle concept, requires-clause.
1208 (grokparms): No longer static.
1209 (xref_tag_1): Check constraints.
1210 (finish_function): Call check_function_concept.
1211 (cp_tree_node_structure): Handle CONSTRAINT_INFO.
1212 (check_concept_refinement, is_concept_var, check_concept_fn): New.
1213 * decl2.c (check_classfn): Compare constraints.
1214 (mark_used): Don't instantiate concepts.
1215 * error.c (dump_template_decl): Print constraints.
1216 (dump_function_decl): Likewise.
1217 (dump_expr): Handle REQUIRES_EXPR, *_REQ, *_CONSTR.
1218 * lex.c (init_reswords): Set D_CXX_CONCEPTS.
1219 * method.c (implicitly_declare_fn): Copy constraints from
1220 inherited ctor.
1221 * parser.h (struct cp_parser): Add in_result_type_constraint_p and
1222 prevent_constrained_type_specifiers fields.
1223 * parser.c (make_call_declarator): Add requires_clause parm.
1224 (cp_parser_new): Clear prevent_constrained_type_specifiers.
1225 (cp_parser_primary_expression): Handle RID_IS_SAME_AS, RID_REQUIRES.
1226 (cp_parser_postfix_expression): Set prevent_constrained_type_specifiers.
1227 (cp_parser_trait_expr): Handle RID_IS_SAME_AS.
1228 (cp_parser_declaration): Handle concept introduction.
1229 (cp_parser_member_declaration): Likewise.
1230 (cp_parser_template_parameter): Handle constrained parameter.
1231 (cp_parser_type_parameter): Handle constraints.
1232 (cp_parser_decl_specifier_seq): Handle RID_CONCEPT.
1233 (cp_parser_template_id): Handle partial concept id.
1234 (cp_parser_type_name): Add overload that takes typename_keyword_p.
1235 Handle constrained parameter.
1236 (cp_parser_nonclass_name): Handle concept names.
1237 (cp_parser_alias_declaration): Handle constraints.
1238 (cp_parser_late_return_type_opt): Also handle requires-clause.
1239 (cp_parser_type_id_1): Handle deduction constraint.
1240 (cp_parser_parameter_declaration): Handle constrained parameters.
1241 (cp_parser_class_specifier_1): Handle constraints.
1242 (cp_parser_template_declaration_after_parameters): Split out from
1243 cp_parser_template_declaration_after_export.
1244 (cp_parser_single_declaration): Handle constraints.
1245 (synthesize_implicit_template_parm): Handle constraints.
1246 (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id)
1247 (cp_parser_introduction_list, get_id_declarator)
1248 (get_unqualified_id, is_constrained_parameter)
1249 (cp_parser_check_constrained_type_parm)
1250 (cp_parser_constrained_type_template_parm)
1251 (cp_parser_constrained_template_template_parm)
1252 (constrained_non_type_template_parm, finish_constrained_parameter)
1253 (declares_constrained_type_template_parameter)
1254 (declares_constrained_template_template_parameter)
1255 (check_type_concept, cp_parser_maybe_constrained_type_specifier)
1256 (cp_parser_maybe_concept_name, cp_parser_maybe_partial_concept_id)
1257 (cp_parser_requires_clause, cp_parser_requires_clause_opt)
1258 (cp_parser_requires_expression)
1259 (cp_parser_requirement_parameter_list, cp_parser_requirement_body)
1260 (cp_parser_requirement_list, cp_parser_requirement)
1261 (cp_parser_simple_requirement, cp_parser_type_requirement)
1262 (cp_parser_compound_requirement, cp_parser_nested_requirement)
1263 (cp_parser_template_introduction)
1264 (cp_parser_explicit_template_declaration)
1265 (get_concept_from_constraint): New.
1266 * pt.c (local_specialization_stack): Implement.
1267 (maybe_new_partial_specialization): New.
1268 (maybe_process_partial_specialization): Use it.
1269 (retrieve_local_specialization, register_local_specialization)
1270 (template_parm_to_arg, build_template_decl, extract_fnparm_pack)
1271 (tsubst_expr): No longer static.
1272 (spec_hasher::equal): Compare constraints.
1273 (determine_specialization): Handle constraints.
1274 (check_explicit_specialization): Handle concepts.
1275 (process_template_parm): Handle constraints.
1276 (end_template_parm_list): Add overload taking no arguments.
1277 (process_partial_specialization): Handle concepts and constraints.
1278 Register partial specializations of variable templates.
1279 (redeclare_class_template): Handle constraints.
1280 (convert_template_argument): Handle WILDCARD_DECL. Check
1281 is_compatible_template_arg.
1282 (coerce_template_parameter_pack): Handle wildcard packs.
1283 (coerce_template_parms): DR 1430 also applies to concepts. Add
1284 overloads taking fewer parameters.
1285 (lookup_template_class_1): Handle constraints.
1286 (lookup_template_variable): Concepts are always bool.
1287 (finish_template_variable): Handle concepts and constraints.
1288 (tsubst_friend_class): Handle constraints.
1289 (gen_elem_of_pack_expansion_instantiation): Handle constraints.
1290 (tsubst_pack_expansion): Handle local parameters.
1291 (tsubst_decl) [FUNCTION_DECL]: Handle constraints.
1292 (tsubst) [TEMPLATE_TYPE_PARM]: Handle deduction constraints.
1293 (tsubst_copy_and_build): Handle REQUIRES_EXPR.
1294 (more_specialized_fn, more_specialized_partial_spec): Check constraints.
1295 (more_specialized_inst): Split out from most_specialized_instantiation.
1296 (most_specialized_partial_spec): Check constraints.
1297 (instantiate_decl): Never instantiate a concept.
1298 (value_dependent_expression_p): Handle REQUIRES_EXPR, TYPE_REQ,
1299 variable concepts.
1300 (type_dependent_expression_p): Handle WILDCARD_DECL, REQUIRES_EXPR.
1301 (instantiation_dependent_r): Handle REQUIRES_EXPR and concepts.
1302 (do_auto_deduction): Add overload taking tsubst flags and context enum.
1303 Handle constraints.
1304 (get_template_for_ordering, most_constrained_function)
1305 (is_compatible_template_arg, convert_wildcard_argument)
1306 (struct constr_entry, struct constr_hasher, decl_constraints)
1307 (valid_constraints_p, get_constraints, set_constraints)
1308 (remove_constraints, init_constraint_processing): New.
1309 * ptree.c (cxx_print_xnode): Handle CONSTRAINT_INFO.
1310 * search.c (lookup_member): Do lookup in the open partial
1311 instantiation.
1312 * semantics.c (finish_template_template_parm): Handle constraints.
1313 (fixup_template_type): New.
1314 (finish_template_type): Call it.
1315 (trait_expr_value, finish_trait_expr): Handle CPTK_IS_SAME_AS.
1316 * tree.c (cp_tree_equal): Handle local parameters, CONSTRAINT_INFO.
1317 (cp_walk_subtrees): Handle REQUIRES_EXPR.
1318 * typeck.c (cp_build_function_call_vec): Check constraints.
1319
1320 2015-08-06 Jason Merrill <jason@redhat.com>
1321
1322 PR c++/66533
1323 * parser.c (cp_parser_primary_expression): Don't skip to the end
1324 of the statement if we're parsing tentatively.
1325
1326 PR c++/67130
1327 PR c++/67131
1328 PR c++/66260
1329 * mangle.c (write_expression) [TEMPLATE_ID_EXPR]: Handle variable
1330 templates.
1331 * pt.c (tsubst_copy_and_build): Check for argument substitution
1332 failure.
1333
1334 2015-08-05 Jason Merrill <jason@redhat.com>
1335
1336 * pt.c (determine_specialization): Print candidates after 'no
1337 match' error.
1338
1339 * decl.c (cp_finish_decl): Tidy.
1340 * typeck.c (finish_class_member_access_expr): Use
1341 type_dependent_expression_p.
1342 * semantics.c (finish_id_expression): Use
1343 type_dependent_expression_p. Don't build_qualified_name for a
1344 decl in non-dependent scope.
1345 * pt.c (type_dependent_expression_p): A TEMPLATE_ID_EXPR of an
1346 identifier is dependent. Remove variable_template_p check.
1347
1348 PR c++/66260
1349 PR c++/66596
1350 PR c++/66649
1351 PR c++/66923
1352 * pt.c (lookup_template_variable): Use NULL_TREE for type.
1353 (instantiate_template_1): Also set DECL_TI_ARGS based on
1354 the immediate parent.
1355 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle variable templates.
1356 (finish_template_variable): Add complain parm.
1357 * cp-tree.h: Adjust.
1358
1359 PR c++/65195
1360 PR c++/66619
1361 * semantics.c (finish_id_expression): Call convert_from_reference
1362 for variable template.
1363
1364 2015-08-04 Jason Merrill <jason@redhat.com>
1365
1366 * pt.c (lookup_template_class_1): Clear elt.spec.
1367
1368 * tree.c (build_target_expr): Copy the location from value.
1369
1370 2015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
1371
1372 * parser.c (cp_parser_selection_statement): Move handling of
1373 semicolon body to ...
1374 (cp_parser_implicitly_scoped_statement): .. here. Call
1375 warn_for_misleading_indentation even when the body is a
1376 semicolon. Extract token_indent_infos corresponding to the
1377 guard, body and next tokens. Adjust call to
1378 warn_for_misleading_indentation accordingly. Take
1379 token_indent_info argument.
1380 (cp_parser_already_scoped_statement): Likewise.
1381 (cp_parser_selection_statement, cp_parser_iteration_statement):
1382 Extract a token_indent_info corresponding to the guard token.
1383
1384 2015-08-01 Caroline Tice <cmtice@google.com>
1385
1386 PR 66521
1387 * mangle.c : Add vtable-verify.h to include files.
1388 (get_mangled_vtable_map_var_name): If the DECL_ASSEMBLER_NAME
1389 is "<anon>" get the real mangled name for the class instead, and
1390 also store the real mangled name in a vector for use later.
1391
1392 2015-07-31 Marek Polacek <polacek@redhat.com>
1393
1394 PR sanitizer/66977
1395 * typeck.c (get_member_function_from_ptrfunc): Don't sanitize
1396 RSHIFT_EXPR.
1397
1398 2015-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1399
1400 * class.c (check_for_override): Use DECL_SOURCE_LOCATION and "%qD"
1401 in warning_at instead of "%q+D" in warning.
1402 (warn_hidden): Likewise but use location_of.
1403 (finish_struct_anon_r): Likewise use DECL_SOURCE_LOCATION in permerror.
1404 (check_bitfield_decl, check_field_decls): Likewise in warning_at.
1405 (check_field_decls): Likewise for permerror.
1406 (explain_non_literal_class): Likewise for inform.
1407 (check_bases_and_members, layout_class_type): Likewise for warning_at.
1408 (note_name_declared_in_class): Use location_of in permerror.
1409 * name-lookup.c (diagnose_name_conflict): Use location_of in inform.
1410 (pushdecl_maybe_friend_1): Use DECL_SOURCE_LOCATION in pedwarn,
1411 inform, and warning_at.
1412 (check_for_out_of_scope_variable): Likewise for warning_at and
1413 permerror.
1414
1415 2015-07-30 Jason Merrill <jason@redhat.com>
1416
1417 DR 1558
1418 PR c++/67021
1419 * pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.
1420
1421 2015-07-28 Paolo Carlini <paolo.carlini@oracle.com>
1422
1423 * call.c (build_op_delete_call, convert_like_real, build_over_call):
1424 Use Use DECL_SOURCE_LOCATION and "%qD" in inform and pedwarn instead
1425 of "%q+D".
1426 * constexpr.c (explain_invalid_constexpr_fn): Likewise.
1427 * decl.c (duplicate_decls): Likewise for warning/warning_at.
1428 * except.c (maybe_noexcept_warning): Likewise.
1429 * friend.c (make_friend_class): Likewise for inform.
1430 * mangle.c (mangle_decl): Likewise for warning/warning_at.
1431 * method.c (process_subob_fn, walk_field_subobs,
1432 maybe_explain_implicit_delete): Likewise for inform.
1433 * parser.c (cp_parser_lambda_introducer): Likewise.
1434 * pt.c (check_specialization_namespace,
1435 maybe_process_partial_specialization): Likewise for permerror.
1436 (redeclare_class_template): Likewise for inform_n.
1437 (coerce_template_parms, tsubst_copy_and_build): Likewise for inform.
1438 * search.c (check_final_overrider): Likewise.
1439 * semantics.c (process_outer_var_ref): Likewise.
1440
1441 2015-07-27 Jason Merrill <jason@redhat.com>
1442
1443 * constexpr.c (cxx_eval_call_expression): Don't add this call to
1444 the hash table if !depth_ok.
1445
1446 2015-07-27 Marek Polacek <polacek@redhat.com>
1447
1448 PR c++/66555
1449 PR c/54979
1450 * call.c (build_new_op_1): Call warn_tautological_cmp.
1451 * pt.c (tsubst_copy_and_build): Use sentinel to suppress tautological
1452 compare warnings.
1453
1454 2015-07-26 Patrick Palka <ppalka@gcc.gnu.org>
1455
1456 PR c++/18969
1457 * typeck.c (check_return_expr): Also do the basic return-value
1458 validity checking if processing_template_decl and yet types are
1459 not dependent. Remove obsolete code.
1460
1461 2015-07-26 Paolo Carlini <paolo.carlini@oracle.com>
1462
1463 * decl.c (poplevel): Use Use DECL_SOURCE_LOCATION and "%qD"
1464 in warning_at instead of "%q+D" in warning.
1465 (warn_extern_redeclared_static): Likewise for inform.
1466 (check_redeclaration_no_default_args): Likewise for permerror.
1467 (duplicate_decls): Likewise.
1468 (check_previous_goto_1): Likewise for inform.
1469 (check_goto, start_decl, check_for_uninitialized_const_var,
1470 start_preparsed_function, finish_function§): Likewise.
1471 * decl2.c (build_anon_union_vars, c_parse_final_cleanups): Likewise.
1472 * init.c (sort_mem_initializers): Likewise.
1473 * typeck.c (convert_for_initialization): Likewise for inform.
1474 (maybe_warn_about_returning_address_of_local): Likewise.
1475 * typeck2.c (abstract_virtuals_error_sfinae): Likewise for inform.
1476 (cxx_incomplete_type_diagnostic): Likewise for emit_diagnostic.
1477
1478 2015-07-25 Patrick Palka <ppalka@gcc.gnu.org>
1479
1480 PR c++/66857
1481 * cvt.c (ocp_convert): Don't call scalar_constant_value when
1482 converting to a class type.
1483
1484 2015-07-24 Jason Merrill <jason@redhat.com>
1485
1486 PR c++/64969
1487 * pt.c (splice_late_return_type): Correct deduced return type for
1488 abbreviated function template.
1489
1490 2015-07-24 Richard Biener <rguenther@suse.de>
1491
1492 * init.c (build_vec_init): Build iterator bound in the same
1493 type as the iterator.
1494
1495 2015-07-23 Marek Polacek <polacek@redhat.com>
1496
1497 PR c++/66572
1498 * pt.c (tsubst_copy_and_build): Add warn_logical_op sentinel.
1499
1500 2015-07-23 Paolo Carlini <paolo.carlini@oracle.com>
1501
1502 PR c++/52987
1503 * parser.c (cp_parser_simple_declaration): Robustify check avoiding
1504 redundant error messages.
1505
1506 2015-07-21 Paolo Carlini <paolo.carlini@oracle.com>
1507
1508 * decl.c (grokdeclarator): For an erroneous template parameter
1509 propagate error_mark_node as type.
1510
1511 2015-07-20 Marek Polacek <polacek@redhat.com>
1512
1513 PR c++/55095
1514 * typeck.c (cp_build_binary_op): Warn about left shift overflows.
1515
1516 2015-07-15 Jason Merrill <jason@redhat.com>
1517
1518 PR c++/65091
1519 * parser.c (cp_parser_unqualified_id): Don't accept ~x in a
1520 template if there is no type x in scope.
1521
1522 2015-07-14 Patrick Palka <ppalka@gcc.gnu.org>
1523
1524 PR c++/66850
1525 * pt.c (redeclare_class_template): Set the DECL_CONTEXTs of each
1526 template template parm in the redeclaration.
1527 (lookup_template_class_1): Peel off irrelevant template levels
1528 from current_template_parms before augmenting the argument
1529 list.
1530
1531 2015-07-14 Andrea Azzarone <azzaronea@gmail.com>
1532
1533 PR c++/65071
1534 * parser.c (cp_parser_sizeof_pack): Also consider template template
1535 parameters.
1536
1537 2015-07-14 Jason Merrill <jason@redhat.com>
1538
1539 * call.c (build_new_method_call_1): Call reshape_init.
1540
1541 2015-07-14 Paolo Carlini <paolo.carlini@oracle.com>
1542
1543 * pt.c (check_template_shadow): Emit error + inform instead of
1544 two errors.
1545
1546 2015-07-13 Patrick Palka <ppalka@gcc.gnu.org>
1547
1548 PR c++/65186
1549 * pt.c (invalid_nontype_parm_type_p): Accept a bound template
1550 template parm type under C++11 and later.
1551
1552 2015-07-12 Aldy Hernandez <aldyh@redhat.com>
1553
1554 * call.c: Fix double word typos.
1555 * cp-array-notation.c: Same.
1556 * cp-tree.h: Same.
1557 * init.c: Same.
1558 * name-lookup.c: Same.
1559 * parser.c: Same.
1560
1561 2015-07-10 Patrick Palka <ppalka@gcc.gnu.org>
1562
1563 PR c++/30044
1564 * pt.c (begin_template_parm_list): Add a dummy parameter level
1565 to current_template_parms.
1566 (end_template_parm_list): Remove the dummy parameter level
1567 before adding the real one.
1568 (tsubst): Don't attempt to substitute for template parameters
1569 corresponding to a dummy argument level.
1570 (template_parms_to_args): Remove obsolete hack for
1571 giving template template arguments the proper level.
1572 (splite_late_return_type): Remove obsolete hack for giving
1573 template template arguments the proper level.
1574 * error.c (dump_template_decl): Don't print dummy template
1575 levels.
1576
1577 2015-07-10 Paolo Carlini <paolo.carlini@oracle.com>
1578
1579 PR c++/54521
1580 * call.c (convert_like_real): Do not set LOOKUP_ONLYCONVERTING for
1581 the second step of copy-initialization.
1582
1583 2015-07-10 Jason Merrill <jason@redhat.com>
1584
1585 * pt.c (find_parameter_packs_r): Handle variable templates.
1586 (variable_template_specialization_p): New.
1587 * cp-tree.h: Declare it.
1588
1589 * parser.c (cp_parser_template_id): SET_EXPR_LOCATION.
1590
1591 2015-07-10 Eric Botcazou <ebotcazou@adacore.com>
1592
1593 * decl2.c (cpp_check): Revert latest change.
1594
1595 2015-07-09 Jason Merrill <jason@redhat.com>
1596
1597 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Call
1598 value_dependent_expression_p.
1599
1600 * cp-tree.h (struct cp_parameter_declarator): Rename ellipsis_p to
1601 template_parameter_pack_p.
1602 * parser.c (declarator_can_be_parameter_pack): False if
1603 parameter_pack_p is set.
1604 (make_parameter_declarator): Add template_parameter_pack_p parm.
1605 (cp_parser_template_parameter): Remove parameter pack parsing.
1606 (cp_parser_parameter_declaration): Handle all parameter packs.
1607 Tweak default argument permerror.
1608
1609 2015-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
1610
1611 * parser.c (cp_parser_default_type_template_argument)
1612 (cp_parser_default_template_template_argument): Factor out from
1613 cp_parser_type_parameter.
1614
1615 2015-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1616
1617 * typeck.c (warn_args_num): Rename to error_args_num.
1618 (convert_arguments): Adjust calls.
1619
1620 2015-07-09 Andrew MacLeod <amacleod@redhat.com>
1621
1622 * cp-ubsan.c: Don't include alloc-pool.h or lto-streamer.h.
1623
1624 2015-07-08 Eric Botcazou <ebotcazou@adacore.com>
1625
1626 * decl2.c (cpp_check): Deal with IS_CONSTEXPR.
1627
1628 2015-07-08 Jakub Jelinek <jakub@redhat.com>
1629
1630 * decl.c (grokfndecl): Handle flag_openmp_simd like flag_openmp.
1631 * pt.c (apply_late_template_attributes): Likewise.
1632
1633 2015-07-08 Marek Polacek <polacek@redhat.com>
1634
1635 PR c++/66748
1636 * tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before
1637 accessing TYPE_LANG_SPECIFIC node.
1638
1639 2015-07-07 Andrew MacLeod <amacleod@redhat.com>
1640
1641 * call.c: Adjust includes.
1642 * class.c: Likewise.
1643 * constexpr.c: Likewise.
1644 * cp-array-notation.c: Likewise.
1645 * cp-gimplify.c: Likewise.
1646 * cp-lang.c: Likewise.
1647 * cp-objcp-common.c: Likewise.
1648 * cp-ubsan.c: Likewise.
1649 * cvt.c: Likewise.
1650 * decl.c: Likewise.
1651 * decl2.c: Likewise.
1652 * dump.c: Likewise.
1653 * error.c: Likewise.
1654 * except.c: Likewise.
1655 * expr.c: Likewise.
1656 * friend.c: Likewise.
1657 * init.c: Likewise.
1658 * lambda.c: Likewise.
1659 * lex.c: Likewise.
1660 * mangle.c: Likewise.
1661 * method.c: Likewise.
1662 * name-lookup.c: Likewise.
1663 * optimize.c: Likewise.
1664 * parser.c: Likewise.
1665 * pt.c: Likewise.
1666 * ptree.c: Likewise.
1667 * repo.c: Likewise.
1668 * rtti.c: Likewise.
1669 * search.c: Likewise.
1670 * semantics.c: Likewise.
1671 * tree.c: Likewise.
1672 * typeck.c: Likewise.
1673 * typeck2.c: Likewise.
1674
1675 2015-07-07 Eric Botcazou <ebotcazou@adacore.com>
1676
1677 * decl2.c (cpp_check): Deal with IS_MOVE_CONSTRUCTOR.
1678
1679 2015-07-06 Jason Merrill <jason@redhat.com>
1680
1681 * pt.c (reduce_template_parm_level): Also build the TYPE_DECL
1682 for a template template parameter.
1683 (tsubst_decl) [TEMPLATE_DECL]: Use the TEMPLATE_DECL built
1684 by reduce_template_parm_level.
1685
1686 * pt.c (argument_pack_element_is_expansion_p): A decl pack is an
1687 expansion.
1688
1689 2015-07-02 Jason Merrill <jason@redhat.com>
1690
1691 PR c++/66743
1692 * pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
1693 TYPE_VALUES_RAW rather than TYPE_FIELDS.
1694
1695 2015-07-02 Andrew Sutton <andrew.n.sutton@gmail.com>
1696
1697 * pt.c (type_dependent_expression_p): Handle expressions
1698 that refer to variable templates.
1699
1700 2015-07-01 Jason Merrill <jason@redhat.com>
1701
1702 * lex.c (init_reswords): s/CXX0X/CXX11/.
1703 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1704
1705 * mangle.c (write_CV_qualifiers_for_type, write_nested_name):
1706 Attribute mangling is now -fabi-version=10.
1707
1708 PR c++/65945
1709 * decl.c (cxx_init_decl_processing): Set TYPE_ALIGN of nullptr_t.
1710 * class.c (layout_nonempty_base_or_field): Warn if that affects
1711 the offset of a field.
1712
1713 2015-07-01 Paolo Carlini <paolo.carlini@oracle.com>
1714
1715 PR c++/60365
1716 * parser.c (cp_parser_check_std_attribute): New.
1717 (cp_parser_std_attribute_list): Call it.
1718
1719 2015-07-01 Patrick Palka <ppalka@gcc.gnu.org>
1720
1721 PR c++/66686
1722 * pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
1723 return 0 if tsubst returns a dependent type.
1724
1725 2015-06-30 Jason Merrill <jason@redhat.com>
1726
1727 PR debug/66653
1728 * decl2.c (is_late_template_attribute): True for tls_model.
1729
1730 PR debug/66653
1731 * cp-tree.h (CP_DECL_THREAD_LOCAL_P): New.
1732 (DECL_GNU_TLS_P): Use DECL_LANG_SPECIFIC field.
1733 (SET_DECL_GNU_TLS_P): New.
1734 * call.c (make_temporary_var_for_ref_to_temp): Use
1735 CP_DECL_THREAD_LOCAL_P.
1736 (set_up_extended_ref_temp): Likewise.
1737 * decl.c (duplicate_decls, expand_static_init): Likewise.
1738 (redeclaration_error_message, grokvardecl): Likewise.
1739 (start_decl, register_dtor_fn, grokdeclarator): Likewise.
1740 * decl2.c (get_guard, var_needs_tls_wrapper): Likewise.
1741 (handle_tls_init): Likewise.
1742 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
1743 * semantics.c (finish_id_expression): Likewise.
1744 (handle_omp_array_sections_1, finish_omp_clauses): Likewise.
1745 (finish_omp_threadprivate): Likewise.
1746 * tree.c (decl_storage_duration): Likewise.
1747 * cp-gimplify.c (omp_var_to_track): Likewise.
1748 (cp_genericize_r): Check that it matches DECL_THREAD_LOCAL_P.
1749 * lex.c (retrofit_lang_decl): Return if DECL_LANG_SPECIFIC is
1750 already set.
1751
1752 2015-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
1753
1754 Implement N4197 - Adding u8 character literals
1755 * parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
1756 and CPP_UTF8CHAR_USERDEF tokens;
1757 (cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.
1758
1759 2015-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1760
1761 PR c++/65977
1762 * decl.c (grokfndecl): Allow constexpr declarations of friend
1763 template specializations.
1764
1765 2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1766
1767 PR fortran/66605
1768 * decl.c (finish_function): Call do_warn_unused_parameter.
1769
1770 2015-06-29 Marek Polacek <polacek@redhat.com>
1771
1772 PR c/66322
1773 * decl.c (struct cp_switch): Add OUTSIDE_RANGE_P.
1774 (push_switch): Set OUTSIDE_RANGE_P.
1775 (pop_switch): Update c_do_switch_warnings call.
1776 (finish_case_label): Update c_add_case_label call.
1777 * semantics.c (finish_switch_cond): Don't warn about -Wswitch-bool
1778 here.
1779
1780 2015-06-27 Marek Polacek <polacek@redhat.com>
1781
1782 * call.c: Use VECTOR_TYPE_P.
1783 * constexpr.c: Likewise.
1784 * cvt.c: Likewise.
1785 * decl.c: Likewise.
1786 * decl2.c: Likewise.
1787 * init.c: Likewise.
1788 * semantics.c: Likewise.
1789 * tree.c: Likewise.
1790 * typeck.c: Likewise.
1791 * typeck2.c: Likewise.
1792
1793 2015-06-27 Marek Polacek <polacek@redhat.com>
1794
1795 * call.c (set_up_extended_ref_temp): Use VAR_P.
1796 * class.c: Use VAR_P throughout.
1797 * constexpr.c (cxx_eval_constant_expression): Use VAR_P.
1798 * cp-array-notation.c (make_triplet_val_inv): Likewise.
1799 * decl.c: Use VAR_OR_FUNCTION_DECL_P or VAR_P
1800 throughout.
1801 * decl2.c: Likewise.
1802 * error.c (dump_decl): Use VAR_P.
1803 * mangle.c (decl_implicit_alias_p): Likewise.
1804 * parser.c: Use VAR_P throughout.
1805 * pt.c: Likewise.
1806 * semantics.c: Likewise.
1807 * vtable-class-hierarchy.c: Likewise.
1808 * tree.c (handle_abi_tag_attribute): Use VAR_OR_FUNCTION_DECL_P.
1809
1810 2015-06-27 Andreas Schwab <schwab@linux-m68k.org>
1811
1812 * pt.c (check_unstripped_args): Mark parameter as unused.
1813
1814 2015-06-26 Jason Merrill <jason@redhat.com>
1815
1816 PR c++/66216
1817 * class.c (finish_struct): Call fixup_attribute_variants.
1818
1819 PR c++/66684
1820 * typeck2.c (merge_exception_specifiers): Allow different
1821 noexcept-specifiers if we've had errors.
1822
1823 PR c++/66255
1824 * pt.c (check_unstripped_args): Split out from...
1825 (retrieve_specialization): ...here. Allow typedefs in the type of
1826 a non-type argument.
1827
1828 PR c++/66067
1829 * mangle.c (write_nested_name): Limit TYPENAME_TYPE handling to
1830 TYPE_DECLs.
1831 * mangle.c (write_template_args): Handle 0 length TREE_VEC.
1832
1833 PR c++/66654
1834 * typeck2.c (digest_init_r): Only expect reshaping if the class is
1835 aggregate.
1836
1837 2015-06-26 Marek Polacek <polacek@redhat.com>
1838
1839 * cp-array-notation.c (expand_sec_reduce_builtin): Use INDIRECT_REF_P.
1840 * cp-ubsan.c (cp_ubsan_check_member_access_r): Likewise.
1841
1842 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
1843
1844 * call.c: Remove ipa-ref.h and plugin-api.h from include list.
1845 * class.c: Likewise.
1846 * cp-ubsan.c: Likewise.
1847 * decl.c: Likewise.
1848 * decl2.c: Likewise.
1849 * lambda.c: Likewise.
1850 * mangle.c: Likewise.
1851 * method.c: Likewise.
1852 * optimize.c: Likewise.
1853 * parser.c: Likewise.
1854 * semantics.c: Likewise.
1855 * tree.c: Likewise.
1856 * vtable-class-hierarchy.c: Likewise.
1857
1858 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
1859
1860 * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash
1861 rather than ggc_hasher.
1862 (constexpr_call_hasher): Likewise.
1863 * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise.
1864 * decl.c (typename_hasher): Likewise.
1865 * mangle.c (conv_type_hasher): Likewise.
1866 * pt.c (spec_hasher): Likewise.
1867 * tree.c (cplus_array_hasher, list_hasher): Likewise.
1868 * typeck2.c (abstract_type_hasher): Likewise.
1869
1870 2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
1871
1872 * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash
1873 rather than pointer_hash.
1874 (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash.
1875 * semantics.c (nrv_data): Likewise.
1876 * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise.
1877
1878 2015-06-24 Jason Merrill <jason@redhat.com>
1879
1880 PR c++/66647
1881 * pt.c (dependent_type_p_r): Check for dependent alias template
1882 specialization sooner.
1883
1884 PR c++/66501
1885 * class.c (type_has_nontrivial_assignment): Remove.
1886 * cp-tree.h: Remove declaration.
1887 * init.c (vec_copy_assign_is_trivial): New.
1888 (build_vec_init): Use it.
1889
1890 2015-06-24 Edward Smith-Rowland <3dw4rd@verizon.net>
1891
1892 Implement N3928 - Extending static_assert
1893 * parser.c (cp_parser_static_assert): Support static_assert with
1894 no message string. Supply an empty string in this case.
1895 * semantics.c (finish_static_assert): Don't try to print a message if
1896 the message strnig is empty.
1897
1898 2015-06-24 Adam Butcher <adam@jessamine.co.uk>
1899
1900 PR c++/65750
1901 * parser.c (cp_parser_simple_type_specifier): Don't synthesize
1902 implicit template parm if 'auto' is a placeholder for trailing
1903 return type.
1904
1905 2015-06-24 Patrick Palka <ppalka@gcc.gnu.org>
1906
1907 Revert:
1908 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
1909
1910 PR c++/30044
1911 * parser.c (cp_parser_template_parameter_list): Update
1912 current_template_parms right after processing a paramater.
1913 * pt.c (template_parms_to_args): Remove obsolete hack for
1914 giving template template arguments the proper level.
1915 (check_default_tmpl_args): Account for tested template
1916 parameter_lists.
1917 (splite_late_return_type): Remove obsolete hack for giving
1918 template template arguments the proper level.
1919
1920 2015-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1921
1922 PR c++/65811
1923 * decl.c (duplicate_decls): Adjust DECL_COMDAT of newdecl.
1924
1925 2015-06-23 Patrick Palka <ppalka@gcc.gnu.org>
1926
1927 PR c++/30044
1928 * parser.c (cp_parser_template_parameter_list): Update
1929 current_template_parms right after processing a paramater.
1930 * pt.c (template_parms_to_args): Remove obsolete hack for
1931 giving template template arguments the proper level.
1932 (check_default_tmpl_args): Account for tested template
1933 parameter_lists.
1934 (splite_late_return_type): Remove obsolete hack for giving
1935 template template arguments the proper level.
1936
1937 2015-06-23 Jason Merrill <jason@redhat.com>
1938
1939 PR c++/65879
1940 * decl.c (grokfndecl): Check the linkage of ctype, not just
1941 TYPE_ANONYMOUS_P.
1942 * tree.c (no_linkage_check): Skip the 'this' pointer.
1943
1944 PR c++/66501
1945 * class.c (type_has_nontrivial_assignment): New.
1946 * init.c (build_vec_init): Use it.
1947 * cp-tree.h: Declare it.
1948 * method.c (trivial_fn_p): Templates aren't trivial.
1949
1950 PR c++/66542
1951 * decl.c (expand_static_init): Make sure the destructor is callable
1952 here even if we have an initializer.
1953
1954 2015-06-04 Pierre-Marie de Rodat <derodat@adacore.com>
1955
1956 * lang-specs.h: Pass "-o %g.s" to cc1plus for headers even if
1957 -fdump-ada-spec is passed.
1958
1959 2015-06-22 Pierre-Marie de Rodat <derodat@adacore.com>
1960
1961 * decl2.c (cpp_check): Deal with HAS_DEPENDENT_TEMPLATE_ARGS.
1962
1963 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
1964
1965 * decl.c (grokdeclarator): Use declspecs->locations[ds_virtual].
1966
1967 2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
1968
1969 * decl.c (grokdeclarator): Remove pointless code.
1970
1971 2015-06-22 Jason Merrill <jason@redhat.com>
1972
1973 PR c++/66515
1974 * call.c (implicit_conversion): Only reshape for classes.
1975
1976 2015-06-22 Mikhail Maltsev <maltsevm@gmail.com>
1977
1978 * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of
1979 manually swapping.
1980 * semantics.c (finish_omp_atomic): Likewise.
1981 * typeck.c (cp_build_array_ref): Likewise.
1982
1983 2015-06-20 Mikhail Maltsev <maltsevm@gmail.com>
1984
1985 PR c++/65882
1986 * call.c (build_new_op_1): Check tf_warning flag in all cases.
1987
1988 2015-06-19 Jason Merrill <jason@redhat.com>
1989
1990 PR c++/66585
1991 * pt.c (instantiate_class_template_1): Clear
1992 cp_unevaluated_operand and c_inhibit_evaluation_warnings.
1993
1994 PR c++/65880
1995 * decl.c (build_ptrmemfunc_type): Check TYPE_GET_PTRMEMFUNC_TYPE after
1996 cv-qualifiers.
1997 * typeck.c (merge_types): build_ptrmemfunc_type before applying
1998 quals and attributes.
1999
2000 PR c++/65973
2001 * constexpr.c (build_constexpr_constructor_member_initializers):
2002 Handle an empty STATEMENT_LIST.
2003
2004 PR c++/65843
2005 * pt.c (tsubst_copy_and_build): Register a capture proxy in
2006 local_specializations.
2007
2008 2015-06-17 Jason Merrill <jason@redhat.com>
2009
2010 PR c++/66001
2011 * constexpr.c (cxx_eval_constant_expression): Handle TRY_BLOCK and
2012 TRY_FINALLY_EXPR.
2013 (potential_constant_expression_1): Likewise.
2014
2015 2015-06-17 Jason Merrill <jason@redhat.com>
2016
2017 PR c++/66515
2018 * call.c (implicit_conversion): Call reshape_init here, early.
2019 (build_aggr_conv): Not here.
2020
2021 2015-06-17 Jakub Jelinek <jakub@redhat.com>
2022
2023 PR c++/66571
2024 * pt.c (tsubst_omp_clause_decl): New function.
2025 (tsubst_omp_clauses): Use it or tsubst_copy instead of
2026 tsubst_expr on OMP_CLAUSE_DECL.
2027
2028 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2029
2030 * cp-lang.c (cxx_dwarf_name): Use anon_aggrname_p.
2031 * cp-tree.h (TYPE_ANONYMOUS_P): Likewise.
2032 * decl.c (grokdeclarator, xref_tag_1): Likewise.
2033 * error.c (dump_aggr_type): likewise.
2034 * pt.c (push_template_decl_real): Likewise.
2035 * name-lookup.c (make_anon_name): Use anon_aggrname_format.
2036
2037 2015-06-17 Andrew MacLeod <amacleod@redhat.com>
2038
2039 * call.c: Do not include input.h, line-map.h or is-a.h.
2040 * class.c: Likewise.
2041 * constexpr.c: Likewise.
2042 * cp-array-notation.c: Likewise.
2043 * cp-gimplify.c: Likewise.
2044 * cp-lang.c: Likewise.
2045 * cp-objcp-common.c: Likewise.
2046 * cp-tree.h: Likewise.
2047 * cp-ubsan.c: Likewise.
2048 * cvt.c: Likewise.
2049 * decl.c: Likewise.
2050 * decl2.c: Likewise.
2051 * dump.c: Likewise.
2052 * error.c: Likewise.
2053 * except.c: Likewise.
2054 * expr.c: Likewise.
2055 * friend.c: Likewise.
2056 * init.c: Likewise.
2057 * lambda.c: Likewise.
2058 * lex.c: Likewise.
2059 * mangle.c: Likewise.
2060 * method.c: Likewise.
2061 * name-lookup.c: Likewise.
2062 * optimize.c: Likewise.
2063 * parser.c: Likewise.
2064 * pt.c: Likewise.
2065 * ptree.c: Likewise.
2066 * repo.c: Likewise.
2067 * rtti.c: Likewise.
2068 * search.c: Likewise.
2069 * semantics.c: Likewise.
2070 * tree.c: Likewise.
2071 * typeck.c: Likewise.
2072 * typeck2.c: Likewise.
2073 * vtable-class-hierarchy.c: Likewise.
2074
2075 2015-06-16 Paolo Carlini <paolo.carlini@oracle.com>
2076
2077 PR c++/59682
2078 * parser.c (cp_parser_new_placement): Reject an empty expression-list.
2079
2080 2015-06-16 Jason Merrill <jason@redhat.com>
2081
2082 PR c++/66536
2083 * tree.c (replace_placeholders_r) [CONSTRUCTOR]: Handle type
2084 mismatch.
2085
2086 PR c++/58063
2087 * tree.c (bot_manip): Remap SAVE_EXPR.
2088
2089 PR c++/66387
2090 * pt.c (tsubst_copy) [VAR_DECL]: Use process_outer_var_ref.
2091
2092 2015-06-15 Nathan Sidwell <nathan@acm.org>
2093
2094 PR c++/58583
2095 * cp-tree.h (DECL_INSTANTIATING_NSDMI_P): New.
2096 * init.c (get_nsdmi): Check for DEFAULT_ARG in template case and
2097 protect it from recursive instantiation.
2098
2099 2015-06-15 Paolo Carlini <paolo.carlini@oracle.com>
2100
2101 PR c++/51048
2102 * decl2.c (no_linkage_error): Do not issue a permerror if the DECL
2103 using a local type is pure virtual.
2104
2105 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
2106
2107 * call.c: Remove comment documenting the long-deleted
2108 function build_method_call.
2109
2110 2015-06-13 Patrick Palka <ppalka@gcc.gnu.org>
2111
2112 PR c++/65168
2113 * typeck.c (cp_build_binary_op): Warn when comparing an address
2114 of a reference against NULL.
2115
2116 2015-06-12 Jason Merrill <jason@redhat.com>
2117
2118 PR c++/65719
2119 * pt.c (tsubst_decl) [VAR_DECL]: Mark namespace-scope
2120 variables as DECL_NOT_REALLY_EXTERN.
2121
2122 2015-06-11 Jason Merrill <jason@redhat.com>
2123
2124 PR c++/66445
2125 * constexpr.c (potential_constant_expression_1): Handle a
2126 DECL_EXPR of TYPE_DECL.
2127
2128 PR c++/66450
2129 * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
2130 ctx->ctor.
2131
2132 2015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
2133
2134 * decl.c (cxx_init_decl_processing): Register the main
2135 translation unit through the new debug hook.
2136
2137 2015-06-10 Jason Merrill <jason@redhat.com>
2138
2139 PR c++/66289
2140 * cp-tree.h (TEMPLATE_DECL_COMPLEX_ALIAS_P): New.
2141 * pt.c (push_template_decl_real): Set it.
2142 (dependent_alias_template_spec_p): Use it.
2143 (dependent_type_p_r): Use dependent_alias_template_spec_p.
2144 (uses_all_template_parms_data, uses_all_template_parms_r)
2145 (complex_alias_template_p): New.
2146 (get_template_parm_index): Handle BOUND_TEMPLATE_TEMPLATE_PARM.
2147
2148 2015-06-09 Jason Merrill <jason@redhat.com>
2149
2150 DR 1467
2151 PR c++/51747
2152 * typeck2.c (digest_init_r): Replace previous change with
2153 gcc_unreachable.
2154
2155 PR c++/66387
2156 * semantics.c (process_outer_var_ref): Make sure the value is
2157 actually constant before returning it.
2158 * typeck.c (cp_build_array_ref): Allow subscripting non-lvalue
2159 array.
2160
2161 2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
2162
2163 PR c++/65815
2164 * typeck2.c (digest_nsdmi_init): On aggregates use reshape_init.
2165 * init.c (expand_default_init): Likewise.
2166
2167 2015-06-09 Jason Merrill <jason@redhat.com>
2168
2169 PR c++/66383
2170 * tree.c (replace_placeholders_r): Handle placeholders for an
2171 outer object.
2172 * typeck2.c (store_init_value): Only replace_placeholders for
2173 objects of class type.
2174
2175 2015-06-08 Andrew MacLeod <amacleod@redhat.com>
2176
2177 * call.c : Adjust include files.
2178 * class.c : Likewise.
2179 * constexpr.c : Likewise.
2180 * cp-array-notation.c : Likewise.
2181 * cp-cilkplus.c : Likewise.
2182 * cp-gimplify.c : Likewise.
2183 * cp-lang.c : Likewise.
2184 * cp-objcp-common.c : Likewise.
2185 * cp-tree.h : Likewise.
2186 * cp-ubsan.c : Likewise.
2187 * cvt.c : Likewise.
2188 * decl.c : Likewise.
2189 * decl2.c : Likewise.
2190 * dump.c : Likewise.
2191 * error.c : Likewise.
2192 * except.c : Likewise.
2193 * expr.c : Likewise.
2194 * friend.c : Likewise.
2195 * init.c : Likewise.
2196 * lambda.c : Likewise.
2197 * lex.c : Likewise.
2198 * mangle.c : Likewise.
2199 * method.c : Likewise.
2200 * name-lookup.c : Likewise.
2201 * optimize.c : Likewise.
2202 * parser.c : Likewise.
2203 * pt.c : Likewise.
2204 * ptree.c : Likewise.
2205 * repo.c : Likewise.
2206 * rtti.c : Likewise.
2207 * search.c : Likewise.
2208 * semantics.c : Likewise.
2209 * tree.c : Likewise.
2210 * typeck.c : Likewise.
2211 * typeck2.c : Likewise.
2212 * vtable-class-hierarchy.c : Likewise.
2213
2214 2015-06-05 Jason Merrill <jason@redhat.com>
2215
2216 PR c++/66405
2217 * pt.c (argument_pack_element_is_expansion_p): Return 2 if
2218 the expansion has extra args.
2219 (use_pack_expansion_extra_args_p): Return true in that case.
2220
2221 PR c++/66405
2222 * pt.c (type_dependent_expression_p): EXPR_PACK_EXPANSION is
2223 dependent even if it has a type.
2224
2225 2015-06-05 Aldy Hernandez <aldyh@redhat.com>
2226
2227 * cp-objcp-common.c: Adjust comment for
2228 cxx_warn_unused_global_decl.
2229 * cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Remove
2230 (LANG_HOOKS_POST_COMPILATION_PARSING_CLEANUPS): New.
2231 * cp-tree.h (note_mangling_alias): Protoize.
2232 (cp_write_global_declarations): Remove.
2233 (cxx_post_compilation_parsing_cleanups): Protoize.
2234 * decl.c (wrapup_globals_for_namespace): Remove use of DATA
2235 argument.
2236 * decl2.c (mangling_aliases): New global.
2237 (build_java_method_aliases): New. Adapted from
2238 collect_candidates_for_java_method_aliases.
2239 (collect_candidates_for_java_method_aliases): Remove.
2240 (build_java_method_aliases): Remove.
2241 (generate_mangling_aliases): New.
2242 (note_mangling_alias): New. Moved from mangle_decl.
2243 (locus_at_end_of_parsing): New global.
2244 (c_parse_final_cleanups): Rename from
2245 cp_write_global_declarations.
2246 Use locus_at_end_of_parsing.
2247 Call generate_mangling_aliases.
2248 Rename call to collect_candidates_for_java_method_aliases into
2249 build_java_method_aliases.
2250 Remove call to finalize_compilation_unit.
2251 Move vtable handling into cxx_post_compilation_parsing_cleanups.
2252 Do not call check_global_declarations or
2253 emit_debug_global_declarations.
2254 (cxx_post_compilation_parsing_cleanups): New.
2255 * mangle.c (mangle_decl): Move code to note_mangling_alias.
2256 * name-lookup.c (do_namespace_alias): Call early_global_decl.
2257
2258 2015-06-05 Nathan Sidwell <nathan@acm.org>
2259
2260 PR c++/52595
2261 * parser.c (cp_parser_cache_defarg): Continue looking for
2262 declarators when scanning a potential template argument list of an
2263 NSDMI.
2264
2265 2015-06-04 Andrew MacLeod <amacleod@redhat.com>
2266
2267 * call.c: Adjust includes for restructured coretypes.h.
2268 * class.c: Likewise.
2269 * constexpr.c: Likewise.
2270 * cp-array-notation.c: Likewise.
2271 * cp-gimplify.c: Likewise.
2272 * cp-lang.c: Likewise.
2273 * cp-objcp-common.c: Likewise.
2274 * cp-tree.h: Likewise.
2275 * cp-ubsan.c: Likewise.
2276 * cvt.c: Likewise.
2277 * decl.c: Likewise.
2278 * decl2.c: Likewise.
2279 * dump.c: Likewise.
2280 * error.c: Likewise.
2281 * except.c: Likewise.
2282 * expr.c: Likewise.
2283 * friend.c: Likewise.
2284 * init.c: Likewise.
2285 * lambda.c: Likewise.
2286 * lex.c: Likewise.
2287 * mangle.c: Likewise.
2288 * method.c: Likewise.
2289 * name-lookup.c: Likewise.
2290 * optimize.c: Likewise.
2291 * parser.c: Likewise.
2292 * pt.c: Likewise.
2293 * ptree.c: Likewise.
2294 * repo.c: Likewise.
2295 * rtti.c: Likewise.
2296 * search.c: Likewise.
2297 * semantics.c: Likewise.
2298 * tree.c: Likewise.
2299 * typeck.c: Likewise.
2300 * typeck2.c: Likewise.
2301 * vtable-class-hierarchy.c: Likewise.
2302
2303 2015-06-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
2304
2305 PR c++/66192
2306 PR target/66200
2307 * cp-tree.h (get_guard_cond): Adjust declaration
2308 * decl.c (expand_static_init): Use atomic load acquire
2309 and adjust call to get_guard_cond.
2310 * decl2.c (build_atomic_load_byte): New function.
2311 (get_guard_cond): Handle thread_safety.
2312 (one_static_initialization_or_destruction): Adjust call to
2313 get_guard_cond.
2314
2315 2015-06-03 Jason Merrill <jason@redhat.com>
2316
2317 PR c++/44282
2318 * mangle.c (mangle_decl): Always SET_IDENTIFIER_GLOBAL_VALUE.
2319 (write_CV_qualifiers_for_type): Set G.need_abi_warning.
2320 (decl_implicit_alias_p): Split out from maybe_remove_implicit_alias.
2321 * cp-tree.h (DECL_REALLY_EXTERN): Handle null DECL_LANG_SPECIFIC.
2322
2323 2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
2324 Paolo Carlini <paolo.carlini@oracle.com>
2325
2326 PR c++/66130
2327 * typeck.c (invalid_nonstatic_memfn_p): Add location_t parameter and
2328 use it in the diagnostic.
2329 (decay_conversion): Adjust call.
2330 * semantics.c (finish_decltype_type): Likewise.
2331 * call.c (resolve_args, build_new_op_1,
2332 perform_implicit_conversion_flags): Adjust calls.
2333 * cvt.c (ocp_convert, convert_to_void): Likewise.
2334 * cp-tree.h (invalid_nonstatic_memfn_p): Update declaration.
2335
2336 2015-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2337
2338 * decl.c (check_tag_decl): Use declspecs->locations as locations in
2339 error_at and warning_at calls.
2340
2341 2015-06-03 Marek Polacek <polacek@redhat.com>
2342
2343 PR sanitizer/66190
2344 * cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
2345 (cp_genericize_r): Don't instrument static initializers.
2346 (cp_genericize_tree): Initialize wtd.no_sanitize_p.
2347
2348 2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
2349
2350 * decl.c (start_function): Call plugin before parsing.
2351 (finish_function): Call plugin after parsing.
2352
2353 2015-06-02 Patrick Palka <patrick@parcs.ath.cx>
2354
2355 * cp-tree.h (init_error): Remove declaration.
2356 * error.c (scratch_pretty_printer): Rename to ...
2357 (actual_pretty_printer): ... this.
2358 (cxx_pp): Constify and update accordingly.
2359 (init_error): Remove definition.
2360 * lex.c (cxx_init): Do not call init_error.
2361
2362 2015-06-02 Paolo Carlini <paolo.carlini@oracle.com>
2363
2364 PR c++/61683
2365 * parser.c (cp_parser_mem_initializer): Allow for decltype-specifier.
2366
2367 2015-06-01 Jason Merrill <jason@redhat.com>
2368
2369 PR c++/65942
2370 * decl2.c (mark_used): Don't always instantiate constexpr fns.
2371 * constexpr.c (cxx_eval_call_expression): Instantiate them here.
2372
2373 PR c++/44282
2374 * mangle.c (attr_strcmp): New.
2375 (write_CV_qualifiers_for_type): Also write out attributes that
2376 affect type identity.
2377 (write_type): Strip all attributes after writing qualifiers.
2378
2379 2015-05-31 Jason Merrill <jason@redhat.com>
2380
2381 * constexpr.c (cxx_eval_indirect_ref): Try folding first.
2382
2383 PR c++/66320
2384 * constexpr.c (cxx_eval_constant_expression): Treat a placeholder
2385 with the wrong type as non-constant.
2386
2387 2015-05-27 Jason Merrill <jason@redhat.com>
2388
2389 * decl.c (check_redeclaration_exception_specification): Depend on
2390 -Wsystem-headers rather than -pedantic.
2391
2392 * decl.c (warn_extern_redeclared_static): Use the location of
2393 newdecl in diagnostics, not input_location.
2394 (validate_constexpr_redeclaration): Likewise.
2395 (check_redeclaration_no_default_args): Likewise.
2396 (duplicate_decls): Likewise.
2397 (check_redeclaration_exception_specification): Likewise.
2398 Change second diagnostic to inform.
2399
2400 2015-05-24 Nathan Sidwell <nathan@acm.org>
2401
2402 PR c++/66243
2403 * decl.c (build_enumerator): Don't silently convert scoped enums.
2404
2405 2015-05-24 Jan Hubicka <hubicka@ucw.cz>
2406
2407 PR lto/66180
2408 * mangle.c (mangle_decl): Mangle anonymous namespace types as
2409 "<anon>".
2410
2411 2015-05-23 Nathan Sidwell <nathan@acm.org>
2412
2413 PR c++/65936
2414 * pt.c (lookup_template_class_1): Copy may_alias attribute too.
2415
2416 2015-05-22 Jim Wilson <jim.wilson@linaro.org>
2417
2418 * Make-lang.in (check_g++_parallelize): Update comment.
2419
2420 2015-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2421
2422 PR c++/65598
2423 * decl.c (grokdeclarator): Use the correct location in error
2424 messages about 'explicit'.
2425
2426 2015-05-22 Marek Polacek <polacek@redhat.com>
2427 Edward Smith-Rowland <3dw4rd@verizon.net>
2428
2429 PR c/47043
2430 * cp-tree.h (build_enumerator): Update declaration.
2431 * decl.c (build_enumerator): Add attributes parameter. Call
2432 cplus_decl_attributes.
2433 * init.c (constant_value_1): Pass tf_none to mark_used.
2434 * parser.c (cp_parser_enumerator_definition): Parse attributes and
2435 pass them down to build_enumerator.
2436 * pt.c (tsubst_enum): Pass decl attributes to build_enumerator.
2437 * semantics.c (finish_id_expression): Don't warn_deprecated_use here.
2438
2439 2015-05-21 Nathan Sidwell <nathan@acm.org>
2440
2441 PR c++/60943
2442 * decl2.c (change_return_type): Propagate FUNCTION_REF_QUALIFIED.
2443
2444 2015-05-21 Marek Polacek <polacek@redhat.com>
2445
2446 * typeck.c (warn_args_num): Don't print "declare here" for builtins.
2447
2448 2015-05-20 Jason Merrill <jason@redhat.com>
2449
2450 * pt.c (tsubst_decl) [VAR_DECL]: SET_DECL_IMPLICIT_INSTANTIATION
2451 before register_specialization.
2452
2453 * decl.c (grok_op_properties): Don't complain about size_t
2454 placement delete here.
2455 * call.c (second_parm_is_size_t): Split out from...
2456 (non_placement_deallocation_fn_p): ...here.
2457 (build_op_delete_call): Warn about size_t placement delete with
2458 -Wc++14-compat.
2459
2460 2015-05-19 Nathan Sidwell <nathan@acm.org>
2461
2462 PR c++/65954
2463 * typeck.c (finish_class_member_access_expr): Diagnose failed
2464 lookup of enum class member.
2465
2466 2015-05-19 Jakub Jelinek <jakub@redhat.com>
2467
2468 PR middle-end/66199
2469 * parser.c (cp_parser_omp_for_loop): Don't add
2470 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
2471 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
2472 (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
2473 constructs.
2474
2475 2015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
2476
2477 * typeck.c (composite_pointer_type): Use std::swap instead of explicit
2478 swaps.
2479
2480 2015-05-18 Jason Merrill <jason@redhat.com>
2481
2482 * pt.c (retrieve_specialization): Make sure our arguments have
2483 gone through strip_typedefs.
2484
2485 * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
2486 (determine_specialization): Call coerce_template_parms.
2487
2488 DR 1391
2489 * pt.c (type_unification_real): Check convertibility here.
2490 (unify_one_argument): Not here.
2491
2492 * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo.
2493 (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype.
2494 [TREE_LIST]: Fix no-change case.
2495
2496 * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.
2497
2498 2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
2499
2500 PR fortran/44054
2501 * error.c (cp_diagnostic_starter): Use diagnostic_location
2502 function.
2503 (cp_print_error_function): Likewise.
2504 (cp_printer): Replace locus pointer with accessor function.
2505
2506 2015-05-12 David Malcolm <dmalcolm@redhat.com>
2507
2508 * parser.c (cp_parser_selection_statement): Add location and
2509 guard_kind arguments to calls to
2510 cp_parser_implicitly_scoped_statement.
2511 (cp_parser_iteration_statement): Likewise for calls to
2512 cp_parser_already_scoped_statement.
2513 (cp_parser_implicitly_scoped_statement): Add "guard_loc" and
2514 "guard_kind" params; use them to warn for misleading
2515 indentation.
2516 (cp_parser_already_scoped_statement): Likewise.
2517
2518 2015-05-11 Jan Hubicka <hubicka@ucw.cz>
2519
2520 * class.c (fixup_type_variants): Do not copy TYPE_METHODS
2521 (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant.
2522 * semantics.c (finish_member_declaration): Likewise.
2523 * method.c (lazily_declare_fn): Allways add method to main variant list.
2524
2525 2015-05-09 Aldy Hernandez <aldyh@redhat.com>
2526
2527 PR bootstrap/66085
2528 * decl2.c (note_mangling_alias): Declare arguments as unused.
2529
2530 2015-05-08 Jason Merrill <jason@redhat.com>
2531
2532 * cp-gimplify.c, parser.c: Adjust to -Wc++11-compat replacing
2533 -Wc++0x-compat.
2534
2535 2015-05-08 Jason Merrill <jason@redhat.com>
2536
2537 * decl2.c (mangling_aliases): New variable.
2538 (note_mangling_alias, generate_mangling_aliases): New.
2539 (cp_write_global_declarations): Call generate_mangling_aliases.
2540 (generate_mangling_alias): Split out from...
2541 * mangle.c (mangle_decl): ...here.
2542 * cp-tree.h: Declare note_mangling_alias.
2543
2544 2015-05-08 Aldy Hernandez <aldyh@redhat.com>
2545
2546 * decl2.c (collect_candidates_for_java_method_aliases): Remove.
2547 (build_java_method_aliases): Adapt to use create_same_body_alias
2548 instead of assemble_alias. Move variable declarations to
2549 definition and tidy up.
2550 (cp_write_global_declarations): Call build_java_method_aliases
2551 instead of collecting candidates first.
2552
2553 2015-05-07 Jason Merrill <jason@redhat.com>
2554
2555 PR c++/59012
2556 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion.
2557 (cp_parser_std_attribute_spec): Handle alignas pack expansion.
2558 * decl2.c (is_late_template_attribute): An attribute exp is dependent.
2559 * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion.
2560 (apply_late_template_attributes): Handle attribute pack expansion.
2561
2562 2015-05-07 Marek Polacek <polacek@redhat.com>
2563
2564 PR c/65179
2565 * typeck.c (cp_build_binary_op): Warn when left shifting a negative
2566 value.
2567
2568 2015-05-07 Jason Merrill <jason@redhat.com>
2569
2570 DR 1467
2571 PR c++/51747
2572 * typeck2.c (digest_init_r): Fix single element list.
2573
2574 2015-05-05 Jason Merrill <jason@redhat.com>
2575
2576 * cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and
2577 MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a
2578 MUST_NOT_THROW_EXPR.
2579 (cp_genericize_data): Add try_block field.
2580 (cp_genericize_tree): Initialize it.
2581 * except.c (expand_end_catch_block): Set TREE_NO_WARNING on
2582 implicit rethrow.
2583
2584 * constexpr.c (potential_constant_expression_1) [AT_ENCODE_EXPR]:
2585 Return false.
2586
2587 * semantics.c (finish_call_expr): Check complain.
2588
2589 * decl2.c (reset_type_linkage_2): Update the DECL_NAME of a
2590 maybe-in-charge constructor.
2591
2592 * decl.c (start_decl): Don't push the plain VAR_DECL for a
2593 variable template.
2594
2595 DR 1518
2596 DR 1630
2597 PR c++/54835
2598 PR c++/60417
2599 * call.c (convert_like_real): Check value-initialization before
2600 explicit.
2601 * typeck2.c (process_init_constructor_record): Don't set
2602 CONSTRUCTOR_IS_DIRECT_INIT.
2603 (process_init_constructor_array): Likewise.
2604 * init.c (build_vec_init): Likewise.
2605
2606 2015-05-05 David Malcolm <dmalcolm@redhat.com>
2607
2608 * parser.c (cp_parser_asm_definition): Only test for
2609 error_mark_node if "outputs" was just set. Likewise for "inputs".
2610
2611 2015-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2612 Jakub Jelinek <jakub@redhat.com>
2613
2614 PR c++/66007
2615 * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't
2616 result in an actual error.
2617
2618 2015-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2619 Prathamesh Kulharni <prathamesh.kulkarni@linaro.org>
2620
2621 PR c++/65858
2622 * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
2623 false.
2624
2625 2015-04-30 David Malcolm <dmalcolm@redhat.com>
2626
2627 * cp-tree.h (ARGUMENT_PACK_SELECT_ARG): Remove spurious
2628 trailing semicolon.
2629
2630 2015-04-29 Jason Merrill <jason@redhat.com>
2631
2632 PR c++/50800
2633 * tree.c (apply_identity_attributes): Fix handling of classes.
2634
2635 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
2636
2637 * parser.c (cp_parser_oacc_enter_exit_data): Use
2638 OMP_STANDALONE_CLAUSES.
2639
2640 2015-04-29 Paolo Carlini <paolo.carlini@oracle.com>
2641
2642 PR c++/64667
2643 * init.c (perform_member_init): Handle references for -Winit-self.
2644
2645 2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
2646
2647 * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
2648 OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
2649
2650 2015-04-28 Jason Merrill <jason@redhat.com>
2651
2652 PR c++/65896
2653 * constexpr.c (cxx_eval_store_expression): Don't try to actually
2654 store an empty class.
2655
2656 PR c++/65656
2657 * constexpr.c (cxx_eval_builtin_function_call): Fix
2658 __builtin_constant_p.
2659
2660 PR c++/50800
2661 * tree.c (strip_typedefs): Add remove_attributes parm.
2662 (strip_typedefs_expr): Likewise.
2663 (apply_identity_attributes): New subroutine of strip_typedefs.
2664 * pt.c (canonicalize_type_argument): Let strip_typedefs handle attrs.
2665 (convert_nontype_argument, unify): Likewise.
2666 * cp-tree.h: Adjust.
2667
2668 PR c++/65734
2669 * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
2670
2671 2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2672
2673 * class.c (layout_class_type): Remove check if
2674 PCC_BITFIELD_TYPE_MATTERS is defined.
2675
2676 2015-04-27 Jim Wilson <jim.wilson@linaro.org>
2677
2678 * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus.
2679
2680 2015-04-24 Jason Merrill <jason@redhat.com>
2681
2682 PR c++/50800
2683 * typeck.c (structural_comptypes): Don't check TYPE_REF_CAN_ALIAS_ALL.
2684
2685 * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
2686 Remove obsolete code.
2687 [NE_EXPR]: Likewise.
2688
2689 2015-04-23 Jason Merrill <jason@redhat.com>
2690
2691 PR c++/65646
2692 * pt.c (check_explicit_specialization): Don't
2693 SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
2694 headers.
2695 * decl.c (grokvardecl): Revert earlier fix.
2696
2697 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com>
2698
2699 PR c++/65801
2700 * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
2701 suppresses the diagnostic.
2702
2703 2015-04-20 Ville Voutilainen <ville.voutilainen@gmail.com>
2704
2705 Reject trailing return type for an operator auto().
2706 * decl.c (grokdeclarator): Reject trailing return types for
2707 all conversion operators, don't handle conversion operators
2708 in the previous checks that deal with auto.
2709
2710 2015-04-20 Ilya Verbin <ilya.verbin@intel.com>
2711
2712 * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
2713
2714 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2715
2716 * class.c (resolve_address_of_overloaded_function, instantiate_type):
2717 Rename tsubst_flags_t parameter flags -> complain.
2718
2719 2015-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2720
2721 * call.c (build_op_delete_call, build_over_call): Check mark_used
2722 return value.
2723 * class.c (resolve_address_of_overloaded_function): Likewise.
2724 * decl.c (cxx_maybe_build_cleanup): Likewise.
2725 * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
2726 tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
2727 * rtti.c (build_dynamic_cast_1): Likewise.
2728 * semantics.c (process_outer_var_ref): Likewise.
2729 * typeck.c (build_class_member_access_expr,
2730 cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
2731
2732 2015-04-15 Jason Merrill <jason@redhat.com>
2733
2734 * constexpr.c (cxx_eval_store_expression): Ignore clobbers.
2735 (build_constexpr_constructor_member_initializers): Loop to find
2736 the BIND_EXPR.
2737 * decl.c (start_preparsed_function): Clobber the object at the
2738 beginning of a constructor.
2739
2740 * decl.c (grokmethod): Only set DECL_COMDAT if TREE_PUBLIC is set.
2741 * method.c (implicitly_declare_fn): Likewise.
2742 * decl2.c (vague_linkage_p): Check TREE_PUBLIC first.
2743
2744 * decl2.c (determine_visibility): Use get_template_info.
2745
2746 2015-04-15 Jason Merrill <jason@redhat.com>
2747 Marek Polacek <polacek@redhat.com>
2748
2749 PR c++/65727
2750 * lambda.c (lambda_expr_this_capture): In unevaluated context go
2751 through the normal loop, just don't capture.
2752 (maybe_resolve_dummy): Handle null return.
2753
2754 2015-04-15 Paolo Carlini <paolo.carlini@oracle.com>
2755
2756 * call.c (enforce_access): Emit error + inform.
2757
2758 2015-04-15 Marek Polacek <polacek@redhat.com>
2759
2760 * constexpr.c (use_new_call): Remove #define.
2761 (lookup_parameter_binding): Remove function.
2762 (cxx_bind_parameters_in_call): Remove unused code.
2763 (cxx_eval_call_expression): Likewise.
2764 (cxx_eval_constant_expression): Likewise.
2765
2766 2015-04-14 Mikhail Maltsev <maltsevm@gmail.com>
2767
2768 * tree.c (replace_placeholders_t): Remove unused type.
2769 (replace_placeholders): Remove unused pset.
2770
2771 2015-04-14 Jason Merrill <jason@redhat.com>
2772
2773 * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
2774
2775 PR c++/65695
2776 * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
2777
2778 PR c++/65721
2779 * name-lookup.c (do_class_using_decl): Complain about specifying
2780 the current class even if there are dependent bases.
2781
2782 2015-04-14 David Krauss <david_work@me.com>
2783
2784 PR c++/59766
2785 * decl.c (grokdeclarator): Do not flag friends with deduced return.
2786
2787 2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
2788 Jason Merrill <jason@redhat.com>
2789
2790 PR c++/60994
2791 * parser.c (cp_parser_class_name): Add enum_ok parameter.
2792 (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
2793 (cp_parser_diagnose_invalid_type_name): Don't assume a template is
2794 a class template.
2795
2796 2015-04-12 Jakub Jelinek <jakub@redhat.com>
2797
2798 PR c++/65736
2799 * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
2800 don't fold if op01 isn't divisible by TYPE_SIZE_UNIT. Convert
2801 the expression to the original type at the end.
2802
2803 2015-04-09 Jakub Jelinek <jakub@redhat.com>
2804
2805 PR c++/65690
2806 * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
2807 TYPE_USER_ALIGN.
2808
2809 PR c++/65690
2810 * tree.c (build_cplus_array_type): Layout type before variants are
2811 set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
2812 variant.
2813
2814 2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
2815
2816 PR c++/64085
2817 * lambda.c (add_capture): Use dependent_type_p for capture by
2818 reference too.
2819
2820 2015-04-02 Marek Polacek <polacek@redhat.com>
2821
2822 PR c++/65642
2823 * constexpr.c (cxx_eval_pointer_plus_expression): Call
2824 cxx_eval_constant_expression on the first operand.
2825
2826 2015-04-01 Jason Merrill <jason@redhat.com>
2827
2828 PR c++/65625
2829 * decl.c (make_typename_type): Handle seeing a variable template.
2830
2831 2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2832
2833 PR c++/56100
2834 * pt.c (instantiating_current_function_p): New.
2835 * name-lookup.c (pushdecl_maybe_friend_1): Use it.
2836 * cp-tree.h (instantiating_current_function_p): Declare.
2837
2838 2015-04-01 Jason Merrill <jason@redhat.com>
2839
2840 PR c++/65646
2841 * decl.c (grokvardecl): Don't call check_explicit_specialization
2842 for non-template members of a class template.
2843
2844 2015-04-01 Marek Polacek <polacek@redhat.com>
2845
2846 PR c++/65554
2847 * class.c (finish_struct): Require that the second field of a
2848 user-defined initializer_list be of size type.
2849
2850 2015-03-31 Marek Polacek <polacek@redhat.com>
2851
2852 PR c++/65390
2853 * tree.c (build_cplus_array_type): Use dependent_type_p rather than
2854 checking for constness.
2855
2856 2015-03-30 Marek Polacek <polacek@redhat.com>
2857
2858 PR c++/65398
2859 * constexpr.c (cxx_fold_indirect_ref): Don't perform the
2860 *(&A[i] p+ j) => A[i + j] transformation here.
2861 (cxx_eval_pointer_plus_expression): New function.
2862 (cxx_eval_constant_expression): Use it here.
2863
2864 2015-03-27 Tobias Burnus <burnus@net-b.de>
2865
2866 PR c/65586
2867 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
2868 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
2869 cp_parser_omp_declare): Don't show error for skipped omp pragmas with
2870 -fopenmp-simd.
2871
2872 2015-03-27 Marek Polacek <polacek@redhat.com>
2873
2874 PR c++/65556
2875 * semantics.c (finish_switch_cond): If the unlowered type is not an
2876 enum, use the type of the condition.
2877
2878 2015-03-27 Jason Merrill <jason@redhat.com>
2879
2880 PR c++/65509
2881 * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
2882 constants.
2883
2884 2015-03-26 Mikhail Maltsev <maltsevm@gmail.com>
2885
2886 PR c++/65154
2887 * init.c (build_vec_init): Fix initializing aggregates
2888 with empty init list.
2889
2890 2015-03-26 Jason Merrill <jason@redhat.com>
2891
2892 PR c++/65525
2893 * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
2894
2895 2015-03-25 Marek Polacek <polacek@redhat.com>
2896
2897 PR c++/65558
2898 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
2899 on an anonymous namespace.
2900
2901 2015-03-25 Marek Polacek <polacek@redhat.com>
2902
2903 PR c++/61670
2904 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
2905
2906 2015-03-24 Jason Merrill <jason@redhat.com>
2907
2908 PR c++/65046
2909 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
2910 * parser.c (cp_parser_namespace_definition): Don't set it.
2911 * name-lookup.c (handle_namespace_attrs): Check
2912 DECL_NAMESPACE_ASSOCIATIONS instead.
2913
2914 PR c++/65498
2915 * pt.c (get_mostly_instantiated_function_type): Just return the
2916 type of the partially instantiated template in DECL_TI_TEMPLATE.
2917
2918 2015-03-20 Marek Polacek <polacek@redhat.com>
2919
2920 PR c++/65398
2921 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
2922 A[i + j].
2923
2924 2015-03-20 Marek Polacek <polacek@redhat.com>
2925
2926 PR c++/65072
2927 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
2928 variant.
2929
2930 2015-03-19 Jason Merrill <jason@redhat.com>
2931
2932 PR c++/65046
2933 Automatically propagate ABI tags to variables and functions
2934 from their (return) type.
2935 * class.c (check_tag): Handle variables and functions.
2936 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
2937 (mark_or_check_tags): Likewise.
2938 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
2939 (check_abi_tags): Add single argument overload for decls.
2940 Handle inheriting tags for decls.
2941 * mangle.c (write_mangled_name): Call it.
2942 (mangle_return_type_p): Split out from write_encoding.
2943 (unmangled_name_p): Split out from write_mangled_name.
2944 (write_mangled_name): Ignore abi_tag on namespace.
2945 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
2946 * parser.c (cp_parser_namespace_definition): Set it.
2947 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
2948 about abi_tag attribute on non-inline namespace.
2949 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
2950 (handle_abi_tag_attribute): Allow tags on variables.
2951
2952 2015-03-19 Jakub Jelinek <jakub@redhat.com>
2953
2954 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
2955 attribute for DECL_EXTERNAL VAR_DECLs.
2956
2957 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2958
2959 PR c++/65340
2960 * call.c (build_over_call): Pass the tsubst_flags_t argument to
2961 mark_used.
2962 * decl2.c (mark_used): Inline the require_deduced_type call and
2963 guard the error call.
2964
2965 2015-03-16 Jason Merrill <jason@redhat.com>
2966
2967 PR c++/65061
2968 * parser.c (cp_parser_template_name): Call strip_using_decl.
2969
2970 2015-03-16 Marek Polacek <polacek@redhat.com>
2971
2972 DR 1688
2973 PR c++/65327
2974 * decl.c (grokdeclarator): Allow volatile and constexpr together.
2975
2976 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
2977
2978 PR c++/65323
2979 * decl.c (check_default_argument): Don't call
2980 maybe_warn_zero_as_null_pointer_constant.
2981
2982 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
2983
2984 * cp-gimplify.c (simple_empty_class_p): New.
2985 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
2986 the code for empty class copies into simple_empty_class_p, and
2987 adapt it to handle COMPOUND_EXPRs.
2988
2989 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
2990
2991 PR c++/65370
2992 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
2993 only if the location of newdecl doesn't match the location of olddecl.
2994
2995 2015-03-10 Jakub Jelinek <jakub@redhat.com>
2996
2997 PR c++/65127
2998 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
2999 is not a PARM_DECL.
3000
3001 2015-03-10 Jason Merrill <jason@redhat.com>
3002
3003 PR c++/65333
3004 DR 1558
3005 * pt.c (dependent_type_p_r): Check both class and alias template args.
3006
3007 2015-03-10 Jakub Jelinek <jakub@redhat.com>
3008
3009 PR c/65120
3010 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
3011 before preparing arguments to warn_logical_not_parentheses.
3012 Use maybe_constant_value on rhs.
3013
3014 2015-03-09 Jason Merrill <jason@redhat.com>
3015
3016 PR c++/65339
3017 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
3018
3019 2015-03-09 Jakub Jelinek <jakub@redhat.com>
3020
3021 PR c/65120
3022 * parser.c (cp_parser_binary_expression): Don't warn for
3023 !!x == y or !b == y where b is bool.
3024
3025 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
3026
3027 * ptree.c (cxx_print_lambda_node): New.
3028 (cxx_print_xnode): Handle LAMBDA_EXPR.
3029
3030 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
3031
3032 PR c++/65295
3033 * constexpr.c (cxx_eval_constant_expression): Remove assert in
3034 RESULT_DECL handling.
3035
3036 2015-02-26 Marek Polacek <polacek@redhat.com>
3037
3038 PR c++/65202
3039 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
3040 a RETURN_EXPR if its operand is null.
3041
3042 2015-02-25 Jason Merrill <jason@redhat.com>
3043
3044 PR c++/65209
3045 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
3046 DECL_COMDAT.
3047 (constrain_visibility_for_template): Handle reference arguments.
3048
3049 PR debug/58315
3050 * decl.c (start_preparsed_function): Use create_artificial_label
3051 for cdtor_label.
3052
3053 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
3054 Jakub Jelinek <jakub@redhat.com>
3055
3056 PR c++/65075
3057 * constexpr.c (check_constexpr_bind_expr_vars): Allow
3058 implicit typedefs for lambda types.
3059
3060 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
3061
3062 PR c++/60894
3063 * decl.c (lookup_and_check_tag): Use strip_using_decl.
3064
3065 2015-02-13 Jason Merrill <jason@redhat.com>
3066
3067 PR c++/65054
3068 * pt.c (template_args_equal): Look through conversions here.
3069 * tree.c (cp_tree_equal): Not here.
3070
3071 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
3072
3073 PR c++/60211
3074 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
3075 pragma_external context.
3076
3077 2015-02-13 Jason Merrill <jason@redhat.com>
3078
3079 PR c++/65051
3080 * call.c (reference_binding): Don't look for bad conversion
3081 if TO is incomplete.
3082
3083 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
3084
3085 PR c++/64970
3086 * decl.c (make_typename_type): Pass tsubst_flags_t argument
3087 to lookup_template_class.
3088
3089 2015-02-13 Jakub Jelinek <jakub@redhat.com>
3090
3091 PR ipa/65034
3092 * decl.c (start_preparsed_function): Use void_type_node instead
3093 of NULL_TREE as LABEL_DECL type.
3094
3095 2015-02-12 Jason Merrill <jason@redhat.com>
3096
3097 PR c++/64898
3098 * mangle.c (write_mangled_name): Fix test for variable template
3099 instantiation.
3100
3101 * decl.c (begin_destructor_body): Condition clobber on
3102 -flifetime-dse.
3103
3104 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
3105
3106 PR c++/64959
3107 * parser.c (lookup_literal_operator): Return all candidates.
3108 (cp_parser_userdef_char_literal): Simplify error handling.
3109 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
3110 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
3111 Also give higher priority to standard string UDL operator.
3112
3113 2015-02-12 Jakub Jelinek <jakub@redhat.com>
3114
3115 PR debug/55541
3116 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
3117 * decl.c (poplevel): If functionbody, try not to create an extra
3118 BLOCK for function body and use subblocks as that, if it is non-NULL
3119 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
3120 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
3121
3122 PR sanitizer/64984
3123 * except.c (check_noexcept_r): Return NULL for internal
3124 calls.
3125
3126 2015-02-10 Jason Merrill <jason@redhat.com>
3127
3128 PR c++/64994
3129 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
3130
3131 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
3132
3133 PR ipa/64982
3134 * method.c (use_thunk): Do not check for stdarg thunks.
3135
3136 2015-02-06 Jason Merrill <jason@redhat.com>
3137
3138 PR c++/64899
3139 * init.c (build_vec_init): Handle default-initialized array with
3140 constexpr default constructor.
3141
3142 2015-02-04 Jakub Jelinek <jakub@redhat.com>
3143
3144 PR c/64824
3145 PR c/64868
3146 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
3147
3148 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
3149
3150 PR c++/64877
3151 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
3152 for generated expressions.
3153
3154 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
3155
3156 PR c++/64901
3157 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
3158 DECL_OVERRIDE_P.
3159
3160 2015-02-02 Jason Merrill <jason@redhat.com>
3161
3162 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
3163
3164 2015-01-30 Joseph Myers <joseph@codesourcery.com>
3165
3166 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
3167 changed to pass input_location as first argument.
3168
3169 2015-01-29 Jakub Jelinek <jakub@redhat.com>
3170
3171 PR c++/64717
3172 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
3173 into SAVE_EXPR.
3174
3175 2015-01-29 Jason Merrill <jason@redhat.com>
3176
3177 PR c++/49508
3178 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
3179 erroneous return statement.
3180
3181 PR c++/64521
3182 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
3183 point.
3184
3185 2015-01-27 Caroline Tice <cmtice@google.com>
3186
3187 Committing VTV Cywin/Ming patch for Patrick Wollgast
3188 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
3189 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
3190
3191 2015-01-27 Jason Merrill <jason@redhat.com>
3192
3193 PR c++/58597
3194 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
3195 current_function_decl.
3196
3197 PR c++/63889
3198 * pt.c (finish_template_variable): Move from semantics.c.
3199 Handle multiple template arg levels. Handle coercion here.
3200 (lookup_template_variable): Not here.
3201
3202 2015-01-23 Jason Merrill <jason@redhat.com>
3203
3204 PR c++/64314
3205 PR c++/57510
3206 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
3207 that has been completely split out.
3208
3209 PR c++/64701
3210 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
3211 statement codes.
3212
3213 PR c++/64727
3214 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
3215 of CONST_DECL.
3216
3217 2015-01-21 Jason Merrill <jason@redhat.com>
3218
3219 PR c++/64603
3220 * constexpr.c (cxx_eval_constant_expression): Only shortcut
3221 constant CONSTRUCTORs.
3222
3223 PR c++/64647
3224 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
3225 give a hard error in a template instantiation.
3226
3227 2015-01-21 Richard Biener <rguenther@suse.de>
3228
3229 PR middle-end/64313
3230 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
3231 for builtins the user declared correctly.
3232
3233 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
3234
3235 PR c++/58614
3236 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
3237 TREE_TYPE (elt) == error_mark_node.
3238
3239 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
3240
3241 PR tree-optimization/62053
3242 * tree.c (build_cplus_array_type): Layout type after variants are set.
3243
3244 2015-01-15 Jakub Jelinek <jakub@redhat.com>
3245
3246 * cp-gimplify.c (cp_genericize_r): Call
3247 cp_ubsan_maybe_instrument_member_call for member calls.
3248 (cp_ubsan_check_member_access_r): New function.
3249 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
3250 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
3251 cp_ubsan_instrument_member_accesses,
3252 cp_ubsan_maybe_instrument_downcast,
3253 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
3254 * cp-ubsan.c: New file.
3255 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
3256 * constexpr.c (cxx_eval_call_expression): Return void_node
3257 for IFN_UBSAN_VPTR.
3258 (potential_constant_expression_1): Return true for
3259 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
3260 * typeck.c (build_class_member_access_expr): Provide locus
3261 for COMPONENT_REFs.
3262 (build_static_cast_1): Instrument downcasts.
3263 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
3264 add ubsan instrumentation for virtual_access.
3265 * call.c: Include internal-fn.h.
3266 (set_flags_from_callee): Handle internal calls.
3267
3268 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
3269
3270 PR c++/59366
3271 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
3272 and function templates, declared only in the class.
3273 * decl.c (duplicate_decls): Reveal hidden friend functions or
3274 function templates, if they are redeclared outside the class.
3275
3276 2015-01-15 Jason Merrill <jason@redhat.com>
3277
3278 PR c++/64356
3279 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
3280
3281 PR c++/63283
3282 * constexpr.c (potential_constant_expression_1): Handle reference
3283 args in templates.
3284
3285 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
3286 James Norris <jnorris@codesourcery.com>
3287 Cesar Philippidis <cesar@codesourcery.com>
3288 Ilmir Usmanov <i.usmanov@samsung.com>
3289 Jakub Jelinek <jakub@redhat.com>
3290
3291 * parser.c: Include "gomp-constants.h".
3292 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
3293 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
3294 Use OMP_CLAUSE_SET_MAP_KIND.
3295 (cp_parser_omp_construct, cp_parser_pragma): Handle
3296 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
3297 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
3298 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
3299 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
3300 "create", "delete", "deviceptr", "host", "num_gangs",
3301 "num_workers", "present", "present_or_copy", "pcopy",
3302 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
3303 "present_or_create", "pcreate", "vector_length", "wait".
3304 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
3305 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
3306 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
3307 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
3308 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
3309 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
3310 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
3311 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
3312 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
3313 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
3314 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
3315 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
3316 (cp_parser_oacc_parallel, cp_parser_oacc_update)
3317 (cp_parser_oacc_wait): New functions.
3318 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
3319 (finish_oacc_parallel): New prototypes.
3320 * semantics.c: Include "gomp-constants.h".
3321 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
3322 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
3323 OMP_CLAUSE_SET_MAP_KIND.
3324 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
3325 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
3326 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
3327 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
3328 functions.
3329
3330 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
3331
3332 PR c++/58671
3333 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
3334 self-initialization.
3335
3336 2015-01-13 Jason Merrill <jason@redhat.com>
3337
3338 PR c++/64356
3339 PR libstdc++/58777
3340 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
3341 pointer expressions.
3342 (cxx_eval_increment_expression): Likewise.
3343
3344 PR c++/64514
3345 * pt.c (coerce_template_parameter_pack): Return NULL for a
3346 zero-length fixed parameter pack with a pack expansion arg.
3347
3348 PR c++/64520
3349 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
3350
3351 2015-01-12 Jason Merrill <jason@redhat.com>
3352
3353 PR c++/64547
3354 * constexpr.c (cxx_eval_call_expression): A call to a void
3355 function doesn't need to return a value.
3356
3357 2015-01-09 Michael Collison <michael.collison@linaro.org>
3358
3359 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
3360 input.h, alias.h, symtab.h, options.h, fold-const.h,
3361 wide-int.h, and inchash.h due to flattening of tree.h.
3362 * class.c: Ditto.
3363 * constexpr.c: Ditto.
3364 * cp-array-notation.c: Ditto.
3365 * cp-gimplify.c: Ditto.
3366 * cp-lang.c: Ditto.
3367 * cp-objcp-common.c: Ditto.
3368 * cvt.c: Ditto.
3369 * decl2.c: Ditto.
3370 * decl.c: Ditto.
3371 * dump.c: Ditto.
3372 * error.c: Ditto.
3373 * except.c: Ditto.
3374 * expr.c: Ditto.
3375 * friend.c: Ditto.
3376 * init.c: Ditto.
3377 * lambda.c: Ditto.
3378 * lex.c: Ditto.
3379 * mangle.c: Ditto.
3380 * name-lookup.c: Ditto.
3381 * optimize.c: Ditto.
3382 * parser.c: Ditto.
3383 * pt.c: Ditto.
3384 * ptree.c: Ditto.
3385 * repo.c: Ditto.
3386 * rtti.c: Ditto.
3387 * search.c: Ditto.
3388 * semantics.c: Ditto.
3389 * tree.c: Ditto.
3390 * typeck2.c: Ditto.
3391 * typeck.c: Ditto.
3392
3393 2015-01-08 Jason Merrill <jason@redhat.com>
3394
3395 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
3396 * decl.c (compute_array_index_type): Likewise.
3397 * init.c (build_vec_init): Likewise.
3398 * typeck.c (cp_build_binary_op): Likewise.
3399
3400 2015-01-08 Jason Merrill <jason@redhat.com>
3401
3402 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
3403 whether an initializer-list is too big for a VLA.
3404 (throw_bad_array_length): Remove.
3405 * cp-tree.h: Remove prototype.
3406
3407 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
3408
3409 PR c++/60753
3410 * decl.c (grokfndecl): Add bool parameter.
3411 (grokdeclarator): Adjust calls.
3412 (start_decl): Don't set DECL_DELETED_FN here.
3413
3414 2015-01-06 Jason Merrill <jason@redhat.com>
3415
3416 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
3417 template-ids.
3418
3419 PR c++/64455
3420 * pt.c (type_dependent_expression_p): Handle variable templates.
3421 * constexpr.c (potential_constant_expression_1): Use it.
3422
3423 PR c++/64487
3424 * semantics.c (finish_offsetof): Handle templates here.
3425 * parser.c (cp_parser_builtin_offsetof): Not here.
3426
3427 PR c++/64496
3428 * semantics.c (process_outer_var_ref): Diagnose lambda in local
3429 class NSDMI.
3430
3431 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
3432
3433 PR c++/64489
3434 * class.c (check_field_decls): Make copy assignment operators
3435 complex only in c++98 mode.
3436
3437 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
3438
3439 PR c++/31397
3440 * class.c (check_for_override): Warn when a virtual function is an
3441 override not marked override.
3442
3443 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
3444
3445 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
3446 hold base_fndecls.
3447 (get_basefndecls): Adjust.
3448
3449 2015-01-05 Jakub Jelinek <jakub@redhat.com>
3450
3451 Update copyright years.
3452
3453 2015-01-05 Marek Polacek <polacek@redhat.com>
3454
3455 PR c/64423
3456 * typeck.c (cp_build_array_ref): Pass loc down to
3457 warn_array_subscript_with_type_char.
3458
3459 \f
3460 Copyright (C) 2015 Free Software Foundation, Inc.
3461
3462 Copying and distribution of this file, with or without modification,
3463 are permitted in any medium without royalty provided the copyright
3464 notice and this notice are preserved.