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