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