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