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