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