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