cp-tree.h (DECL_PARM_LEVEL): New.
[gcc.git] / gcc / cp / ChangeLog
1 2011-02-23 Jason Merrill <jason@redhat.com>
2
3 * cp-tree.h (DECL_PARM_LEVEL): New.
4 (struct lang_decl_parm): Add level field.
5 * name-lookup.c (function_parm_depth): New fn.
6 * name-lookup.h: Declare it.
7 * parser.c (cp_parser_parameter_declaration_list): Use it.
8 * mangle.c (struct globals): Add parm_depth field.
9 (write_bare_function_type): Adjust it.
10 (write_expression): Include the level delta in PARM_DECL mangling
11 for abi >= 6.
12
13 * semantics.c (finish_decltype_type): Remove shortcut for decltype
14 of id-expression.
15 * mangle.c (write_type) [DECLTYPE_TYPE]: Strip it here for abi < 6.
16
17 2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
18
19 PR c++/46868
20 * parser.c (cp_parser_class_specifier): Require a closing brace
21 to attempt error recovery.
22
23 2011-02-23 Jakub Jelinek <jakub@redhat.com>
24
25 PR c++/47833
26 * pt.c (struct pending_template): Add chain_next GTY option.
27 * decl.c (struct named_label_use_entry): Likewise.
28
29 2011-02-22 Paolo Carlini <paolo.carlini@oracle.com>
30
31 PR c++/47242
32 * semantics.c (build_lambda_object): Bail out if a field is
33 error_mark_node.
34
35 2011-02-22 Dodji Seketeli <dodji@redhat.com>
36
37 PR c++/47666
38 * class.c (dfs_declare_virt_assop_and_dtor)
39 (declare_virt_assop_and_dtor): New static functions.
40 (add_implicitly_declared_members): Use
41 declare_virt_assop_and_dtor.
42
43 2011-02-21 Jason Merrill <jason@redhat.com>
44
45 PR c++/47207
46 * decl2.c (decl_constant_var_p): A constexpr var needs an
47 initializer to be constant.
48 * semantics.c (cxx_eval_constant_expression): Complain about
49 constexpr var used in its own initializer.
50 * call.c (set_up_extended_ref_temp): Set
51 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P too.
52
53 2011-02-20 Jason Merrill <jason@redhat.com>
54
55 PR c++/47199
56 * semantics.c (cxx_eval_call_expression): Call
57 cxx_eval_constant_expression in trivial shortcut.
58
59 PR c++/46831
60 * call.c (convert_class_to_reference): Don't try to set up a
61 second conv sequence for non-viable candidates.
62
63 PR c++/47703
64 * error.c (location_of): Handle non-tagged types.
65
66 PR c++/46472
67 * method.c (process_subob_fn): Instantiate constexpr templates.
68 * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P.
69
70 2011-02-20 Dodji Seketeli <dodji@redhat.com>
71
72 PR c++/46394
73 * pt.c (tsubst_pack_expansion): do not use
74 cp_tree_equal/same_type_p to detect an expansion of a parameter
75 pack.
76
77 2011-02-19 Jason Merrill <jason@redhat.com>
78
79 PR c++/47503
80 * semantics.c (cxx_eval_call_expression): Shortcut trivial copy.
81
82 2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
83
84 PR c++/47795
85 * semantics.c (finish_non_static_data_member): Early return if
86 object is error_mark_node.
87
88 2011-02-18 Dodji Seketeli <dodji@redhat.com>
89
90 PR c++/47208
91 * pt.c (do_auto_deduction): Do not mention error_mark_node in
92 diagnostics.
93 * semantics.c (finish_id_expression): Do not pass erroneous decl
94 to decl_constant_var_p.
95
96 2011-02-17 Jakub Jelinek <jakub@redhat.com>
97
98 PR c++/47783
99 * cvt.c (convert_from_reference): Call mark_exp_read.
100
101 2011-02-11 Dodji Seketeli <dodji@redhat.com>
102
103 PR c++/47172
104 * pt.c (finish_call_expr): Consider a call expression that has a
105 dependent "this" pointer as being dependent. Add comments.
106 (dependent_type_p, type_dependent_expression_p): Update comments.
107
108 2011-02-16 Dodji Seketeli <dodji@redhat.com>
109
110 PR c++/47326
111 * pt.c (tsubst_copy)<case SIZEOF_EXPR>: Ensure that even pack
112 expansion arguments are not evaluated.
113
114 2011-02-16 Jakub Jelinek <jakub@redhat.com>
115
116 PR c++/47704
117 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5
118 instead of TYPE_LANG_FLAG_3.
119 * pt.c (lookup_template_class): Copy over
120 ENUM_FIXED_UNDERLYING_TYPE_P.
121
122 2011-02-15 Jason Merrill <jason@redhat.com>
123
124 PR c++/46807
125 * method.c (synthesized_method_walk): Always exit early for
126 trivial fn in C++98 mode.
127
128 2011-02-14 Jason Merrill <jason@redhat.com>
129
130 PR c++/47482
131 * parser.c (cp_parser_enumerator_definition): Call
132 fold_non_dependent_expr.
133
134 2011-02-09 Jason Merrill <jason@redhat.com>
135
136 * decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.
137 * semantics.c (finish_fname): Only return the name if we're in
138 a function.
139
140 * decl.c (build_enumerator): Don't perform integral promotions on
141 non-integral constants.
142
143 * cvt.c (convert_to_void): Handle null op1.
144
145 * class.c (type_has_constexpr_default_constructor): Make sure the
146 caller stripped an enclosing array.
147 * init.c (perform_member_init): Strip arrays before calling it.
148
149 PR c++/47511
150 * semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL.
151
152 2011-02-03 Dodji Seketeli <dodji@redhat.com>
153
154 PR c++/47398
155 * tree.c (cp_tree_equal)<TEMPLATE_PARM_INDEX>: Take the number of
156 template parameters in account.
157
158 2011-02-03 Nathan Froyd <froydnj@codesourcery.com>
159
160 PR c++/46890
161 * parser.c (cp_parser_class_specifier): Fix setting of
162 want_semicolon.
163
164 2011-01-31 Jakub Jelinek <jakub@redhat.com>
165
166 PR c++/47416
167 * semantics.c (build_data_member_initialization): Handle
168 STATEMENT_LIST always instead of just for CLEANUP_BODY.
169
170 2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
171
172 * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use
173 LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
174
175 2011-01-29 Dodji Seketeli <dodji@redhat.com>
176
177 PR c++/47311
178 * cp-tree.h (fixup_template_parms): Declare.
179 * pt.c (end_template_parm_list): Do not fixup template parms here.
180 (fixup_template_parms): Remove static. Fix typo in the
181 comments. Remove useless code statement.
182 (fixup_template_parm): For a template template parameter, fixup
183 its attributes before fixing up its type.
184 * parser.c
185 (cp_parser_template_declaration_after_export): After parsing
186 template parameters fixup their types.
187
188 2011-01-26 Jakub Jelinek <jakub@redhat.com>
189
190 PR c++/47476
191 * semantics.c (potential_constant_expression_1): Handle
192 TRUTH_XOR_EXPR.
193
194 2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
195
196 PR c++/43601
197 * semantics.c (expand_or_defer_fn_1): Handle it.
198 * decl2.c (decl_needed_p): Likewise.
199
200 2011-01-21 Jason Merrill <jason@redhat.com>
201
202 PR c++/47041
203 * semantics.c (build_constexpr_constructor_member_initializers):
204 Handle trivial copy.
205
206 2011-01-21 Jakub Jelinek <jakub@redhat.com>
207
208 PR c++/47388
209 * semantics.c (begin_for_stmt): If -fno-for-scope, don't
210 assume init must be NULL if scope is NULL.
211 (begin_range_for_stmt): Likewise.
212
213 2011-01-21 Jason Merrill <jason@redhat.com>
214
215 PR c++/46552
216 * semantics.c (cxx_eval_constant_expression): Handle OFFSET_REF.
217
218 PR c++/46977
219 * semantics.c (potential_constant_expression_1): Split out from
220 potential_constant_expression. Add want_rval parm. Handle
221 template expression forms. Don't enforce restriction on address
222 of automatic variable here. Add a couple of diagnostics that
223 had been missing.
224 (require_potential_constant_expression): New entry point.
225 (build_data_member_initialization, register_constexpr_fundef): Adjust.
226 (maybe_constant_value): Check potential_constant_expression.
227 * pt.c (fold_non_dependent_expr_sfinae): Likewise.
228 * tree.c (build_vec_init_expr): Adjust.
229
230 2011-01-19 Jakub Jelinek <jakub@redhat.com>
231
232 PR c++/47303
233 * decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC
234 or DECL_EXTERNAL.
235
236 2011-01-17 Jason Merrill <jason@redhat.com>
237
238 PR c++/47067
239 * semantics.c (base_field_constructor_elt): New fn.
240 (cxx_eval_bare_aggregate): Use it.
241 (build_data_member_initialization): Leave COMPONENT_REF for
242 vfield inits.
243
244 2011-01-14 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
245
246 * parser.c (cp_parser_range_for): Remove the "unused variable" warning
247 workaround.
248
249 2011-01-15 Giovanni Funchal <gafunchal@gmail.com>
250 Jonathan Wakely <jwakely.gcc@gmail.com>
251
252 PR c++/33558
253 * decl.c (grokdeclarator): Reject mutable reference members.
254
255 2011-01-14 Jason Merrill <jason@redhat.com>
256
257 PR c++/47289
258 * pt.c (coerce_template_parms): Fix error recovery.
259
260 PR c++/46903
261 * typeck2.c (check_narrowing): Only check arithmetic types.
262
263 PR c++/46688
264 * tree.c (build_vec_init_expr): Handle flexible array
265 properly.
266
267 2011-01-13 Kai Tietz <kai.tietz@onevision.com>
268
269 PR c++/47213
270 * cp-tree.h (CLASSTYPE_VISIBILITY): Use
271 TYPE_MAIN_DECL instead of TYPE_NAME.
272 (CLASSTYPE_VISIBILITY_SPECIFIED): Likewise.
273 * decl2.c (determine_visibility): Add check
274 of CLASS_TYPE_P for underlying_type.
275
276 2011-01-12 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
277
278 * cp-tree.h (begin_for_scope): New prototype.
279 (begin_for_stmt): Update prototype.
280 (begin_range_for_stmt): Update prototype.
281 * init.c (build_vec_init): Update call to begin_for_stmt.
282 * parser.c (cp_parser_for): New.
283 (cp_parser_c_for): Add three new parameters.
284 (cp_parser_range_for): Likewise. Most parsing code removed.
285 (cp_parser_iteration_statement): Call cp_parser_for instead of
286 cp_parser_c_for and cp_parser_range_for.
287 (cp_parser_for_init_statement): Add new parameter and return type.
288 (cp_parser_block_declaration): Update call to
289 cp_parser_simple_declaration.
290 (cp_parser_simple_declaration): Add new parameter.
291 Update call to cp_parser_init_declarator.
292 (cp_parser_init_declarator): Add new parameter.
293 * pt.c (tsubst_expr): Update call to begin_for_stmt.
294 * semantics.c (begin_for_scope): New.
295 (begin_for_stmt): Add two new parameters.
296 (begin_range_for_stmt): Likewise.
297
298 2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
299
300 * parser.c (cp_parser_objc_at_property_declaration): Improved
301 error message.
302
303 2011-01-11 Dodji Seketeli <dodji@redhat.com>
304
305 PR debug/46955
306 * cp-lang.c (get_template_innermost_arguments_folded)
307 (get_template_argument_pack_elems_folded)
308 (template_arg_needs_folding, fold_cplus_constants): New static
309 functions.
310 (LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS): Set this hook to
311 get_template_innermost_arguments_folded.
312 (LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS): Set this hook to
313 get_template_argument_pack_elems_folded.
314
315 2011-01-11 Jason Merrill <jason@redhat.com>
316
317 PR c++/46658
318 * init.c (build_new_1): Handle value-init in templates differently.
319
320 PR c++/45520
321 * tree.c (maybe_dummy_object): Check current_class_ref against
322 context, not current_class_type.
323
324 2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com>
325
326 PR objc/47078
327 * parser.c (cp_parser_objc_typename): If the type is unknown, for
328 error recovery purposes behave as if it was not specified so that
329 the default type is used.
330
331 2011-01-07 Jakub Jelinek <jakub@redhat.com>
332
333 PR c++/47022
334 * pt.c (tsubst_copy_and_build): Use tsubst instead of tsubst_copy
335 for the second build_x_va_arg argument.
336
337 2011-01-05 Tom Tromey <tromey@redhat.com>
338
339 * typeck.c (cp_build_addr_expr_1): Update call to lvalue_error.
340 (lvalue_or_else): Likewise.
341
342 2011-01-01 Kai Tietz <kai.tietz@onevision.com>
343
344 PR target/38662
345 * tree.c (cxx_type_hash_eq):
346 Allow METHOD_TYPE, too.
347
348 \f
349 Copyright (C) 2011 Free Software Foundation, Inc.
350
351 Copying and distribution of this file, with or without modification,
352 are permitted in any medium without royalty provided the copyright
353 notice and this notice are preserved.