eb98b044633504be0d55dff1dd7ad0fe5acb3b3c
[gcc.git] / gcc / cp / ChangeLog
1 2013-02-25 Jason Merrill <jason@redhat.com>
2
3 PR c++/56438
4 * semantics.c (potential_constant_expression_1): In C++98, a cast
5 to non-integral type can't be a constant expression.
6
7 2013-02-24 Jakub Jelinek <jakub@redhat.com>
8
9 PR c++/56403
10 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
11 of CLASS_TYPE_P.
12
13 2013-02-22 Jason Merrill <jason@redhat.com>
14
15 PR c++/40405
16 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
17 if we got the wrong number of template parms.
18
19 PR c++/56377
20 * pt.c (fn_type_unification): Use explicit args in template
21 instantiation context.
22
23 PR c++/56359
24 * call.c (can_convert_arg): Discard access checks.
25
26 PR c++/56395
27 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
28 args.
29
30 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
31
32 PR c++/56373
33 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
34 * cvt.c (ocp_convert): Use the latter.
35 (cp_convert_to_pointer): Likewise.
36 * decl.c (check_default_argument): Likewise.
37 * typeck.c (cp_build_binary_op): Likewise.
38 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
39
40 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
41 Paolo Carlini <paolo.carlini@oracle.com>
42
43 PR c++/51242
44 * decl2.c (grokbitfield): Allow scoped enumeration types.
45
46 2013-02-15 Jason Merrill <jason@redhat.com>
47
48 PR c++/54276
49 * semantics.c (finish_id_expression): Also return the identifier
50 for an outer local static.
51
52 PR c++/56343
53 * class.c (check_bases_and_members): Deduce noexcept after
54 checking bases.
55
56 PR c++/52026
57 * semantics.c (finish_id_expression): In a template, return
58 the identifier for a constant variable.
59
60 2013-02-14 Jason Merrill <jason@redhat.com>
61
62 PR c++/54922
63 * semantics.c (build_anon_member_initialization): New.
64 (build_data_member_initialization): Use it.
65
66 PR c++/55003
67 * decl.c (cp_finish_decl): Force instantiation of an
68 auto static data member.
69
70 PR c++/55220
71 * pt.c (unify): A pack expansion that is not the last template
72 argument makes the entire template argument list non-deduced.
73
74 PR c++/56323
75 * name-lookup.c (do_class_using_decl): Handle typedefs with
76 inheriting constructors.
77 (push_class_level_binding_1): Allow inheriting from template
78 template parameter, too.
79 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
80
81 PR c++/55223
82 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
83 default argument scope.
84 * mangle.c (write_name): Likewise.
85
86 PR c++/55232
87 * error.c (find_typenames_r): Don't walk into a pack expansion.
88
89 2013-02-13 Jason Merrill <jason@redhat.com>
90
91 PR c++/55670
92 * parser.c (cp_parser_member_declaration): Check the declarator
93 form when detecting a function declaration via typedef.
94
95 PR c++/55680
96 * pt.c (maybe_process_partial_specialization): A lambda
97 isn't what's being specialized.
98
99 PR c++/55710
100 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
101 TREE_USED.
102
103 PR c++/55879
104 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
105
106 PR c++/55993
107 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
108 non-zero offsets, too.
109
110 PR c++/56155
111 * decl.c (build_enumerator): Always convert the value to a
112 fixed underlying type.
113
114 PR c++/56135
115 * pt.c (tsubst_copy_and_build): Don't forget any new
116 captures that arose from use of dependent names.
117
118 2013-02-13 Jakub Jelinek <jakub@redhat.com>
119
120 PR c++/56302
121 * semantics.c (finish_asm_stmt): If input constraints allow
122 neither register nor memory, try maybe_constant_value to get
123 a constant if possible.
124
125 2013-02-12 Jason Merrill <jason@redhat.com>
126
127 PR c++/56285
128 * method.c (add_one_base_init): Handle base constructor
129 taking rvalue reference parm.
130
131 PR c++/56291
132 * semantics.c (sort_constexpr_mem_initializers): Handle
133 vptr out of order.
134
135 2013-02-09 Jason Merrill <jason@redhat.com>
136
137 PR c++/56268
138 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
139 maybe_instantiate_noexcept.
140
141 PR c++/56247
142 * pt.c (eq_specializations): Set comparing_specializations.
143 * tree.c (cp_tree_equal): Check it.
144 * cp-tree.h: Declare it.
145
146 * decl.c (decls_match): Check versions later.
147
148 PR c++/56238
149 * pt.c (build_non_dependent_expr): Don't try to fold
150 instantiation-dependent expressions.
151 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
152 [BIND_EXPR]: Treat as dependent.
153
154 2013-02-07 Jakub Jelinek <jakub@redhat.com>
155
156 PR c++/56241
157 * init.c (build_vec_init): Don't append NULL values into new_vec.
158 (build_zero_init_1): Don't push anything into v if recursive call
159 returned NULL_TREE.
160 (build_value_init_noctor): Don't push anything into v if
161 build_value_init call returned NULL_TREE.
162
163 PR c++/56239
164 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
165 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
166 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
167 return true only if 2nd token isn't CPP_CLOSE_PAREN.
168 (cp_parser_cast_expression): Adjust caller.
169
170 PR c++/56237
171 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
172 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
173 DECL_LANG_SPECIFIC (t).
174
175 2013-02-07 Jason Merrill <jason@redhat.com>
176
177 PR c++/56235
178 * method.c (do_build_copy_constructor): Don't bother turning
179 scalars from lvalues to xvalues.
180 (do_build_copy_assign): Likewise.
181
182 2013-02-06 Jason Merrill <jason@redhat.com>
183
184 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
185
186 2013-02-05 Jason Merrill <jason@redhat.com>
187
188 PR c++/54122
189 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
190 METHOD_TYPE.
191
192 PR c++/56177
193 * decl.c (start_preparsed_function): Update restype if we change
194 decl1.
195
196 PR c++/56208
197 * pt.c (fn_type_unification): Discard any access checks from
198 substituting explicit args.
199
200 2013-01-31 Jason Merrill <jason@redhat.com>
201
202 PR c++/56162
203 PR c++/56104
204 * typeck.c (get_member_function_from_ptrfunc): Fix
205 ptrmemfunc_vbit_in_delta case.
206
207 2013-01-29 Jason Merrill <jason@redhat.com>
208
209 PR libstdc++/54314
210 * class.c (build_ctor_vtbl_group): Give construction vtables
211 hidden visibility.
212
213 2013-01-25 Jason Merrill <jason@redhat.com>
214
215 PR c++/56095
216 * pt.c (convert_nontype_argument_function): Handle invalid input.
217 (convert_nontype_argument): Likewise.
218
219 PR c++/56104
220 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
221 dynamic type has no virtual functions.
222
223 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
224
225 PR c++/55944
226 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
227 on TARGET_EXPR nodes.
228
229 2013-01-22 Jason Merrill <jason@redhat.com>
230
231 PR c++/56071
232 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
233
234 2013-01-22 Dodji Seketeli <dodji@redhat.com>
235
236 PR c++/53609
237 * pt.c (argument_pack_element_is_expansion_p)
238 (make_argument_pack_select, use_pack_expansion_extra_args_p)
239 (gen_elem_of_pack_expansion_instantiation): New static functions.
240 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
241 look through the possibly resulting pack expansion as well.
242 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
243 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
244 Use gen_elem_of_pack_expansion_instantiation to build the
245 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
246 as gen_elem_of_pack_expansion_instantiation and the change in
247 tsubst above generalize this particular case.
248 (arg_from_parm_pack_p): Remove this for it's not used by
249 tsubst_pack_expansion anymore.
250
251 2013-01-21 Jason Merrill <jason@redhat.com>
252
253 PR c++/56059
254 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
255 template args count.
256
257 2013-01-18 Jason Merrill <jason@redhat.com>
258
259 PR target/54908
260 * decl2.c (get_local_tls_init_fn): New.
261 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
262 with aliases for internal variables. Don't use weakrefs if
263 the variable needs destruction.
264 (generate_tls_wrapper): Mark the wrapper as const if no
265 initialization is needed.
266 (handle_tls_init): Don't require aliases.
267
268 2013-01-15 Dodji Seketeli <dodji@redhat.com>
269
270 PR c++/55663
271 * pt.c (coerce_innermost_template_parms): New static function.
272 (instantiate_alias_template): Use it here.
273
274 2013-01-09 Jason Merrill <jason@redhat.com>
275
276 PR c++/55878
277 * rtti.c (build_typeid, get_typeid): Add complain parm.
278 (get_tinfo_decl_dynamic): Likewise.
279 * cp-tree.h, parser.c, pt.c: Adjust.
280
281 PR c++/55893
282 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
283 needs destruction.
284
285 2013-01-09 Jakub Jelinek <jakub@redhat.com>
286
287 PR c/48418
288 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
289 call maybe_constant_value for the negative or too big shift
290 count warnings.
291
292 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
293
294 PR c++/55801
295 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
296 of the argument is true.
297
298 2013-01-08 Joel Brobecker <brobecker@adacore.com>
299
300 * parser.c (cp_parser_initializer_list): Move declaration
301 of variable non_const to start of lexical block.
302
303 2013-01-07 Jason Merrill <jason@redhat.com>
304
305 PR c++/55753
306 * tree.c (build_aggr_init_expr): Do nothing in a template.
307 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
308 a FUNCTION_DECL before tsubsting.
309
310 2013-01-04 Dodji Seketeli <dodji@redhat.com>
311
312 PR c++/52343
313 * pt.c (check_instantiated_arg): Allow type template arguments.
314
315 2013-01-04 Jason Merrill <jason@redhat.com>
316
317 PR c++/55877
318 * decl.c (reset_type_linkage, bt_reset_linkage): New.
319 (grokdeclarator): Use reset_type_linkage.
320 * name-lookup.c (binding_table_foreach): Handle null table.
321 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
322
323 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
324
325 PR c++/54526 (again)
326 * parser.c (cp_parser_template_id): Revert core of previous change
327 (keep adjusted inform message).
328
329 2013-01-03 Jason Merrill <jason@redhat.com>
330
331 PR c++/55419
332 PR c++/55753
333 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
334 TREE_CONSTANT.
335
336 PR c++/55842
337 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
338
339 PR c++/55856
340 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
341
342 PR c++/53650
343 * call.c (type_has_extended_temps): New.
344 * cp-tree.h: Declare it.
345 * decl.c (check_initializer): Use build_aggr_init for arrays
346 if it is false.
347 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
348
349 2013-01-02 Jason Merrill <jason@redhat.com>
350
351 PR c++/54325
352 * call.c (build_new_method_call_1): Don't use build_value_init for
353 user-provided default constructors.
354
355 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
356
357 PR c++/55032
358 PR c++/55245
359 * tree.c (build_cplus_array_type): Copy layout information
360 to main variant if necessary.
361 \f
362 Copyright (C) 2013 Free Software Foundation, Inc.
363
364 Copying and distribution of this file, with or without modification,
365 are permitted in any medium without royalty provided the copyright
366 notice and this notice are preserved.