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