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