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