PR c++/58597
[official-gcc.git] / gcc / cp / ChangeLog
blob2ae15d027d8329e74b9989e494f203c76a7ff73b
1 2015-01-27  Jason Merrill  <jason@redhat.com>
3         PR c++/58597
4         * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
5         current_function_decl.
7         PR c++/63889
8         * pt.c (finish_template_variable): Move from semantics.c.
9         Handle multiple template arg levels.  Handle coercion here.
10         (lookup_template_variable): Not here.
12 2015-01-23  Jason Merrill  <jason@redhat.com>
14         PR c++/64314
15         PR c++/57510
16         * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
17         that has been completely split out.
19         PR c++/64701
20         * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
21         statement codes.
23         PR c++/64727
24         * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
25         of CONST_DECL.
27 2015-01-21  Jason Merrill  <jason@redhat.com>
29         PR c++/64603
30         * constexpr.c (cxx_eval_constant_expression): Only shortcut
31         constant CONSTRUCTORs.
33         PR c++/64647
34         * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
35         give a hard error in a template instantiation.
37 2015-01-21  Richard Biener  <rguenther@suse.de>
39         PR middle-end/64313
40         * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
41         for builtins the user declared correctly.
43 2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
45         PR c++/58614
46         * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
47         TREE_TYPE (elt) == error_mark_node.
49 2015-01-15  Jan Hubicka  <hubicka@ucw.cz>
51         PR tree-optimization/62053
52         * tree.c (build_cplus_array_type): Layout type after variants are set.
54 2015-01-15  Jakub Jelinek  <jakub@redhat.com>
56         * cp-gimplify.c (cp_genericize_r): Call
57         cp_ubsan_maybe_instrument_member_call for member calls.
58         (cp_ubsan_check_member_access_r): New function.
59         (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
60         * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
61         cp_ubsan_instrument_member_accesses,
62         cp_ubsan_maybe_instrument_downcast,
63         cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
64         * cp-ubsan.c: New file.
65         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
66         * constexpr.c (cxx_eval_call_expression): Return void_node
67         for IFN_UBSAN_VPTR.
68         (potential_constant_expression_1): Return true for
69         UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
70         * typeck.c (build_class_member_access_expr): Provide locus
71         for COMPONENT_REFs.
72         (build_static_cast_1): Instrument downcasts.
73         * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
74         add ubsan instrumentation for virtual_access.
75         * call.c: Include internal-fn.h.
76         (set_flags_from_callee): Handle internal calls.
78 2015-01-15  Momchil Velikov  <momchil.velikov@gmail.com>
80         PR c++/59366
81         * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
82         and function templates, declared only in the class.
83         * decl.c (duplicate_decls): Reveal hidden friend functions or
84         function templates, if they are redeclared outside the class.
86 2015-01-15  Jason Merrill  <jason@redhat.com>
88         PR c++/64356
89         * constexpr.c (cxx_eval_binary_expression): Fix pasto.
91         PR c++/63283
92         * constexpr.c (potential_constant_expression_1): Handle reference
93         args in templates.
95 2015-01-15  Thomas Schwinge  <thomas@codesourcery.com>
96             James Norris  <jnorris@codesourcery.com>
97             Cesar Philippidis  <cesar@codesourcery.com>
98             Ilmir Usmanov  <i.usmanov@samsung.com>
99             Jakub Jelinek  <jakub@redhat.com>
101         * parser.c: Include "gomp-constants.h".
102         (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
103         omp_clause_map_kind.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
104         Use OMP_CLAUSE_SET_MAP_KIND.
105         (cp_parser_omp_construct, cp_parser_pragma): Handle
106         PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
107         PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
108         PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
109         (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
110         "create", "delete", "deviceptr", "host", "num_gangs",
111         "num_workers", "present", "present_or_copy", "pcopy",
112         "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
113         "present_or_create", "pcreate", "vector_length", "wait".
114         (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
115         (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
116         (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
117         (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
118         (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
119         (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
120         (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
121         (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
122         (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
123         (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
124         (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
125         (cp_parser_oacc_kernels, cp_parser_oacc_loop)
126         (cp_parser_oacc_parallel, cp_parser_oacc_update)
127         (cp_parser_oacc_wait): New functions.
128         * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
129         (finish_oacc_parallel): New prototypes.
130         * semantics.c: Include "gomp-constants.h".
131         (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR.  Use
132         GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
133         OMP_CLAUSE_SET_MAP_KIND.
134         (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
135         OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
136         Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
137         (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
138         functions.
140 2015-01-14  Paolo Carlini  <paolo.carlini@oracle.com>
142         PR c++/58671
143         * decl2.c (var_defined_without_dynamic_init): Handle gracefully
144         self-initialization.
146 2015-01-13  Jason Merrill  <jason@redhat.com>
148         PR c++/64356
149         PR libstdc++/58777
150         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
151         pointer expressions.
152         (cxx_eval_increment_expression): Likewise.
154         PR c++/64514
155         * pt.c (coerce_template_parameter_pack): Return NULL for a
156         zero-length fixed parameter pack with a pack expansion arg.
158         PR c++/64520
159         * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
161 2015-01-12  Jason Merrill  <jason@redhat.com>
163         PR c++/64547
164         * constexpr.c (cxx_eval_call_expression): A call to a void
165         function doesn't need to return a value.
167 2015-01-09  Michael Collison  <michael.collison@linaro.org>
169         * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
170         input.h, alias.h, symtab.h, options.h, fold-const.h,
171         wide-int.h, and inchash.h due to flattening of tree.h.
172         * class.c: Ditto.
173         * constexpr.c: Ditto.
174         * cp-array-notation.c: Ditto.
175         * cp-gimplify.c: Ditto.
176         * cp-lang.c: Ditto.
177         * cp-objcp-common.c: Ditto.
178         * cvt.c: Ditto.
179         * decl2.c: Ditto.
180         * decl.c: Ditto.
181         * dump.c: Ditto.
182         * error.c: Ditto.
183         * except.c: Ditto.
184         * expr.c: Ditto.
185         * friend.c: Ditto.
186         * init.c: Ditto.
187         * lambda.c: Ditto.
188         * lex.c: Ditto.
189         * mangle.c: Ditto.
190         * name-lookup.c: Ditto.
191         * optimize.c: Ditto.
192         * parser.c: Ditto.
193         * pt.c: Ditto.
194         * ptree.c: Ditto.
195         * repo.c: Ditto.
196         * rtti.c: Ditto.
197         * search.c: Ditto.
198         * semantics.c: Ditto.
199         * tree.c: Ditto.
200         * typeck2.c: Ditto.
201         * typeck.c: Ditto.
203 2015-01-08  Jason Merrill  <jason@redhat.com>
205         * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
206         * decl.c (compute_array_index_type): Likewise.
207         * init.c (build_vec_init): Likewise.
208         * typeck.c (cp_build_binary_op): Likewise.
210 2015-01-08  Jason Merrill  <jason@redhat.com>
212         * init.c (build_vec_init): Call ubsan_instrument_bounds to check
213         whether an initializer-list is too big for a VLA.
214         (throw_bad_array_length): Remove.
215         * cp-tree.h: Remove prototype.
217 2015-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
219         PR c++/60753
220         * decl.c (grokfndecl): Add bool parameter.
221         (grokdeclarator): Adjust calls.
222         (start_decl): Don't set DECL_DELETED_FN here.
224 2015-01-06  Jason Merrill  <jason@redhat.com>
226         * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
227         template-ids.
229         PR c++/64455
230         * pt.c (type_dependent_expression_p): Handle variable templates.
231         * constexpr.c (potential_constant_expression_1): Use it.
233         PR c++/64487
234         * semantics.c (finish_offsetof): Handle templates here.
235         * parser.c (cp_parser_builtin_offsetof): Not here.
237         PR c++/64496
238         * semantics.c (process_outer_var_ref): Diagnose lambda in local
239         class NSDMI.
241 2015-01-06  Ville Voutilainen  <ville.voutilainen@gmail.com>
243         PR c++/64489
244         * class.c (check_field_decls): Make copy assignment operators
245         complex only in c++98 mode.
247 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
249         PR c++/31397
250         * class.c (check_for_override): Warn when a virtual function is an
251         override not marked override.
253 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
255         * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
256         hold base_fndecls.
257         (get_basefndecls): Adjust.
259 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
261         Update copyright years.
263 2015-01-05  Marek Polacek  <polacek@redhat.com>
265         PR c/64423
266         * typeck.c (cp_build_array_ref): Pass loc down to
267         warn_array_subscript_with_type_char.
270 Copyright (C) 2015 Free Software Foundation, Inc.
272 Copying and distribution of this file, with or without modification,
273 are permitted in any medium without royalty provided the copyright
274 notice and this notice are preserved.