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