flag-types.h (enum sanitize_code): Add SANITIZE_VPTR, include SANITIZE_VPTR in SANITI...
[gcc.git] / gcc / cp / ChangeLog
1 2015-01-15 Jakub Jelinek <jakub@redhat.com>
2
3 * cp-gimplify.c (cp_genericize_r): Call
4 cp_ubsan_maybe_instrument_member_call for member calls.
5 (cp_ubsan_check_member_access_r): New function.
6 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
7 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
8 cp_ubsan_instrument_member_accesses,
9 cp_ubsan_maybe_instrument_downcast,
10 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
11 * cp-ubsan.c: New file.
12 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
13 * constexpr.c (cxx_eval_call_expression): Return void_node
14 for IFN_UBSAN_VPTR.
15 (potential_constant_expression_1): Return true for
16 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
17 * typeck.c (build_class_member_access_expr): Provide locus
18 for COMPONENT_REFs.
19 (build_static_cast_1): Instrument downcasts.
20 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
21 add ubsan instrumentation for virtual_access.
22 * call.c: Include internal-fn.h.
23 (set_flags_from_callee): Handle internal calls.
24
25 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
26
27 PR c++/59366
28 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
29 and function templates, declared only in the class.
30 * decl.c (duplicate_decls): Reveal hidden friend functions or
31 function templates, if they are redeclared outside the class.
32
33 2015-01-15 Jason Merrill <jason@redhat.com>
34
35 PR c++/64356
36 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
37
38 PR c++/63283
39 * constexpr.c (potential_constant_expression_1): Handle reference
40 args in templates.
41
42 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
43 James Norris <jnorris@codesourcery.com>
44 Cesar Philippidis <cesar@codesourcery.com>
45 Ilmir Usmanov <i.usmanov@samsung.com>
46 Jakub Jelinek <jakub@redhat.com>
47
48 * parser.c: Include "gomp-constants.h".
49 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
50 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
51 Use OMP_CLAUSE_SET_MAP_KIND.
52 (cp_parser_omp_construct, cp_parser_pragma): Handle
53 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
54 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
55 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
56 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
57 "create", "delete", "deviceptr", "host", "num_gangs",
58 "num_workers", "present", "present_or_copy", "pcopy",
59 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
60 "present_or_create", "pcreate", "vector_length", "wait".
61 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
62 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
63 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
64 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
65 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
66 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
67 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
68 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
69 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
70 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
71 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
72 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
73 (cp_parser_oacc_parallel, cp_parser_oacc_update)
74 (cp_parser_oacc_wait): New functions.
75 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
76 (finish_oacc_parallel): New prototypes.
77 * semantics.c: Include "gomp-constants.h".
78 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
79 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
80 OMP_CLAUSE_SET_MAP_KIND.
81 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
82 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
83 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
84 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
85 functions.
86
87 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
88
89 PR c++/58671
90 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
91 self-initialization.
92
93 2015-01-13 Jason Merrill <jason@redhat.com>
94
95 PR c++/64356
96 PR libstdc++/58777
97 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
98 pointer expressions.
99 (cxx_eval_increment_expression): Likewise.
100
101 PR c++/64514
102 * pt.c (coerce_template_parameter_pack): Return NULL for a
103 zero-length fixed parameter pack with a pack expansion arg.
104
105 PR c++/64520
106 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
107
108 2015-01-12 Jason Merrill <jason@redhat.com>
109
110 PR c++/64547
111 * constexpr.c (cxx_eval_call_expression): A call to a void
112 function doesn't need to return a value.
113
114 2015-01-09 Michael Collison <michael.collison@linaro.org>
115
116 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
117 input.h, alias.h, symtab.h, options.h, fold-const.h,
118 wide-int.h, and inchash.h due to flattening of tree.h.
119 * class.c: Ditto.
120 * constexpr.c: Ditto.
121 * cp-array-notation.c: Ditto.
122 * cp-gimplify.c: Ditto.
123 * cp-lang.c: Ditto.
124 * cp-objcp-common.c: Ditto.
125 * cvt.c: Ditto.
126 * decl2.c: Ditto.
127 * decl.c: Ditto.
128 * dump.c: Ditto.
129 * error.c: Ditto.
130 * except.c: Ditto.
131 * expr.c: Ditto.
132 * friend.c: Ditto.
133 * init.c: Ditto.
134 * lambda.c: Ditto.
135 * lex.c: Ditto.
136 * mangle.c: Ditto.
137 * name-lookup.c: Ditto.
138 * optimize.c: Ditto.
139 * parser.c: Ditto.
140 * pt.c: Ditto.
141 * ptree.c: Ditto.
142 * repo.c: Ditto.
143 * rtti.c: Ditto.
144 * search.c: Ditto.
145 * semantics.c: Ditto.
146 * tree.c: Ditto.
147 * typeck2.c: Ditto.
148 * typeck.c: Ditto.
149
150 2015-01-08 Jason Merrill <jason@redhat.com>
151
152 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
153 * decl.c (compute_array_index_type): Likewise.
154 * init.c (build_vec_init): Likewise.
155 * typeck.c (cp_build_binary_op): Likewise.
156
157 2015-01-08 Jason Merrill <jason@redhat.com>
158
159 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
160 whether an initializer-list is too big for a VLA.
161 (throw_bad_array_length): Remove.
162 * cp-tree.h: Remove prototype.
163
164 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
165
166 PR c++/60753
167 * decl.c (grokfndecl): Add bool parameter.
168 (grokdeclarator): Adjust calls.
169 (start_decl): Don't set DECL_DELETED_FN here.
170
171 2015-01-06 Jason Merrill <jason@redhat.com>
172
173 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
174 template-ids.
175
176 PR c++/64455
177 * pt.c (type_dependent_expression_p): Handle variable templates.
178 * constexpr.c (potential_constant_expression_1): Use it.
179
180 PR c++/64487
181 * semantics.c (finish_offsetof): Handle templates here.
182 * parser.c (cp_parser_builtin_offsetof): Not here.
183
184 PR c++/64496
185 * semantics.c (process_outer_var_ref): Diagnose lambda in local
186 class NSDMI.
187
188 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
189
190 PR c++/64489
191 * class.c (check_field_decls): Make copy assignment operators
192 complex only in c++98 mode.
193
194 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
195
196 PR c++/31397
197 * class.c (check_for_override): Warn when a virtual function is an
198 override not marked override.
199
200 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
201
202 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
203 hold base_fndecls.
204 (get_basefndecls): Adjust.
205
206 2015-01-05 Jakub Jelinek <jakub@redhat.com>
207
208 Update copyright years.
209
210 2015-01-05 Marek Polacek <polacek@redhat.com>
211
212 PR c/64423
213 * typeck.c (cp_build_array_ref): Pass loc down to
214 warn_array_subscript_with_type_char.
215
216 \f
217 Copyright (C) 2015 Free Software Foundation, Inc.
218
219 Copying and distribution of this file, with or without modification,
220 are permitted in any medium without royalty provided the copyright
221 notice and this notice are preserved.