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