re PR c++/65046 (-Wabi-tag doesn't warn about variables or function return types)
[gcc.git] / gcc / cp / ChangeLog
1 2015-03-24 Jason Merrill <jason@redhat.com>
2
3 PR c++/65046
4 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
5 * parser.c (cp_parser_namespace_definition): Don't set it.
6 * name-lookup.c (handle_namespace_attrs): Check
7 DECL_NAMESPACE_ASSOCIATIONS instead.
8
9 PR c++/65498
10 * pt.c (get_mostly_instantiated_function_type): Just return the
11 type of the partially instantiated template in DECL_TI_TEMPLATE.
12
13 2015-03-20 Marek Polacek <polacek@redhat.com>
14
15 PR c++/65398
16 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
17 A[i + j].
18
19 2015-03-20 Marek Polacek <polacek@redhat.com>
20
21 PR c++/65072
22 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
23 variant.
24
25 2015-03-19 Jason Merrill <jason@redhat.com>
26
27 PR c++/65046
28 Automatically propagate ABI tags to variables and functions
29 from their (return) type.
30 * class.c (check_tag): Handle variables and functions.
31 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
32 (mark_or_check_tags): Likewise.
33 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
34 (check_abi_tags): Add single argument overload for decls.
35 Handle inheriting tags for decls.
36 * mangle.c (write_mangled_name): Call it.
37 (mangle_return_type_p): Split out from write_encoding.
38 (unmangled_name_p): Split out from write_mangled_name.
39 (write_mangled_name): Ignore abi_tag on namespace.
40 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
41 * parser.c (cp_parser_namespace_definition): Set it.
42 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
43 about abi_tag attribute on non-inline namespace.
44 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
45 (handle_abi_tag_attribute): Allow tags on variables.
46
47 2015-03-19 Jakub Jelinek <jakub@redhat.com>
48
49 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
50 attribute for DECL_EXTERNAL VAR_DECLs.
51
52 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
53
54 PR c++/65340
55 * call.c (build_over_call): Pass the tsubst_flags_t argument to
56 mark_used.
57 * decl2.c (mark_used): Inline the require_deduced_type call and
58 guard the error call.
59
60 2015-03-16 Jason Merrill <jason@redhat.com>
61
62 PR c++/65061
63 * parser.c (cp_parser_template_name): Call strip_using_decl.
64
65 2015-03-16 Marek Polacek <polacek@redhat.com>
66
67 DR 1688
68 PR c++/65327
69 * decl.c (grokdeclarator): Allow volatile and constexpr together.
70
71 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
72
73 PR c++/65323
74 * decl.c (check_default_argument): Don't call
75 maybe_warn_zero_as_null_pointer_constant.
76
77 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
78
79 * cp-gimplify.c (simple_empty_class_p): New.
80 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
81 the code for empty class copies into simple_empty_class_p, and
82 adapt it to handle COMPOUND_EXPRs.
83
84 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
85
86 PR c++/65370
87 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
88 only if the location of newdecl doesn't match the location of olddecl.
89
90 2015-03-10 Jakub Jelinek <jakub@redhat.com>
91
92 PR c++/65127
93 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
94 is not a PARM_DECL.
95
96 2015-03-10 Jason Merrill <jason@redhat.com>
97
98 PR c++/65333
99 DR 1558
100 * pt.c (dependent_type_p_r): Check both class and alias template args.
101
102 2015-03-10 Jakub Jelinek <jakub@redhat.com>
103
104 PR c/65120
105 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
106 before preparing arguments to warn_logical_not_parentheses.
107 Use maybe_constant_value on rhs.
108
109 2015-03-09 Jason Merrill <jason@redhat.com>
110
111 PR c++/65339
112 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
113
114 2015-03-09 Jakub Jelinek <jakub@redhat.com>
115
116 PR c/65120
117 * parser.c (cp_parser_binary_expression): Don't warn for
118 !!x == y or !b == y where b is bool.
119
120 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
121
122 * ptree.c (cxx_print_lambda_node): New.
123 (cxx_print_xnode): Handle LAMBDA_EXPR.
124
125 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
126
127 PR c++/65295
128 * constexpr.c (cxx_eval_constant_expression): Remove assert in
129 RESULT_DECL handling.
130
131 2015-02-26 Marek Polacek <polacek@redhat.com>
132
133 PR c++/65202
134 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
135 a RETURN_EXPR if its operand is null.
136
137 2015-02-25 Jason Merrill <jason@redhat.com>
138
139 PR c++/65209
140 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
141 DECL_COMDAT.
142 (constrain_visibility_for_template): Handle reference arguments.
143
144 PR debug/58315
145 * decl.c (start_preparsed_function): Use create_artificial_label
146 for cdtor_label.
147
148 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
149 Jakub Jelinek <jakub@redhat.com>
150
151 PR c++/65075
152 * constexpr.c (check_constexpr_bind_expr_vars): Allow
153 implicit typedefs for lambda types.
154
155 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
156
157 PR c++/60894
158 * decl.c (lookup_and_check_tag): Use strip_using_decl.
159
160 2015-02-13 Jason Merrill <jason@redhat.com>
161
162 PR c++/65054
163 * pt.c (template_args_equal): Look through conversions here.
164 * tree.c (cp_tree_equal): Not here.
165
166 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
167
168 PR c++/60211
169 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
170 pragma_external context.
171
172 2015-02-13 Jason Merrill <jason@redhat.com>
173
174 PR c++/65051
175 * call.c (reference_binding): Don't look for bad conversion
176 if TO is incomplete.
177
178 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
179
180 PR c++/64970
181 * decl.c (make_typename_type): Pass tsubst_flags_t argument
182 to lookup_template_class.
183
184 2015-02-13 Jakub Jelinek <jakub@redhat.com>
185
186 PR ipa/65034
187 * decl.c (start_preparsed_function): Use void_type_node instead
188 of NULL_TREE as LABEL_DECL type.
189
190 2015-02-12 Jason Merrill <jason@redhat.com>
191
192 PR c++/64898
193 * mangle.c (write_mangled_name): Fix test for variable template
194 instantiation.
195
196 * decl.c (begin_destructor_body): Condition clobber on
197 -flifetime-dse.
198
199 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
200
201 PR c++/64959
202 * parser.c (lookup_literal_operator): Return all candidates.
203 (cp_parser_userdef_char_literal): Simplify error handling.
204 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
205 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
206 Also give higher priority to standard string UDL operator.
207
208 2015-02-12 Jakub Jelinek <jakub@redhat.com>
209
210 PR debug/55541
211 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
212 * decl.c (poplevel): If functionbody, try not to create an extra
213 BLOCK for function body and use subblocks as that, if it is non-NULL
214 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
215 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
216
217 PR sanitizer/64984
218 * except.c (check_noexcept_r): Return NULL for internal
219 calls.
220
221 2015-02-10 Jason Merrill <jason@redhat.com>
222
223 PR c++/64994
224 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
225
226 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
227
228 PR ipa/64982
229 * method.c (use_thunk): Do not check for stdarg thunks.
230
231 2015-02-06 Jason Merrill <jason@redhat.com>
232
233 PR c++/64899
234 * init.c (build_vec_init): Handle default-initialized array with
235 constexpr default constructor.
236
237 2015-02-04 Jakub Jelinek <jakub@redhat.com>
238
239 PR c/64824
240 PR c/64868
241 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
242
243 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
244
245 PR c++/64877
246 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
247 for generated expressions.
248
249 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
250
251 PR c++/64901
252 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
253 DECL_OVERRIDE_P.
254
255 2015-02-02 Jason Merrill <jason@redhat.com>
256
257 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
258
259 2015-01-30 Joseph Myers <joseph@codesourcery.com>
260
261 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
262 changed to pass input_location as first argument.
263
264 2015-01-29 Jakub Jelinek <jakub@redhat.com>
265
266 PR c++/64717
267 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
268 into SAVE_EXPR.
269
270 2015-01-29 Jason Merrill <jason@redhat.com>
271
272 PR c++/49508
273 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
274 erroneous return statement.
275
276 PR c++/64521
277 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
278 point.
279
280 2015-01-27 Caroline Tice <cmtice@google.com>
281
282 Committing VTV Cywin/Ming patch for Patrick Wollgast
283 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
284 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
285
286 2015-01-27 Jason Merrill <jason@redhat.com>
287
288 PR c++/58597
289 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
290 current_function_decl.
291
292 PR c++/63889
293 * pt.c (finish_template_variable): Move from semantics.c.
294 Handle multiple template arg levels. Handle coercion here.
295 (lookup_template_variable): Not here.
296
297 2015-01-23 Jason Merrill <jason@redhat.com>
298
299 PR c++/64314
300 PR c++/57510
301 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
302 that has been completely split out.
303
304 PR c++/64701
305 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
306 statement codes.
307
308 PR c++/64727
309 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
310 of CONST_DECL.
311
312 2015-01-21 Jason Merrill <jason@redhat.com>
313
314 PR c++/64603
315 * constexpr.c (cxx_eval_constant_expression): Only shortcut
316 constant CONSTRUCTORs.
317
318 PR c++/64647
319 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
320 give a hard error in a template instantiation.
321
322 2015-01-21 Richard Biener <rguenther@suse.de>
323
324 PR middle-end/64313
325 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
326 for builtins the user declared correctly.
327
328 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
329
330 PR c++/58614
331 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
332 TREE_TYPE (elt) == error_mark_node.
333
334 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
335
336 PR tree-optimization/62053
337 * tree.c (build_cplus_array_type): Layout type after variants are set.
338
339 2015-01-15 Jakub Jelinek <jakub@redhat.com>
340
341 * cp-gimplify.c (cp_genericize_r): Call
342 cp_ubsan_maybe_instrument_member_call for member calls.
343 (cp_ubsan_check_member_access_r): New function.
344 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
345 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
346 cp_ubsan_instrument_member_accesses,
347 cp_ubsan_maybe_instrument_downcast,
348 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
349 * cp-ubsan.c: New file.
350 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
351 * constexpr.c (cxx_eval_call_expression): Return void_node
352 for IFN_UBSAN_VPTR.
353 (potential_constant_expression_1): Return true for
354 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
355 * typeck.c (build_class_member_access_expr): Provide locus
356 for COMPONENT_REFs.
357 (build_static_cast_1): Instrument downcasts.
358 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
359 add ubsan instrumentation for virtual_access.
360 * call.c: Include internal-fn.h.
361 (set_flags_from_callee): Handle internal calls.
362
363 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
364
365 PR c++/59366
366 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
367 and function templates, declared only in the class.
368 * decl.c (duplicate_decls): Reveal hidden friend functions or
369 function templates, if they are redeclared outside the class.
370
371 2015-01-15 Jason Merrill <jason@redhat.com>
372
373 PR c++/64356
374 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
375
376 PR c++/63283
377 * constexpr.c (potential_constant_expression_1): Handle reference
378 args in templates.
379
380 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
381 James Norris <jnorris@codesourcery.com>
382 Cesar Philippidis <cesar@codesourcery.com>
383 Ilmir Usmanov <i.usmanov@samsung.com>
384 Jakub Jelinek <jakub@redhat.com>
385
386 * parser.c: Include "gomp-constants.h".
387 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
388 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
389 Use OMP_CLAUSE_SET_MAP_KIND.
390 (cp_parser_omp_construct, cp_parser_pragma): Handle
391 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
392 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
393 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
394 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
395 "create", "delete", "deviceptr", "host", "num_gangs",
396 "num_workers", "present", "present_or_copy", "pcopy",
397 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
398 "present_or_create", "pcreate", "vector_length", "wait".
399 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
400 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
401 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
402 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
403 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
404 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
405 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
406 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
407 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
408 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
409 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
410 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
411 (cp_parser_oacc_parallel, cp_parser_oacc_update)
412 (cp_parser_oacc_wait): New functions.
413 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
414 (finish_oacc_parallel): New prototypes.
415 * semantics.c: Include "gomp-constants.h".
416 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
417 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
418 OMP_CLAUSE_SET_MAP_KIND.
419 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
420 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
421 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
422 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
423 functions.
424
425 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
426
427 PR c++/58671
428 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
429 self-initialization.
430
431 2015-01-13 Jason Merrill <jason@redhat.com>
432
433 PR c++/64356
434 PR libstdc++/58777
435 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
436 pointer expressions.
437 (cxx_eval_increment_expression): Likewise.
438
439 PR c++/64514
440 * pt.c (coerce_template_parameter_pack): Return NULL for a
441 zero-length fixed parameter pack with a pack expansion arg.
442
443 PR c++/64520
444 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
445
446 2015-01-12 Jason Merrill <jason@redhat.com>
447
448 PR c++/64547
449 * constexpr.c (cxx_eval_call_expression): A call to a void
450 function doesn't need to return a value.
451
452 2015-01-09 Michael Collison <michael.collison@linaro.org>
453
454 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
455 input.h, alias.h, symtab.h, options.h, fold-const.h,
456 wide-int.h, and inchash.h due to flattening of tree.h.
457 * class.c: Ditto.
458 * constexpr.c: Ditto.
459 * cp-array-notation.c: Ditto.
460 * cp-gimplify.c: Ditto.
461 * cp-lang.c: Ditto.
462 * cp-objcp-common.c: Ditto.
463 * cvt.c: Ditto.
464 * decl2.c: Ditto.
465 * decl.c: Ditto.
466 * dump.c: Ditto.
467 * error.c: Ditto.
468 * except.c: Ditto.
469 * expr.c: Ditto.
470 * friend.c: Ditto.
471 * init.c: Ditto.
472 * lambda.c: Ditto.
473 * lex.c: Ditto.
474 * mangle.c: Ditto.
475 * name-lookup.c: Ditto.
476 * optimize.c: Ditto.
477 * parser.c: Ditto.
478 * pt.c: Ditto.
479 * ptree.c: Ditto.
480 * repo.c: Ditto.
481 * rtti.c: Ditto.
482 * search.c: Ditto.
483 * semantics.c: Ditto.
484 * tree.c: Ditto.
485 * typeck2.c: Ditto.
486 * typeck.c: Ditto.
487
488 2015-01-08 Jason Merrill <jason@redhat.com>
489
490 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
491 * decl.c (compute_array_index_type): Likewise.
492 * init.c (build_vec_init): Likewise.
493 * typeck.c (cp_build_binary_op): Likewise.
494
495 2015-01-08 Jason Merrill <jason@redhat.com>
496
497 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
498 whether an initializer-list is too big for a VLA.
499 (throw_bad_array_length): Remove.
500 * cp-tree.h: Remove prototype.
501
502 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
503
504 PR c++/60753
505 * decl.c (grokfndecl): Add bool parameter.
506 (grokdeclarator): Adjust calls.
507 (start_decl): Don't set DECL_DELETED_FN here.
508
509 2015-01-06 Jason Merrill <jason@redhat.com>
510
511 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
512 template-ids.
513
514 PR c++/64455
515 * pt.c (type_dependent_expression_p): Handle variable templates.
516 * constexpr.c (potential_constant_expression_1): Use it.
517
518 PR c++/64487
519 * semantics.c (finish_offsetof): Handle templates here.
520 * parser.c (cp_parser_builtin_offsetof): Not here.
521
522 PR c++/64496
523 * semantics.c (process_outer_var_ref): Diagnose lambda in local
524 class NSDMI.
525
526 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
527
528 PR c++/64489
529 * class.c (check_field_decls): Make copy assignment operators
530 complex only in c++98 mode.
531
532 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
533
534 PR c++/31397
535 * class.c (check_for_override): Warn when a virtual function is an
536 override not marked override.
537
538 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
539
540 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
541 hold base_fndecls.
542 (get_basefndecls): Adjust.
543
544 2015-01-05 Jakub Jelinek <jakub@redhat.com>
545
546 Update copyright years.
547
548 2015-01-05 Marek Polacek <polacek@redhat.com>
549
550 PR c/64423
551 * typeck.c (cp_build_array_ref): Pass loc down to
552 warn_array_subscript_with_type_char.
553
554 \f
555 Copyright (C) 2015 Free Software Foundation, Inc.
556
557 Copying and distribution of this file, with or without modification,
558 are permitted in any medium without royalty provided the copyright
559 notice and this notice are preserved.