]> gcc.gnu.org Git - gcc.git/blame - gcc/cp/ChangeLog
Implement defaulted/deleted functions as per N2346
[gcc.git] / gcc / cp / ChangeLog
CommitLineData
b87d79e6
JM
12008-07-23 Jason Merrill <jason@redhat.com>
2
3 Implement defaulted/deleted functions as per N2346
4 * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
5 (DECL_DELETED_FN): New macro.
6 (DECL_DEFAULTED_FN): New macro.
7 * class.c (user_provided_p): New fn.
8 (defaultable_fn_p): New fn.
9 (type_has_user_provided_constructor): New fn.
10 (type_has_user_provided_default_constructor): New fn.
11 (check_methods): A defaulted fn is still trivial.
12 (check_bases_and_members): Likewise.
13 * decl.c (grok_special_member_properties): Likewise.
14 (duplicate_decls): Complain about redeclaring a function as deleted.
15 (start_decl): initialized==2 means deleted.
16 (cp_finish_decl): Handle deleted/defaulted semantics.
17 * decl2.c (grokfield): Likewise.
18 (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
19 Complain about using a deleted fn.
20 * init.c (build_value_init_1): Use type_has_user_provided_constructor.
21 (perform_member_init): Check for a user-provided default constructor
22 even if TYPE_NEEDS_CONSTRUCTING.
23 (build_new_1): Likewise.
24 * call.c (build_over_call): Don't call mark_used twice.
25 * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
26 * search.c (check_final_overrider): Check for deleted mismatch.
27 * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
28 (cp_parser_pure_specifier): Handle =default and =delete.
29
30 * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
31
fcf73884
MLI
322008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
33
34 PR 35058
35 * typeck.c: All calls to pedwarn changed.
36 * decl.c: All calls to pedwarn changed.
37 * call.c: All calls to pedwarn changed.
38 * error.c: All calls to pedwarn changed.
39 * typeck2.c: All calls to pedwarn changed.
40 * pt.c: All calls to pedwarn changed.
41 * name-lookup.c: All calls to pedwarn changed.
42 * parser.c: All calls to pedwarn changed.
43
39a13be5
RW
442008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
45
46 * call.c: Fix comment typos.
47 * class.c: Likewise.
48 * cp-tree.h: Likewise.
49 * cxx-pretty-print.c: Likewise.
50 * decl.c: Likewise.
51 * init.c: Likewise.
52 * name-lookup.c: Likewise.
53 * operators.def: Likewise.
54 * parser.c: Likewise.
55 * pt.c: Likewise.
56 * tree.c: Likewise.
57 * typeck.c: Likewise.
58
279086c3
PC
592008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
60
61 PR c++/36871
62 PR c++/36872
63 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
64 copy constructors and copy assignment operators proper.
65
099735e9 662008-07-21 Rafael Avila de Espindola <espindola@google.com>
aa14403d
RAE
67
68 * parser.c (cp_token): Remove in_system_header.
69 (eof_token): Remove in_system_header.
70 (cp_lexer_get_preprocessor_token): Don't set in_system_header.
71 (cp_lexer_set_source_position_from_token): Don't set in_system_header.
72 (cp_parser_member_declaration): Use in_system_header_at.
73 * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
74 (pop_tinst_level): Don't set in_system_header.
75 (instantiate_class_template): Don't set in_system_header.
76 (instantiate_decl): Don't set in_system_header.
77 (instantiate_pending_templates): Don't set in_system_header.
78
e24313f3
PC
792008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
80
81 PR c++/36870
82 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
83 TYPE_NOTHROW_P, not TREE_NOTHROW.
84 (trait_expr_value): Likewise.
85
6b3a665c
DS
862008-07-18 Dodji Seketeli <dseketel@redhat.com>
87
88 PR c++/36407
89 * call.c (convert_like_real): Don't take the error code path
90 when a rvalue or base conversion has the bad_p field set.
91
c466b2cd
KVH
922008-07-18 Kris Van Hees <kris.van.hees@oracle.com>
93
94 * rtti.c (emit_support_tinfos): Add char16_type_node and
95 char32_type_node.
96 * typeck2.c (digest_init): Support char16_t and char32_t.
97
982008-07-18 Kavih R. Ghazi <ghazi@caip.rutgers.edu>
be93747e
KG
99
100 * cvt.c (convert_to_void): Avoid C++ keywords.
101 * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
102 Likewise.
103 * friend.c (is_friend): Likewise.
104 * init.c (perform_member_init): Likewise.
105 * mangle.c (write_template_prefix, write_template_template_param):
106 Likewise.
107 * name-lookup.c (do_namespace_alias, do_using_directive,
108 parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
109 * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
110 cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
111 Likewise.
112 * pt.c (is_specialization_of_friend, lookup_template_class,
113 push_tinst_level, instantiate_class_template,
114 tsubst_copy_and_build): Likewise.
115 * tree.c (add_stmt_to_compound): Likewise.
116 * typeck.c (finish_class_member_access_expr): Likewise.
117
711b2998
JB
1182008-07-17 Julian Brown <julian@codesourcery.com>
119 Mark Mitchell <mark@codesourcery.com>
120
121 * decl2.c (determine_visibility): Allow target to override
122 visibility of class data.
123
afb86620
PC
1242008-07-17 Paolo Carlini <paolo.carlini@oracle.com>
125
126 PR c++/36855
127 * semantics.c (trait_expr_value): Update __has_trivial_destructor
128 semantics to the current WP (N2691).
129
ecba6c56
DS
1302008-07-16 Dodji Seketeli <dseketel@redhat.com>
131
132 PR c++/13699
afb86620 133 * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
ecba6c56
DS
134 (pushdecl_maybe_friend): Check if a redeclaration of extern C function
135 complies with exception specification constraints.
136
7ce841d2
JM
1372008-07-14 Jason Merrill <jason@redhat.com>
138
139 * lex.c (init_reswords): Always set D_OBJC.
140
eea1139b
ILT
1412008-07-11 Tom Tromey <tromey@redhat.com>
142 Ian Lance Taylor <iant@google.com>
143
144 * lex.c (struct resword, reswords): Don't define.
145 (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
146 (init_reswords): Clarify mask code. Use c_common_reswords rather
147 than reswords.
148
94eeabbe
DS
1492008-07-11 Dodji Seketeli <dseketel@redhat.com>
150
151 PR c++/13101
152 * decl.c (grokdeclarator): Warn about initializing variables
afb86620
PC
153 of storage class 'extern' only after the type of the declarator
154 has been properly computed.
94eeabbe 155
760b18ad
DS
1562008-07-11 Dodji Seketeli <dseketel@redhat.com>
157
158 PR c++/31754
c466b2cd 159 * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
760b18ad 160 carries the location of the primary type.
c466b2cd 161 * parser.c (cp_parser_check_type_definition): Update documentation.
760b18ad
DS
162 (cp_parser_check_for_definition_in_return_type,
163 cp_parser_check_for_invalid_template_id,
164 cp_parser_set_decl_spec_type,
165 cp_parser_check_for_definition_in_return_type,
166 cp_parser_diagnose_invalid_type_name,
167 cp_parser_new_expression, cp_parser_explicit_instantiation,
168 cp_parser_type_specifier, cp_parser_simple_type_specifier,
c466b2cd
KVH
169 cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
170 messages.
94eeabbe
DS
171
1722008-07-11 Dodji Seketeli <dseketel@redhat.com>
2b7a3abf
DS
173
174 PR c++/31754
175 * pt.c, semantic.c:
176 * semantic.c (qualified_name_lookup_error, finish_id_expression):
c466b2cd 177 Add a location_t parameter so that
2b7a3abf 178 error message can have a more accurate location.
c466b2cd
KVH
179 * cp-tree.h: Updated prototype
180 * pt.c (tsubst_qualified_id): Use location in error messages.
2b7a3abf
DS
181 * parser.c (cp_parser_postfix_expression,
182 cp_parser_objc_statement, cp_parser_trait_expr,
183 cp_parser_token_is_class_key,
184 cp_parser_uncommitted_to_tentative_parse_p,
185 cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
186 cp_parser_error, cp_parser_name_lookup_error,
187 cp_parser_simulate_error, cp_parser_check_decl_spec,
188 cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
189 cp_parser_diagnose_invalid_type_name,
190 cp_parser_parse_and_diagnose_invalid_type_name,
191 cp_parser_require_pragma_eol, cp_parser_make_typename_type,
192 cp_parser_string_literal, cp_parser_primary_expression,
193 cp_parser_primary_expression, cp_parser_unqualified_id,
194 cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
195 cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
196 cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
197 cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
198 cp_parser_jump_statement, cp_parser_block_declaration,
199 cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
200 cp_parser_function_specifier_opt, cp_parser_decltype,
201 cp_parser_mem_initializer_list, cp_parser_mem_initializer,
202 cp_parser_mem_initializer_id, cp_parser_template_parameter,
c466b2cd
KVH
203 cp_parser_type_parameter, cp_parser_template_id,
204 cp_parser_template_name, cp_parser_template_argument): Likewise.
2b7a3abf 205
3d7c63cf
PC
2062008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
207
208 PR c++/36760
209 * pt.c (tsubst_function_type): Remove warning for type qualifiers
210 on function return type.
211
af5216d3
PC
2122008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
213
214 PR c++/36760
215 * pt.c (tsubst_function_type): Don't warn for type qualifiers
216 on function return type in case of system header.
217
1ebc7e68
RA
2182008-07-09 Raksit Ashok <raksit@google.com>
219
220 * parser.c (cp_parser_postfix_expression): New warning based on flag
221 warn_disallowed_functions.
222
ff7437d0
SM
2232008-07-08 Simon Martin <simartin@users.sourceforge.net>
224
225 PR c++/34963
226 * decl.c (grokdeclarator): Reset storage_class and staticp for friend
227 functions declared with a storage class qualifier.
228
1466cf1a
RG
2292008-07-03 Richard Guenther <rguenther@suse.de>
230
231 PR c++/36128
232 * typeck.c (cp_build_function_call): Move code to verify
233 builtin function arguments ...
234 * call.c (build_cxx_call): ... here.
235
09357846
JM
2362008-07-02 Jason Merrill <jason@redhat.com>
237
6010fae7
JM
238 * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
239
09357846
JM
240 Implement WG21 N2672, Initializer List proposed wording
241 * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
242 (struct lang_type_class): Add has_list_ctor bitfield.
243 (TYPE_HAS_LIST_CTOR): New macro.
244 (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
245 (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
246 (LOOKUP_NO_NARROWING): New macro.
247 (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
248 * parser.c (cp_parse_braced_list): Split out from...
249 (cp_parser_initializer_clause): ...here.
250 (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
251 literal here.
252 (cp_lexer_next_token_is_not_keyword): New fn.
253 (cp_parser_parenthesized_expression_list): Handle { }.
254 (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
255 (cp_parser_assignment_expression, cp_parser_condition): Likewise.
256 (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
257 (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
258 (cp_parser_initializer, cp_parser_functional_cast): Likewise.
259 (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
260 (cp_parser_save_member_function_body): Likewise.
261 * call.c (conversion_kind): Add ck_list, ck_aggr.
262 (struct conversion): Add check_narrowing bitfield, conversion list.
263 (build_list_conv): New fn.
264 (build_aggr_conv): New fn.
265 (implicit_conversion): Call them.
266 (standard_conversion): Set check_narrowing if appropriate.
267 (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
268 (build_user_type_conversion_1): When converting from an init list,
269 we allow additional conversions except when calling a copy ctor.
270 (convert_like_real): Calling an explicit ctor for an init list is
271 ill-formed. Handle ck_list and ck_addr. Check narrowing.
272 (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
273 class doesn't have a list ctor, break the {} into a TREE_LIST.
274 (compare_ics): ck_list is better than other UDCs.
275 (set_up_extended_ref_temp): Split out from initialize_reference.
276 (is_std_init_list): New fn.
277 (is_list_ctor): New fn.
278 * decl.c (cxx_init_decl_processing): Create init_list_type_node.
279 (reshape_init_array_1): Pass it to build_constructor.
280 (reshape_init_class): Ditto.
281 (initialize_artificial_var): Pass the appropriate type.
282 (build_aggr_init_full_exprs): Split out from...
283 (check_initializer): ...here. Handle new semantics.
284 (build_init_list_var_init): New subroutine of check_initializer.
285 (grokdeclarator): Converting constructors can have more than one parm.
286 (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
287 * init.c (expand_default_init): Only do digest_init for aggregates.
288 * rtti.c (tinfo_base_init): Pass init_list_type_node to
289 build_constructor_from_list.
290 (generic_initializer, ptr_initializer): Ditto.
291 (ptm_initializer, class_initializer): Ditto.
292 (get_pseudo_ti_init): Ditto.
293 * error.c (dump_type): Handle init_list_type_node.
294 (maybe_warn_cpp0x): New fn.
295 (maybe_varn_variadic_templates): Call it.
296 * cvt.c (ocp_convert): Handle conversion from { }.
297 * tree.c (build_array_of_n_type): New fn.
298 * typeck2.c (store_init_value): Use init_list_type_node.
299 (digest_init): Likewise.
300 (check_narrowing): New fn.
301 * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
302 of vector of constructor elts. Handle non-aggregate types. Make
303 constant literals static.
304 * pt.c: (tsubst_copy_and_build): Adjust.
305 (unify): Handle { }.
306 * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
94eeabbe 307
f83c7f63
DJ
3082008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
309
310 * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
311 (comp_ptr_ttypes_const): Likewise.
312
298b7d2b
AH
3132008-07-01 Andrew Haley <aph@redhat.com>
314
315 * decl.c (finish_constructor_body): Don't set the return value of
316 the constructor if the constructor is that of a Java type.
317
55b3fc29
JJ
3182008-06-30 Jakub Jelinek <jakub@redhat.com>
319
320 PR c++/36662
321 * decl2.c (is_late_template_attribute): If the first attribute
322 argument is IDENTIFIER_NODE, don't consider it when checking
323 if arguments are value or type dependent.
324
1ffe7b6e
PC
3252008-06-29 Paolo Carlini <paolo.carlini@oracle.com>
326
327 PR c++/36655
328 * pt.c (do_type_instantiation): In c++0x mode do not warn for
329 extern template.
330
572e5ae3
KG
3312008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
332
333 * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
334
0ac69b47
JJ
3352008-06-28 Jakub Jelinek <jakub@redhat.com>
336
337 PR c++/36364
338 * repo.c (repo_emit_p): Put const static data members initialized
339 by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
340 for it is 0.
341
a7235bfb
PC
3422008-06-27 Paolo Carlini <paolo.carlini@oracle.com>
343
344 PR c++/36655
345 * pt.c (do_decl_instantiation): In c++0x mode do not warn for
346 extern template.
347
7b98a725
JW
3482008-06-24 Jonathan Wakely <jwakely.gcc@gmail.com>
349
350 PR c++/23194
351 * typeck.c (cp_build_function_call): Show example syntax in
352 diagnostic.
353
37ec60ed
JW
3542008-06-21 Jonathan Wakely <jwakely.gcc@gmail.com>
355
356 * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
357 cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
358 pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
359 build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
360 pedwarn to permerror.
361 * init.c (perform_member_init, build_new_1, build_new): Likewise.
362 * decl.c (warn_extern_redeclared_static, duplicate_decls,
363 * identify_goto, check_previous_goto_1, check_goto, define_label,
364 check_tag_decl, start_decl, check_class_member_definition_namespace,
365 grokfndecl, grokdeclarator): Likewise.
366 * except.c (check_handlers): Likewise.
367 * typeck2.c (digest_init): Likewise.
368 * pt.c (check_specialization_namespace,
369 check_explicit_instantiation_namespace,
370 maybe_process_partial_specialization, check_explicit_specialization,
371 convert_template_argument, do_decl_instantiation,
372 do_type_instantiation, instantiate_decl): Likewise.
373 * semantics.c (finish_template_type_parm): Likewise.
374 * name-lookup.c (pushdecl_maybe_friend,
375 check_for_out_of_scope_variable): Likewise.
376 * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
377 coerce_new_type): Likewise.
378 * parser.c (cp_parser_nested_name_specifier_opt,
379 cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
380 cp_parser_class_head, cp_parser_check_class_key): Likewise.
381 (cp_parser_parameter_declaration): Check flag_permissive instead of
382 flag_pedantic_errors.
383 * call.c (joust): Change pedwarn to warning.
384 * friend.c (make_friend_class): Likewise.
385
ff2c88a5
JH
3862008-06-16 Jan Hubicka <jh@suse.cz>
387
388 * method.c: Include cgraph.h.
389 (use_thunk): Use cgraph_add_new_function instead of calling backend
390 directly.
391
1cbc62c0
RW
3922008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
393
394 * parser.c: Fix comment typo.
395
a6d9bc9d
SM
3962008-06-14 Simon Martin <simartin@users.sourceforge.net>
397
398 PR c++/35320
399 * decl2.c (grokbitfield): Receive the list of attributes, pass it to
400 grokdeclarator and apply it to the created declaration.
401 * cp-tree.h (grokbitfield): Update prototype.
402 * parser.c (cp_parser_member_declaration): Don't apply the attributes
403 since they are now applied in grokbitfield. Adjusted the call to
404 grokbitfield.
405 (cp_parser_objc_class_ivars): Likewise.
406
4b8cb94c
SM
4072008-06-14 Simon Martin <simartin@users.sourceforge.net>
408
409 PR c++/35317
410 * class.c (type_requires_array_cookie): Do not consider delete[]
411 operators with an ellipsis as second argument.
412
9de0e916
JJ
4132008-06-09 Jakub Jelinek <jakub@redhat.com>
414
415 PR c++/36408
416 * semantics.c (stmt_expr_value_expr): Don't crash on empty
417 STATEMENT_LIST.
418
c5285718
PC
4192008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
420
421 PR c++/35242
422 * pt.c (maybe_process_partial_specialization): Check the tree
423 returned by push_template_decl for error_mark_node.
424 * parser.c (cp_parser_class_head): Likewise, check the tree
425 returned by the latter.
426
e3276457
PC
4272008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
428
429 PR c++/35327
430 * decl.c (grokdeclarator): In case of wrong return type return
431 immediately error_mark_node.
432
a68ab351
JJ
4332008-06-06 Jakub Jelinek <jakub@redhat.com>
434
435 * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
436 dependent_omp_for_p, begin_omp_task, finish_omp_task,
437 finish_omp_taskwait): New prototypes.
438 (cxx_omp_clause_default_ctor): Add outer argument.
439 (finish_omp_for): Add new clauses argument.
440 * cp-gimplify.c (cxx_omp_finish_clause): New function.
441 (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
442 (cxx_omp_clause_default_ctor): Add outer argument.
443 (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
444 * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
445 * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
446 Add par_clauses argument. If decl is present in parallel's
447 lastprivate clause, change that clause to shared and add
448 a lastprivate clause for decl to OMP_FOR_CLAUSES.
449 Fix wording of error messages. Adjust finish_omp_for caller.
450 Add clauses argument. Parse loops with random access iterators.
451 (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
452 functions.
453 (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
454 cp_parser_omp_for_loop callers.
455 (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
456 functions.
457 (cp_parser_omp_clause_name): Handle collapse and untied
458 clauses.
459 (cp_parser_omp_clause_schedule): Handle auto schedule.
460 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
461 and PRAGMA_OMP_CLAUSE_UNTIED.
462 (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
463 (OMP_TASK_CLAUSE_MASK): Define.
464 (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
465 (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
466 (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
467 PRAGMA_OMP_TASKWAIT.
468 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
469 OMP_CLAUSE_UNTIED. Handle OMP_CLAUSE_LASTPRIVATE_STMT.
470 (tsubst_omp_for_iterator): New function.
471 (dependent_omp_for_p): New function.
472 (tsubst_expr) <case OMP_FOR>: Use it. Handle collapsed OMP_FOR
473 loops. Adjust finish_omp_for caller. Handle loops with random
474 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes.
475 (tsubst_expr): Handle OMP_TASK.
476 * semantics.c (cxx_omp_create_clause_info): New function.
477 (finish_omp_clauses): Call it. Handle OMP_CLAUSE_UNTIED and
478 OMP_CLAUSE_COLLAPSE.
479 (cxx_omp_predetermined_sharing): Removed.
480 * semantics.c (finish_omp_for): Allow pointer iterators. Use
481 handle_omp_for_class_iterator and dependent_omp_for_p. Handle
482 collapsed for loops. Adjust c_finish_omp_for caller. Add new
483 clauses argument. Fix check for type dependent cond or incr.
484 Set OMP_FOR_CLAUSES to clauses. Use cp_convert instead of
485 fold_convert to convert incr amount to difference_type. Only
486 fold if not in template. If decl is mentioned in lastprivate
487 clause, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle loops with random
488 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR}
489 changes.
490 (finish_omp_threadprivate): Allow static class members of the
491 current class.
492 (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
493 finish_omp_taskwait): New functions.
494
495 * parser.c (cp_parser_binary_expression): Add prec argument.
496 (cp_parser_assignment_expression): Adjust caller.
497 * cp-tree.h (outer_curly_brace_block): New prototype.
498 * decl.c (outer_curly_brace_block): No longer static.
499
80d7287f
PC
5002008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
501
502 PR c++/36404
503 * pt.c (push_template_decl_real): Consistently return error_mark_node
504 on error.
505
5f9e56b3
TB
5062008-06-02 Tomas Bily <tbily@suse.cz>
507
508 * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
509 (cp_build_unary_op): Likewise.
510 (cp_build_indirect_ref): Use CONVERT_EXPR_P.
511 (maybe_warn_about_returning_address_of_local): Likewise.
512
aecaad79
PC
5132008-05-29 Paolo Carlini <paolo.carlini@oracle.com>
514
515 PR c++/35243
516 * pt.c (tsubst_initializer_list): Consistently check the tree
517 returned by tsubst_pack_expansion for error_mark_node.
518
a3299096
MM
5192008-05-27 Michael Matz <matz@suse.de>
520
521 PR c++/27975
522 * call.c (build_new_op): Make warning conditional on
523 OPT_Wenum_compare.
524
bced8304
AO
5252008-05-27 Alexandre Oliva <aoliva@redhat.com>
526
527 PR c++/35909
528 * call.c (convert_like_real): Convert bitfield to desired type
529 before creating temporary.
530
670637ee
DF
5312008-05-26 Daniel Franke <franke.daniel@gmail.com>
532
533 * Makefile.in: Adjusted dependencies on c-incpath.o.
534
7a0112e7
JJ
5352008-05-23 Jakub Jelinek <jakub@redhat.com>
536
c2898ec9
JJ
537 PR c++/36237
538 * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
539 fold_build_cleanup_point_expr on build_call_a results.
540
7a0112e7
JJ
541 PR c++/36308
542 * semantics.c (omp_clause_info_fndecl): New function.
543 (finish_omp_clauses): Use it.
544
bac46fb6
JJ
5452008-05-21 Jakub Jelinek <jakub@redhat.com>
546
547 PR c++/36023
548 * cp-tree.h (check_array_initializer): New prototype.
549 * decl.c (check_array_initializer): New function.
550 (check_initializer): Call it.
551 * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
552
dae4174e
TT
5532008-05-21 Tom Tromey <tromey@redhat.com>
554
555 * mangle.c (save_partially_mangled_name): Remove.
556 (restore_partially_mangled_name): Likewise.
557 (write_encoding): Update.
558 (write_unqualified_name): Likewise.
559 (start_mangling): Always use name_obstack. Remove 'ident_p'
560 argument.
561 (get_identifier_nocopy): Remove.
562 (finish_mangling_internal): Rename from finish_mangling.
563 (finish_mangling): New function.
564 (finish_mangling_get_identifier): Likewise.
565 (partially_mangled_name, partially_mangled_name_len): Remove.
566 (mangle_decl_string): Change return type. Update.
567 (mangle_decl, mangle_type_string, mangle_special_for_type,
568 mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
569 mangle_ref_init_variable): Update.
570
7d2f0ecd
PC
5712008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
572
573 PR c++/35331
574 * semantics.c (begin_class_definition): Extend checks on the first
575 argument.
576
63a906f0
TB
5772008-05-12 Tomas Bily <tbily@suse.cz>
578
579 * typeck2.c (digest_init): Use CONVERT_EXPR_P.
580 * call.c (build_over_call): Likewise.
581 * error.c (dump_expr): Use CASE_CONVERT.
582 * class.c (fixed_type_or_null): Likewise.
583
8ffb4ce0 5842008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
becfd6e5 585
8ffb4ce0
VR
586 * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
587 in error message.
588 (cp_parser_omp_clause_schedule): Remove superfluous "expected"
589 in error message.
becfd6e5 590
8ffb4ce0 5912008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
becfd6e5 592
8ffb4ce0
VR
593 * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
594 DECL_LOOPING_CONST_OR_PURE_P attributes.
595 * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
596 DECL_PURE_P.
597
5982008-05-02 Simon Baldwin <simonb@google.com>
e4d35515
SB
599
600 PR bootstrap/36108
601 * typeck.c (build_array_ref): Remove warn_array_subscript_range.
602
8ffb4ce0 6032008-05-01 Simon Baldwin <simonb@google.com>
ca873b0e
SB
604
605 * typeck.c (build_array_ref): Call warn_array_subscript_range.
606
56b1a554
JJ
6072008-04-30 Jakub Jelinek <jakub@redhat.com>
608
609 PR c++/35986
610 * pt.c (more_specialized_fn): Stop the loop even if there are no
611 arguments before ellipsis.
612
f2be060f
JJ
6132008-04-29 Jakub Jelinek <jakub@redhat.com>
614
58627576
JJ
615 PR c++/35650
616 * parser.c (cp_parser_lookup_name): Look through single function
617 OVERLOAD.
618
f2be060f
JJ
619 PR c++/35987
620 * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
621 COMPOUND_EXPR if the second argument would be error_mark_node.
622
bda37952
JM
6232008-04-28 Jason Merrill <jason@redhat.com>
624 Liu Guanwei <liu_gw@163.com>
625
626 PR c++/57
627 * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
628 in default arguments.
629
e3b5732b
JH
6302008-04-25 Jan Hubicka <jh@suse.cz>
631
632 * typeck.c (check_return_expr): Update.
633 * decl.c (start_preparsed_function): Update.
634 * method.c (use_thunk): Update.
635
5dc11954
JJ
6362008-04-24 Jakub Jelinek <jakub@redhat.com>
637
638 PR c++/35758
639 * cp-tree.h (cp_reconstruct_complex_type): New prototype.
640 * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
641 * decl2.c (is_late_template_attribute): Only make vector_size
642 late tmpl attribute if argument is type or value dependent.
643 (cp_reconstruct_complex_type): New function.
644
83322951
RG
6452008-04-24 Richard Guenther <rguenther@suse.de>
646
647 * typeck.c (cp_build_function_call): Call
648 check_builtin_function_arguments.
649
51eed280
PB
6502008-04-23 Paolo Bonzini <bonzini@gnu.org>
651
652 * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
653 (build_ptrmemfunc1): Don't set TREE_INVARIANT.
654 * init.c (build_zero_init): Don't set TREE_INVARIANT.
655 * class.c (build_base_path): Don't set TREE_INVARIANT.
656 (build_vtbl_ref_1): Don't set TREE_INVARIANT.
657 (build_vtbl_initializer): Don't set TREE_INVARIANT.
658 * decl.c (build_enumerator): Don't set TREE_INVARIANT.
659 * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
660 (generic_initializer): Don't set TREE_INVARIANT.
661 (ptr_initializer): Don't set TREE_INVARIANT.
662 (ptm_initializer): Don't set TREE_INVARIANT.
663 (class_initializer): Don't set TREE_INVARIANT.
664 * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
665 * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
666 (build_template_parm_index): Don't set TREE_INVARIANT.
667 (reduce_template_parm_level): Don't set TREE_INVARIANT.
668 (process_template_parm): Don't set TREE_INVARIANT.
669
e76d7cc7
JM
6702008-04-22 Jason Merrill <jason@redhat.com>
671
672 PR c++/35316
673 * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
674 to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
675 * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
676
d7b5fa31
JJ
6772008-04-22 Jakub Jelinek <jakub@redhat.com>
678
679 PR c++/35747
680 * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
681 expression is errorneous.
682
ee34d21a
JM
6832008-04-21 Jason Merrill <jason@redhat.com>
684
d05739f8
JM
685 PR c++/35325
686 * tree.c (cp_tree_equal): Handle FIXED_CST.
687
ee34d21a
JM
688 PR c++/35678
689 * pt.c (template_template_parm_bindings_ok_p): Set
690 processing_template_decl while in this function.
691
b6baa67d
KVH
6922008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
693
694 * cvt.c (type_promotes_to): Support char16_t and char32_t.
695 * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
696 char16_t and char32_t.
697 * lex.c (reswords): Add char16_t and char32_t (for c++0x).
698 * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
699 extended builtin type "u8char{16,32}_t".
700 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
701 RID_CHAR{16,32}.
702 (cp_lexer_print_token): Support CPP_STRING{16,32}.
703 (cp_parser_is_string_literal): Idem.
704 (cp_parser_string_literal): Idem.
705 (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
706 CPP_STRING{16,32}.
707 (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
708 * tree.c (char_type_p): Support char16_t and char32_t as char types.
709 * typeck.c (string_conv_p): Support char16_t and char32_t.
710
46225e26
JM
7112008-04-17 Jason Merrill <jason@redhat.com>
712
713 PR c++/35773
714 * call.c (build_user_type_conversion_1): Represent second step of
715 copy-init with an rvalue conversion.
716 (convert_like_real) [ck_user]: Don't implicitly add it here.
717
b97d8153
JJ
7182008-04-15 Jakub Jelinek <jakub@redhat.com>
719
720 PR c/35751
721 * decl.c (layout_var_decl): If extern or static var has variable
722 size, set TREE_TYPE (decl) to error_mark_node.
723
39e6670f
DS
7242008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
725
726 PR target/35921
727 * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
728 to clone.
729
df794884
JM
7302008-04-09 Jason Merrill <jason@redhat.com>
731
732 PR c++/35708
733 * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
734 not a pushed variable.
735
de21c145
VR
7362008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
737
bcac2b89
VR
738 * call.c (build_op_delete_call): Fix quotation in warning message.
739 * decl.c (grokdeclarator): Quote keyword in error message.
740 * pt.c (check_for_bare_parameter_packs): Fix quotation in error
741 message.
742
8b4efb4e
VR
743 * parser.c (cp_parser_check_type_definition): Print error string
744 directly rather than using "%s".
745 (cp_parser_postfix_expression): Fix quotation.
746 (cp_parser_decltype): Likewise.
747 (cp_parser_sizeof_operand): Fix quotation. Simplify.
748
2a97bf74
VR
749 * parser.c (cp_parser_non_integral_constant_expression): Build error
750 message with CONCAT rather than using "%s".
751 (cp_parser_primary_expression): Fix quotation.
752 (cp_parser_postfix_expression): Likewise.
753 (cp_parser_postfix_dot_deref_expression): Likewise.
754 (cp_parser_unary_expression): Likewise.
755 (cp_parser_new_expression): Likewise.
756 (cp_parser_delete_expression): Likewise.
757
3a483371
VR
758 * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
759 as `)', not as `('. Fix quotation.
760 (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
761 (cp_parser_primary_expression): Likewise.
762 (cp_parser_nested_name_specifier_opt): Likewise.
763 (cp_parser_postfix_expression): Likewise.
764 (cp_parser_postfix_open_square_expression): Likewise.
765 (cp_parser_parenthesized_expression_list): Likewise.
766 (cp_parser_pseudo_destructor_name): Likewise.
767 (cp_parser_new_expression): Likewise.
768 (cp_parser_direct_new_declarator): Likewise.
769 (cp_parser_delete_expression): Likewise.
770 (cp_parser_cast_expression): Likewise.
771 (cp_parser_question_colon_clause): Likewise.
772 (cp_parser_builtin_offsetof): Likewise.
773 (cp_parser_trait_expr): Likewise.
774 (cp_parser_label_for_labeled_statement): Likewise.
775 (cp_parser_compound_statement): Likewise.
776 (cp_parser_selection_statement): Likewise.
777 (cp_parser_condition): Likewise.
778 (cp_parser_iteration_statement): Likewise.
779 (cp_parser_already_scoped_statement): Likewise.
780 (cp_parser_simple_declaration): Likewise.
781 (cp_parser_linkage_specification): Likewise.
782 (cp_parser_static_assert): Likewise.
783 (cp_parser_decltype): Likewise.
784 (cp_parser_conversion_function_id): Likewise.
785 (cp_parser_operator_function_id): Likewise.
786 (cp_parser_operator): Likewise.
787 (cp_parser_type_parameter): Likewise.
788 (cp_parser_template_id): Likewise.
789 (cp_parser_explicit_instantiation): Likewise.
790 (cp_parser_explicit_specialization): Likewise.
791 (cp_parser_enum_specifier): Likewise.
792 (cp_parser_namespace_definition): Likewise.
793 (cp_parser_namespace_alias_definition): Likewise.
794 (cp_parser_using_declaration): Likewise.
795 (cp_parser_using_directive): Likewise.
796 (cp_parser_asm_definition): Likewise.
797 (cp_parser_direct_declarator): Likewise.
798 (cp_parser_ptr_operator): Likewise.
799 (cp_parser_parameter_declaration_clause): Likewise.
800 (cp_parser_initializer_clause): Likewise.
801 (cp_parser_class_specifier): Likewise.
802 (cp_parser_member_specification_opt): Likewise.
803 (cp_parser_member_declaration): Likewise.
804 (cp_parser_pure_specifier): Likewise.
805 (cp_parser_constant_initializer): Likewise.
806 (cp_parser_base_clause): Likewise.
807 (cp_parser_exception_specification_opt): Likewise.
808 (cp_parser_try_block): Likewise.
809 (cp_parser_function_try_block): Likewise.
810 (cp_parser_handler): Likewise.
811 (cp_parser_throw_expression): Likewise.
812 (cp_parser_asm_operand_list): Likewise.
813 (cp_parser_attributes_opt): Likewise.
814 (cp_parser_label_declaration): Likewise.
815 (cp_parser_constructor_declarator_p): Likewise.
816 (cp_parser_template_declaration_after_export): Likewise.
817 (cp_parser_single_declaration): Likewise.
818 (cp_parser_objc_message_expression): Likewise.
819 (cp_parser_objc_message_args): Likewise.
820 (cp_parser_objc_encode_expression): Likewise.
821 (cp_parser_objc_defs_expression): Likewise.
822 (cp_parser_objc_protocol_expression): Likewise.
823 (cp_parser_objc_selector_expression): Likewise.
824 (cp_parser_objc_protocol_refs_opt): Likewise.
825 (cp_parser_objc_typename): Likewise.
826 (cp_parser_objc_method_keyword_params): Likewise.
827 (cp_parser_objc_superclass_or_category): Likewise.
828 (cp_parser_objc_try_catch_finally_statement): Likewise.
829 (cp_parser_objc_synchronized_statement): Likewise.
830 (cp_parser_objc_throw_statement): Likewise.
831 (cp_parser_omp_var_list_no_open): Likewise.
832 (cp_parser_omp_clause_default): Likewise.
833 (cp_parser_omp_clause_if): Likewise.
834 (cp_parser_omp_clause_num_threads): Likewise.
835 (cp_parser_omp_clause_reduction): Likewise.
836 (cp_parser_omp_clause_schedule): Likewise.
837 (cp_parser_omp_critical): Likewise.
838 (cp_parser_omp_for_loop): Likewise.
839 (cp_parser_omp_sections_scope): Likewise.
840
de21c145
VR
841 * parser.c (cp_parser_template_parameter_list): Simplify.
842
e68c63e3
JW
8432008-04-07 James E. Wilson <wilson@tuliptree.org>
844
845 * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
846
c2b58ba2
JM
8472008-04-07 Jason Merrill <jason@redhat.com>
848
849 PR c++/35734
850 * class.c (type_has_user_nondefault_constructor): A template
851 counts as a nondefault constructor.
852
e8924938
PB
8532008-04-04 Paolo Bonzini <bonzini@gnu.org>
854
855 * decl.c (cxx_push_function_context): Delete.
856 (cxx_pop_function_context): Delete.
857 (start_preparsed_function): Merge cxx_push_function_context (!f->decl
858 code only).
859 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
860 LANG_HOOKS_FUNCTION_FINAL): Delete.
861 (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
862 LANG_HOOKS_MISSING_NORETURN_OK_P.
863 * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
864 Delete prototype.
865 * semantics.c (current_stmt_tree): Fix comment.
866
60c4d135
JJ
8672008-04-03 Jakub Jelinek <jakub@redhat.com>
868
869 PR c++/35741
870 * semantics.c (finish_offsetof): Undo effect of convert_from_reference
871 before calling fold_offsetof.
872
6cba282a
TT
8732008-04-03 Tom Tromey <tromey@redhat.com>
874
875 * Make-lang.in (c++_OBJS): New variable.
876
9ff420f1
PB
8772008-04-03 Paolo Bonzini <bonzini@gnu.org>
878
879 * optimize.c (clone_body): New, from tree-inline.c.
880
d2784db4
PB
8812008-04-03 Paolo Bonzini <bonzini@gnu.org>
882
883 * method.c (synthesize_method): Use {push,pop}_function_context.
884 * name-lookup.c (push_to_top_level): Likewise.
885 * parser.c (cp_parser_late_parsing_for_member): Likewise.
886
adcc62c7
VR
8872008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
888
889 PR c++/35578
890 * parser.c (cp_parser_decl_specifier_seq): Add location to error
891 message.
892
e980df8e
TT
8932008-03-27 Tom Tromey <tromey@redhat.com>
894
895 * Make-lang.in: Revert automatic dependency patch.
896
525521b6
DG
8972008-03-27 Douglas Gregor <doug.gregor@gmail.com>
898
899 PR obj-c++/35704
900 * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
901 (build_compound_expr): New, for compatibility with C
902 build_compound_expr.
903 (cp_build_compound_expr): Renamed from build_compound_expr.
904 (build_c_cast): New, for compatibility with C build_c_cast.
905 (cp_build_c_cast): Renamed from build_c_cast.
906 * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
907 * decl.c (cxx_maybe_build_cleanup): Ditto.
908 * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
909 (cp_build_compound_expr): Renamed from build_compound_expr.
910 (build_c_cast): Add C-compatible prototype.
911 (cp_build_c_cast): Renamed from build_c_cast.
912 * typeck2.c (build_functional_cast): Use cp_build_c_cast.
913 * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
914
063cc99c
DG
9152008-03-27 Douglas Gregor <doug.gregor@gmail.com>
916
917 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
918 tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
919 ending in a pack expansion, both of which can occur when
920 substituting into a nested template.
921 (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
922 instantiating the sizeof...(X) form, make tsubst_copy do the work.
923 * parser.c (cp_parser_template_parameter): Deal with unnamed
924 non-type template parameter packs identified by pack expansions in
925 the parameter type.
926
07874f1f
JJ
9272008-03-26 Jakub Jelinek <jakub@redhat.com>
928
ff2f1c5f
JJ
929 PR c++/35546
930 * pt.c (apply_late_template_attributes): Don't call tsubst on
931 first attribute argument if it is IDENTIFIER_NODE.
932
07874f1f
JJ
933 PR c++/35332
934 * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
935 and LTGT_EXPR to pp_expression.
936
a0a5f30f
DG
9372008-03-26 Douglas Gregor <doug.gregor@gmail.com>
938
939 * pt.c (coerce_template_template_parm): Moved the body of the loop
940 of coerce_template_template_parms here, to make iteration over a
941 template argument pack simpler.
942 Also, allow matching of a template parameter pack in the template
943 template parameter to a template parameter in the template
944 template argument.
945 (coerce_template_template_parms): Deal with variadic template
946 template parameters. Use coerce_template_template_parm.
947 (unify): Make sure we coerce the template template argument's
948 template arguments to the template template parameter's template
949 parameters, not the other way around.
950
2fe3178b
TT
9512008-03-25 Tom Tromey <tromey@redhat.com>
952
953 * Make-lang.in: Remove .o targets.
954 (cp/g++spec.o): Moved to cp/. Reduce to variable setting.
955 (GXX_OBJS): Update.
956 (c++_OBJS): New variable.
957 (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
958
5ade1ed2
DG
9592008-03-25 Douglas Gregor <doug.gregor@gmail.com>
960
961 * typeck.c (composite_pointer_type_r): Add SFINAE support.
962 (composite_pointer_type): Ditto.
963 (common_type): Fix call to composite_pointer_type.
964 (cxx_sizeof_nowarn): New; used to be a macro.
965 (cxx_sizeof_expr): Add SFINAE support.
966 (cxx_alignof_expr): Ditto.
967 (decay_conversion): Fix calls for SFINAE support.
968 (rationalize_conditional_expr): Add SFINAE support.
969 (build_class_member_access_expr): Ditto.
970 (finish_class_member_access_expr): Ditto.
971 (build_x_indirect_ref): Ditto.
972 (build_indirect_ref): Original version renamed to
973 cp_build_indirect_ref; new version provides a bridge from
974 c-common.
975 (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
976 support.
977 (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
978 (build_function_call): Original version renamed to
979 cp_build_function_call; new version provides a bridge from
980 c-common.
981 (cp_build_function_call): Was build_function_call; added SFINAE
982 support.
983 (convert_arguments): Add SFINAE support.
984 (build_x_binary_op): Ditto.
985 (build_binary_op): Original version renamed to cp_build_binary_op;
986 new version provides a bridge from c-common.
987 (cp_build_binary_op): Was build_binary_op; added SFINAE support.
988 (pointer_diff): Fix calls for SFINAE.
989 (build_x_unary_op): Add SFINAE support.
990 (condition_conversion): Fix calls for SFINAE.
991 (build_unary_op): Original version renamed to cp_build_unary_op;
992 new version provides a bridge from c-common.
993 (cp_build_unary_op): Was build_unary_op; added SFINAE support.
994 (unary_complex_lvalue): Fix calls for SFINAE.
995 (build_x_conditional_expr): Add SFINAE support.
996 (build_x_compound_expr_from_list): Fix calls for SFINAE.
997 (build_x_compound_expr): Add SFINAE support.
998 (convert_ptrmem): Fix calls for SFINAE.
999 (build_static_cast_1): Add SFINAE support.
1000 (build_static_cast): Ditto.
1001 (build_reinterpret_cast_1): Ditto.
1002 (build_reinterpret_cast): Ditto.
1003 (build_const_cast_1): Ditto.
1004 (build_const_cast): Ditto.
1005 (build_c_cast): Ditto.
1006 (build_modify_expr): Original version renamed to
1007 cp_build_modify_expr; new version provides a bridge from c-common.
1008 (cp_build_modify_expr): Was build_modify_expr; added SFINAE
1009 support.
1010 (build_x_modify_expr): Add SFINAE support.
1011 (build_ptrmemfunc): Fix calls for SFINAE.
1012 (convert_for_assignment): Add SFINAE support.
1013 (convert_for_initialization): Ditto.
1014 (check_return_expr): Fix calls for SFINAE.
1015 (lvalue_or_else): Add SFINAE support.
1016 * init.c (perform_member_init): Fix calls for SFINAE.
1017 (emit_mem_initializers): Ditto.
1018 (expand_virtual_init): Ditto.
1019 (expand_cleanup_for_base): Ditto.
1020 (build_aggr_init): Add SFINAE support.
1021 (expand_default_init): Ditto.
1022 (expand_aggr_init_1): Fix calls for SFINAE.
1023 (build_offset_ref): Ditto.
1024 (build_new_1): Add SFINAE support.
1025 (build_new): Ditto.
1026 (build_vec_delete_1): Fix calls for SFINAE.
1027 (get_temp_regvar): Ditto.
1028 (build_vec_init): Add SFINAE support.
1029 (build_dtor_call): Fix calls for SFINAE.
1030 (build_delete): Ditto.
1031 (push_base_cleanups): Ditto.
1032 (build_vec_delete_1): Ditto.
1033 * class.c (build_base_path): Fix calls for SFINAE.
1034 (build_simple_base_path): Ditto.
1035 (convert_to_base_statically): Ditto.
1036 (build_vfn_ref): Ditto.
1037 (resolve_address_of_overloaded_function): Ditto.
1038 * decl.c (check_initializer): Fix calls for SFINAE.
1039 (register_dtor_fn): Ditto.
1040 (compute_array_index_type): Ditto.
1041 (finish_enum): Ditto.
1042 (start_preparsed_function): Ditto.
1043 (cxx_maybe_build_cleanup): Ditto.
1044 * call.c (convert_like): Add COMPLAIN argument.
1045 (convert_like_with_context): Ditto.
1046 (build_this): Fix calls for SFINAE.
1047 (build_user_type_conversion): Ditto.
1048 (resolve_args): Ditto.
1049 (build_new_function_call): Add SFINAE support.
1050 (build_operator_new_call): Fix calls for SFINAE.
1051 (build_object_call): Add SFINAE support.
1052 (build_conditional_expr): Ditto.
1053 (build_new_op): Ditto.
1054 (build_op_delete_call): Fix calls for SFINAE.
1055 (build_temp): Ditto.
1056 (convert_like_real): Add SFINAE support.
1057 (build_x_va_arg): Fix calls for SFINAE.
1058 (convert_default_arg): Ditto.
1059 (build_over_call): Add SFINAE support.
1060 (build_java_interface_fn_ref): Fix calls for SFINAE.
1061 (build_special_member_call): Add SFINAE support.
1062 (build_new_method_call): Ditto.
1063 (perform_implicit_conversion): Ditto.
1064 (perform_direct_initialization_if_possible): Ditto.
1065 (initialize_reference): Fix calls for SFINAE.
1066 * method.c (do_build_assign_ref): Fix calls for SFINAE.
1067 * rtti.c (build_headof): Fix calls for SFINAE.
1068 (get_tinfo_decl_dynamic): Ditto.
1069 (get_typeid): Ditto.
1070 (build_dynamic_cast_1): Add SFINAE support.
1071 (build_dynamic_cast): Ditto.
1072 (tinfo_base_init): Fix calls for SFINAE.
1073 * except.c (do_get_exception_ptr): Fix calls for SFINAE.
1074 (do_end_catch): Ditto.
1075 (initialize_handler_parm): Ditto.
1076 (expand_start_catch_block): Ditto.
1077 (do_allocate_exception): Ditto.
1078 (do_free_exception): Ditto.
1079 (build_throw): Ditto.
1080 * cvt.c (build_up_reference): Fix calls for SFINAE.
1081 (convert_to_reference): Ditto.
1082 (ocp_convert): Ditto.
1083 (convert_to_void): Add SFINAE support.
1084 * tree.c (build_dummy_object): Fix calls for SFINAE.
1085 (stabilize_expr): Ditto.
1086 * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
1087 parameter.
1088 (build_new_method_call): Ditto.
1089 (build_special_member_call): Ditto.
1090 (build_new_op): Ditto.
1091 (perform_implicit_conversion): Ditto.
1092 (perform_direct_initialization_if_possible): Ditto.
1093 (convert_to_void): Ditto.
1094 (build_aggr_init): Ditto.
1095 (build_new): Ditto.
1096 (build_vec_init): Ditto.
1097 (build_dynamic_cast): Ditto.
1098 (finish_call_expr): Ditto
1099 (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
1100 (cxx_sizeof_nowarn): Remove macro; add function declaration.
1101 (build_class_member_access_expr): Add tsubst_flags_t parameter.
1102 (finish_class_member_access_expr): Ditto.
1103 (build_x_indirect_ref): Ditto.
1104 (cp_build_indirect_ref): New.
1105 (cp_build_function_call): Add tsubst_flags_t parameter.
1106 (build_x_unary_op): Ditto.
1107 (cp_build_unary_op): New.
1108 (build_x_conditional_expr): Add tsubst_flags_t parameter.
1109 (build_x_compound_expr): Ditto.
1110 (build_compound_expr): Ditto.
1111 (build_static_cast): Ditto.
1112 (build_reinterpret_cast): Ditto.
1113 (build_const_cast): Ditto.
1114 (build_c_cast): Ditto.
1115 (build_x_modify_expr): Ditto.
1116 (cp_build_modify_expr): New.
1117 (convert_for_initialization): Add tsubst_flags_t parameter.
1118 (cp_build_binary_op): Remove macro; add function declaration.
1119 (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
1120 (lvalue_or_else): Ditto.
1121 (build_functional_cast): Ditto.
1122 * typeck2.c (digest_init): Fix calls for SFINAE.
1123 (process_init_constructor_array): Ditto.
1124 (process_init_constructor_record): Ditto.
1125 (build_x_arrow): Ditto.
1126 (build_m_component_ref): Ditto.
1127 (build_functional_cast): Add SFINAE support.
1128 * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
1129 * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
1130 (finish_expr_stmt): Ditto.
1131 (finish_for_expr): Ditto.
1132 (finish_asm_stmt): Ditto.
1133 (finish_non_static_data_member): Ditto.
1134 (finish_qualified_id_expr): Ditto.
1135 (finish_call_expr): Add SFINAE support.
1136 (finish_increment_expr): Fix calls for SFINAE.
1137 (finish_unary_op_expr): Ditto.
1138 (simplify_aggr_init_expr): Ditto.
1139 (finish_omp_clauses): Ditto.
1140 (finish_omp_for): Ditto.
1141 (finish_omp_barrier): Ditto.
1142 (finish_omo_flush): Ditto.
1143 * decl2.c (grok_array_decl): Fix calls or SFINAE.
1144 (build_anon_union_vars): Ditto.
1145 (get_guard_cond): Ditto.
1146 (set_guard): Ditto.
1147 (one_static_initialization_or_destruction): Ditto.
1148 (do_static_initialization_or_destruction): Ditto.
1149 (generate_ctor_or_dtor_function): Ditto.
1150 (build_offset_ref_call_from_tree): Ditto.
1151 * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
1152 (cp_parser_postfix_dot_deref_expression): Ditto.
1153 (cp_parser_unary_expression): Ditto.
1154 (cp_parser_new_expression): Ditto.
1155 (cp_parser_cast_expression): Ditto.
1156 (cp_parser_binary_expression): Ditto.
1157 (cp_parser_question_colon_clause): Ditto.
1158 (cp_parser_assignment_expression): Ditto.
1159 (cp_parser_expression): Ditto.
1160 (cp_parser_builtin_offsetof): Ditto.
1161 (cp_parser_template_argument): Ditto.
1162 (cp_parser_functional_cast): Ditto.
1163
50c91950
TT
11642008-03-24 Tom Tromey <tromey@redhat.com>
1165
1166 * lex.c (handle_pragma_interface): Don't copy the filename.
1167 (handle_pragma_implementation): Copy filename using xstrdup.
1168
9e1e64ec
PC
11692008-03-21 Paolo Carlini <pcarlini@suse.de>
1170
1171 * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
1172 (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
1173 (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
1174 (PROMOTES_TO_AGGR_TYPE): Remove.
1175 (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
1176 * typeck.c (unary_complex_lvalue, build_modify_expr,
1177 convert_for_initialization): Adjust.
1178 * init.c (is_aggr_type): Remove.
1179 (is_class_type): Add.
1180 (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
1181 build_delete): Adjust.
1182 * lex.c (make_aggr_type): Remove.
1183 (make_class_type): Add.
1184 (cxx_make_type): Adjust.
1185 * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
1186 Adjust.
1187 * decl.c (build_typename_type, make_typename_type,
1188 make_unbound_class_template, cxx_init_decl_processing,
1189 check_tag_decl, groktypename, start_decl_1, layout_var_decl,
1190 check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
1191 grok_op_properties, xref_tag, check_function_type): Adjust.
1192 * call.c (check_dtor_name, standard_conversion, implicit_conversion,
1193 add_builtin_candidate, add_builtin_candidates,
1194 build_user_type_conversion_1, convert_like_real, build_cxx_call,
1195 is_subseq, compare_ics): Adjust.
1196 * method.c (use_thunk): Adjust.
1197 * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
1198 create_tinfo_types): Adjust.
1199 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1200 build_up_reference, convert_to_reference, convert_from_reference,
1201 ocp_convert, build_expr_type_conversion): Adjust.
1202 * tree.c (bind_template_template_parm, error_type): Adjust.
1203 * dump.c (cp_dump_tree): Adjust.
1204 * search.c (lookup_member): Adjust.
1205 * friend.c (make_friend_class, do_friend): Adjust.
1206 * typeck2.c (store_init_value, process_init_constructor_array,
1207 process_init_constructor_record, build_x_arrow, build_m_component_ref,
1208 build_functional_cast): Adjust.
1209 * pt.c (finish_member_template_decl, process_template_parm,
1210 lookup_template_class, tsubst_function_type, tsubst,
1211 tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
1212 Adjust.
1213 * semantics.c (begin_class_definition, finish_base_specifier,
1214 finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
1215 Adjust.
1216 * name-lookup.c (constructor_name_p, push_overloaded_decl,
1217 do_class_using_decl, lookup_qualified_name,
1218 maybe_process_template_type_declaration): Adjust.
1219 * decl2.c (grok_array_decl, check_member_template,
1220 constrain_class_visibility): Adjust.
1221 * parser.c (cp_parser_class_name): Adjust.
1222
ac5dc795
PB
12232008-03-18 Paolo Bonzini <bonzini@gnu.org>
1224
1225 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
1226
3d574e5b
JM
12272008-03-17 Jason Merrill <jason@redhat.com>
1228
1229 PR c++/35548
1230 * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
1231 a temp directly to a reference as per DR391.
1232
70fef63a
RG
12332008-03-12 Richard Guenther <rguenther@suse.de>
1234
1235 PR c++/35469
1236 Revert:
1237 2008-02-04 Richard Guenther <rguenther@suse.de>
1238
1239 PR java/35035
1240 * decl.c (record_builtin_java_type): Make jboolean a
1241 integer type again where its mode doesn't match that of bool.
1242
1243 2008-01-25 Richard Guenther <rguenther@suse.de>
1244
1245 PR c++/33887
1246 * decl.c (record_builtin_java_type): Make __java_boolean
1247 a variant of bool.
1248 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
1249 after TYPE_MAIN_VARIANT check.
1250
85b20612
JJ
12512008-03-10 Jakub Jelinek <jakub@redhat.com>
1252
fde155a7
JJ
1253 PR c++/35328
1254 * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
1255 if errorcount.
1256
85b20612
JJ
1257 PR c++/35337
1258 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1259 DECL_P in not a variable and appears more than once error messages.
1260
96d84882
PB
12612008-03-07 Paolo Bonzini <bonzini@gnu.org>
1262
1263 Revert:
1264
1265 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
1266
1267 PR c++/35049
1268 PR c++/35096
1269 * typeck.c (structural_comptypes): Call cp_comptypes.
1270 (comptypes): New; called from the C/C++ common bits to perform
1271 strict checks.
1272 (cp_comptypes): Renamed from comptypes, which is already used,
1273 with a different signature, by the C++ front end.
1274 (build_reinterpret_cast_1): Call cp_comptypes.
1275 (ptr_reasonably_similar): Ditto.
1276 * decl.c (decls_match): Ditto.
1277 * cvt.c (convert_to_reference): Ditto.
1278 * cp-tree.h (same_type_p): Ditto.
1279 (same_or_base_type_p): Ditto.
1280 (comptypes): Rename to cp_comptypes.
1281 * pt.c (canonical_type_parameter): Call cp_comptypes.
1282
cf7bc668
PB
12832008-03-07 Paolo Bonzini <bonzini@gnu.org>
1284
1285 * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
1286 test for equivalence between pointer and references.
1287
393eda6a
MLI
12882008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1289
1290 PR 24924
1291 * class.c (finish_struct_anon): Use permerror instead of pedwarn.
1292 (check_field_decls): Likewise.
1293 (note_name_declared_in_class): Likewise.
1294 * call.c (build_new_op): Likewise.
1295 (convert_like_real): Likewise.
1296 (build_over_call): Likewise.
1297 * lex.c (unqualified_fn_lookup_error): Likewise.
1298 * parser.c (cp_parser_template_id): Likewise.
1299 * cvt.c (warn_ref_binding): Likewise.
1300 (convert_to_reference): Likewise.
1301 (ocp_convert): Likewise.
1302 (convert_to_void): Use error instead of pedwarn.
1303 * error.c (cp_cpp_error): Use pedantic_warning_kind.
1304 * decl.c (compute_array_index_type): Use constant_expression_error.
1305
4dbc8575
DG
13062008-03-01 Douglas Gregor <doug.gregor@gmail.com>
1307
1308 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
1309 that auto is either a storage class or a simple type specifier,
1310 depending on the dialect.
1311 (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
1312 specifier in C++98 mode, error in C++0x mode (since we don't
1313 support auto as a type specifier, yet).
1314 (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
1315 storage specifier in C++0x mode.
1316 (cp_parser_simple_type_specifier): Parse `auto' as a
1317 simple-type-specifier, but error because we don't support it yet.
1318
359be76e
MLI
13192008-02-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1320
1321 * parser.c (cp_parser_nonclass_name): New.
1322 (cp_parser_pseudo_destructor_name): Use it instead of
1323 cp_parser_type_name.
1324 (cp_parser_type_name): Move code to cp_parser_nonclass_name.
1325
966e8f4d
TT
13262008-02-29 Tom Tromey <tromey@redhat.com>
1327
1328 * parser.c (struct cp_token) <input_file_stack_index>: Remove.
1329 (cp_lexer_get_preprocessor_token): Update.
1330 (cp_lexer_set_source_position_from_token): Don't call
1331 restore_input_file_stack.
1332 * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
1333
3b302421
RG
13342008-02-28 Richard Guenther <rguenther@suse.de>
1335
1336 Revert:
1337 2008-02-26 Richard Guenther <rguenther@suse.de>
1338
1339 * decl.c (duplicate_decls): Remove decl from global mapping
1340 before ggc_freeing it.
1341
a15f0fd0
JJ
13422008-02-27 Jakub Jelinek <jakub@redhat.com>
1343
1344 PR c++/35368
1345 * rtti.c: Include c-pragma.h.
1346 (push_abi_namespace, pop_abi_namespace): New functions.
1347 (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
1348 create_tinfo_types, emit_support_tinfos): Use them.
1349 * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
1350
317c435f
JM
13512008-02-26 Jason Merrill <jason@redhat.com>
1352
1353 PR c++/35315
1354 * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
1355 to name the struct for linkage purposes even if it has attributes.
1356 (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
1357
2d593c86
TT
13582008-02-26 Tom Tromey <tromey@redhat.com>
1359
1360 * parser.c (eof_token): Remove old location code.
1361 (check_empty_body): Remove test of USE_MAPPED_LOCATION.
1362 * decl2.c (generate_ctor_or_dtor_function): Remove old location
1363 code.
1364 (cp_write_global_declarations): Likewise.
1365 * lex.c (cxx_init): Remove old location code.
1366 (handle_pragma_implementation): Remove test of
1367 USE_MAPPED_LOCATION.
1368 * pt.c (tsubst): Remove old location code.
1369 * error.c (cp_print_error_function): Remove test of
1370 USE_MAPPED_LOCATION.
1371 * decl.c (pop_label): Remove old location code.
1372 (finish_function): Likewise.
1373
4f01eeb4
MLI
13742008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1375
1376 PR 26264
1377 * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
1378
bbd59cf4
RG
13792008-02-26 Richard Guenther <rguenther@suse.de>
1380
1381 * decl.c (duplicate_decls): Remove decl from global mapping
1382 before ggc_freeing it.
1383
50a70b6b
PC
13842008-02-26 Paolo Carlini <pcarlini@suse.de>
1385
1386 PR c++/35323
1387 * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
1388
683d6ff9
MLI
13892008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1390
1391 * typeck.c (build_class_member_access_expr): Add appropriate
1392 OPT_W* parameter to warning.
1393 (build_reinterpret_cast_1): Likewise.
1394 * name-lookup.c (push_overloaded_decl): Likewise.
1395
998ceda2
PC
13962008-02-25 Paolo Carlini <pcarlini@suse.de>
1397
1398 PR c++/35333
1399 * error.c (dump_expr): Handle CONJ_EXPR.
1400
14012008-02-25 Paolo Carlini <pcarlini@suse.de>
1402
1403 PR c++/35338
1404 * error.c (dump_type): Handle FIXED_POINT_TYPE.
1405 (dump_expr): Handle FIXED_CST.
1406
4cfaec1c
JM
14072008-02-24 Jason Merrill <jason@redhat.com>
1408
1409 * parser.c (cp_parser_declaration): Handle "inline namespace".
1410 (cp_parser_namespace_definition): Likewise.
1411
1412 PR c++/33486
1413 * name-lookup.c (arg_assoc_namespace): Look down into inline
1414 namespaces, too.
1415
86b7b98b
MLI
14162008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1417
1418 * typeck.c (check_for_casting_away_constness): Use 1 single
1419 argument, the type of cast, to decide what diagnostics generate.
1420 (build_static_cast_1): Remove unused code. Update call to
1421 check_for_casting_away_constness.
1422 (build_reinterpret_cast_1): Update call to
1423 check_for_casting_away_constness.
1424 (build_const_cast_1): Likewise.
1425
a84a98ca
PC
14262008-02-24 Paolo Carlini <pcarlini@suse.de>
1427
1428 * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
1429 VEC_NEW_EXPR), forward to pp_expression.
1430 * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
1431
bdd6df52
DS
14322008-02-24 Danny Smith <dannysmith@users.sourceforge.net>
1433
1434 PR c++/34749
1435 * friend.c (do_friend): Call cplus_decl_attributes earlier.
1436
1eea53df
AP
14372008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
1438
1439 PR C++/34715
1440 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
1441 template decls' function decl.
1442
54062fc0
PC
14432008-02-22 Paolo Carlini <pcarlini@suse.de>
1444
1445 PR c++/35282
1446 Revert:
1447 2008-02-14 Paolo Carlini <pcarlini@suse.de>
1448
1449 PR c++/28743
1450 * pt.c (determine_specialization): In case of function templates,
1451 when the type of DECL does not match FN there is no match.
1452
ae311566
RW
14532008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1454
1455 PR c/19999
1456 * typeck.c (build_binary_op): Warn about floating point
1457 comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
1458
cc85b4c5
JM
14592008-02-19 Jason Merrill <jason@redhat.com>
1460
1461 PR c++/34950
1462 * pt.c (resolve_overloaded_unification): Set processing_template_decl
1463 while we look for possible bindings.
1464
dadb19e0
JJ
14652008-02-19 Jakub Jelinek <jakub@redhat.com>
1466
d2ee546f
JJ
1467 PR c++/35028
1468 * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
1469
edb6000e
JJ
1470 PR c++/34964
1471 PR c++/35244
1472 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
1473 vars. Afterwards ensure v is VAR_DECL.
1474
dadb19e0
JJ
1475 PR c++/35078
1476 * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
1477 call cp_finish_decl.
1478 * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
1479 early.
1480
92fab505
DG
14812008-02-15 Douglas Gregor <doug.gregor@gmail.com>
1482
1483 PR c++/35023
1484 PR c++/35024
1485 PR c++/35026
1486 * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
1487 is error_mark_node, return an error early.
1488 (find_parameter_packs_r): Pass the pointer set along to recursive
1489 calls of cp_walk_subtrees; don't try to manage the pointer set
1490 ourselves.
1491 (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
1492 (make_pack_expansion): Ditto.
1493 (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
1494 a second pass through the tree with find_parameter_packs_r; that
1495 second pass no longer does anything.
1496 (push_template_decl_real): If we have an erroneous declaration,
1497 set its type to error_mark_node before returning an error.
1498
625b6d91
DG
14992008-02-14 Douglas Gregor <doug.gregor@gmail.com>
1500
1501 PR c++/34050
1502 * pt.c (tsubst_initializer_list): Deal with the use of
1503 VOID_TYPE_NODE to indicate value-initialization of the bases.
1504
8c95264b
MLI
15052008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1506 Jason Merrill <jason@redhat.com>
1507
1508 PR c++/5645
1509 PR c++/11159
1510 * class.c (type_has_user_nondefault_constructor): New fn.
1511 * cp-tree.h: Declare it.
1512 * init.c (emit_mem_initializers): Use it for -W warning about
1513 missing base initializer.
1514
4571259b
PC
15152008-02-14 Paolo Carlini <pcarlini@suse.de>
1516
1517 PR c++/28743
1518 * pt.c (determine_specialization): In case of function templates,
1519 when the type of DECL does not match FN there is no match.
1520
5586014a
JJ
15212008-02-13 Jakub Jelinek <jakub@redhat.com>
1522 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1523
1524 PR c++/35138
1525 * parser.c (cp_parser_pseudo_destructor_name): If next tokens
1526 are not identifier :: ~, return before calling cp_parser_type_name.
1527
3387721b
JM
15282008-02-13 Jason Merrill <jason@redhat.com>
1529
8d2eb304
JM
1530 PR c++/34962, c++/34937, c++/34939
1531 * decl2.c (is_late_template_attribute): Always defer attributes
1532 vector_size and weak.
1533
3387721b
JM
1534 PR c++/34774
1535 * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
1536 of enumerators, too.
1537
156d614f
JM
15382008-02-12 Jason Merrill <jason@redhat.com>
1539
1540 PR c++/34824
317c435f 1541 * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
156d614f
JM
1542 if we're doing conversions to call a user-defined conversion function.
1543
43854f72
SB
15442008-02-12 Steven Bosscher <steven@gcc.gnu.org>
1545
1546 PR c++/29048
1547 * semantics.c (finish_qualified_id_expr): Avoid duplicate access
1548 check here, too.
1549
a9de800a
JJ
15502008-02-12 Jakub Jelinek <jakub@redhat.com>
1551
1552 PR c++/34862
1553 * init.c (build_new_1): Don't create placement_expr before
1554 constructing alloc_call. Verify that the pointer is passed by
1555 value to operator new.
1556
02e52ae5
JM
15572008-02-11 Jason Merrill <jason@redhat.com>
1558
1559 PR c++/35097
1560 * pt.c (tsubst): Don't look up a template typedef in an explicit
1561 specialization.
1562
37d24376
DG
15632008-02-11 Douglas Gregor <doug.gregor@gmail.com>
1564
1565 PR c++/35113
1566 * tree.c (cp_build_qualified_type_real): When building a
1567 cv-qualified array type, build it as a unique type with
1568 build_cplus_array_type_1 and then adopt the unqualified type's
1569 main variant.
1570
ba19e12f
PC
15712008-02-11 Paolo Carlini <pcarlini@suse.de>
1572
1573 PR c++/35077
1574 * decl.c (groktypename): Check grokdeclarator return.
1575
6c5613b0
JM
15762008-02-10 Jason Merrill <jason@redhat.com>
1577
1578 PR c++/34094
1579 * decl2.c (cp_write_global_declarations): Don't write out static
1580 data members with DECL_IN_AGGR_P set.
1581
7efc22ea
JM
15822008-02-08 Jason Merrill <jason@redhat.com>
1583
1584 PR c++/35116
1585 * tree.c (build_target_expr_with_type): Handle void initializer.
1586 (bot_manip): Remap slot before recursing.
1587
72fb133f
KG
15882008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1589
1590 PR other/35107
1591 * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
1592
04941f76
AO
15932008-02-06 Alexandre Oliva <aoliva@redhat.com>
1594
1595 PR c++/35056
1596 * tree.c: Include tree-flow.h.
1597 (build_target_expr): Check type compatibility.
1598 * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
1599 * call.c (convert_like_real): Convert bitfield to expected type.
1600
f76e50b9
DG
16012008-02-06 Douglas Gregor <doug.gregor@gmail.com>
1602
1603 PR c++/35049
1604 PR c++/35096
1605 * typeck.c (structural_comptypes): Call cp_comptypes.
1606 (comptypes): New; called from the C/C++ common bits to perform
1607 strict checks.
1608 (cp_comptypes): Renamed from comptypes, which is already used,
1609 with a different signature, by the C++ front end.
1610 (build_reinterpret_cast_1): Call cp_comptypes.
1611 (ptr_reasonably_similar): Ditto.
1612 * decl.c (decls_match): Ditto.
1613 * cvt.c (convert_to_reference): Ditto.
1614 * cp-tree.h (same_type_p): Ditto.
1615 (same_or_base_type_p): Ditto.
1616 (comptypes): Rename to cp_comptypes.
1617 * pt.c (canonical_type_parameter): Call cp_comptypes.
1618
6a279e92
JJ
16192008-02-05 Jakub Jelinek <jakub@redhat.com>
1620
1621 PR c++/33553
1622 * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
1623 value dependent expression.
1624
1db54f4e
DG
16252008-02-05 Douglas Gregor <doug.gregor@gmail.com>
1626
1627 PR c++/35074
1628 * decl2.c (save_template_attributes): When we're modifying the
1629 TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
1630 all of the other variants to add those same attributes. Otherwise,
1631 the main variant will be inconsistent with those other variants.
1632
70c7fe74
RG
16332008-02-04 Richard Guenther <rguenther@suse.de>
1634
1635 PR java/35035
1636 * decl.c (record_builtin_java_type): Make jboolean a
1637 integer type again where its mode doesn't match that of bool.
1638
0fcedd9c
JM
16392008-02-02 Jason Merrill <jason@redhat.com>
1640 Mark Mitchell <mark@codesourcery.com>
1641
1642 PR c++/33916
1643 * init.c (build_value_init_1): New function.
1644 (build_value_init): New function.
1645 * typeck2.c (build_functional_cast): Call it.
1646 * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
1647
1648 * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
1649 TYPE_HAS_CONSTRUCTOR.
1650 * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
1651 add_implicitly_declared_members): Adjust.
1652 (check_field_decls): Adjust. Remove warnings about reference/const
1653 in class without constructor.
1654 (check_bases_and_members): Adjust. Give those warnings here instead.
1655 * decl.c (fixup_anonymous_aggr): Adjust.
1656 (check_initializer): Adjust, clarify logic slightly.
1657 (grok_special_member_properties): Adjust, only set if user-provided.
1658 * rtti.c (create_tinfo_types): Don't set.
1659 * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
1660 Use same_type_ignoring_top_level_qualifiers_p.
1661 * pt.c (check_explicit_specialization): Adjust.
1662 (instantiate_class_template): Adjust.
1663
0451301c
DG
16642008-01-31 Douglas Gregor <doug.gregor@gmail.com>
1665 Jakub Jelinek <jakub@redhat.com>
1666
1667 PR c++/34935
1668 PR c++/34936
1669 * typeck.c (structural_comptypes): Handle comparisons of
1670 VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
1671 REAL_TYPE nodes.
1672 * mangle.c (write_builtin_type): Map down to the canonical type,
1673 which will be one of the predefined type nodes.
1674
bdba2263
MM
16752008-01-29 Michael Meissner <michael.meissner@amd.com>
1676
1677 PR 35004
1678 * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
1679 bits to allow for expansion of the number of middle end tree
1680 codes.
1681
7b3e2d46
DG
16822008-01-29 Douglas Gregor <doug.gregor@gmail.com>
1683
1684 PR c++/34055
1685 PR c++/34103
1686 PR c++/34219
1687 PR c++/34606
1688 PR c++/34753
1689 PR c++/34754
1690 PR c++/34755
1691 PR c++/34919
1692 PR c++/34961
1693 * typeck.c (check_return_expr): Tweak call to
1694 check_for_bare_parameter_packs.
1695 * class.c (add_method): Be careful with error_mark_nodes.
1696 * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
1697 signature.
1698 * pt.c (struct find_parameter_pack_data): Remove
1699 SET_PACKS_TO_ERROR.
1700 (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
1701 (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
1702 (make_pack_expansion): Ditto.
1703 (check_for_bare_parameter_packs): Parameter is now a tree, not a
1704 tree*.
1705 (process_template_parm): Tweak call to
1706 check_for_bare_parameter_packs.
1707 (push_template_decl_real): Tweak calls to
1708 check_for_bare_parameter_packs. If bare parameter packs are found
1709 in the list of exceptions, clear out that list after giving an
1710 error.
1711 * semantics.c (finish_cond): Tweak call to
1712 check_for_bare_parameter_packs.
1713 (finish_expr_stmt): Ditto.
1714 (finish_for_expr): Ditto.
1715 (finish_switch_cond): Ditto.
1716 (finish_mem_initializers): Ditto.
1717 (finish_member_declaration): Ditto.
1718 (finish_static_assert): Check for bare parameter packs in the
1719 condition.
1720 * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
1721 attributes of a declaration.
1722 * parser.c (cp_parser_using_declaration): Tweak call to
1723 check_for_bare_parameter_packs.
1724 (cp_parser_base_clause): Ditto.
1725
dc555429
JM
17262008-01-28 Jason Merrill <jason@redhat.com>
1727
1728 PR c++/35007
1729 * class.c (build_base_path): Fix !want_pointer case.
1730
7a0b47e3
JM
17312008-01-27 Jason Merrill <jason@redhat.com>
1732
1733 PR c++/27177
1734 * class.c (build_base_path): Fix previous change.
1735
6f536f74
JJ
17362008-01-26 Jakub Jelinek <jakub@redhat.com>
1737
1738 PR c++/34965
1739 * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
1740 and TRUTH_XOR_EXPR.
1741
2f35df8c
RG
17422008-01-26 Richard Guenther <rguenther@suse.de>
1743
1744 PR c++/34235
1745 * typeck.c (build_binary_op): Remove code to shorten compares.
1746
291de7fc
RG
17472008-01-25 Richard Guenther <rguenther@suse.de>
1748
1749 PR c++/33887
1750 * decl.c (record_builtin_java_type): Make __java_boolean
1751 a variant of bool.
1752 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
1753 after TYPE_MAIN_VARIANT check.
1754
1d555e26
JM
17552008-01-25 Jason Merrill <jason@redhat.com>
1756
d79ca207
JM
1757 PR c++/27177
1758 * class.c (build_base_path): Don't mess with virtual access if
1759 skip_evaluation.
1760 * call.c (standard_conversion): Don't check whether source type
1761 is complete.
1762
1d555e26
JM
1763 * decl2.c (is_late_template_attribute): Don't defer attribute
1764 visibility just because the type is dependent.
1765
b6219f42
JM
17662008-01-25 Jason Merrill <jason@redhat.com>
1767 Mark Mitchell <mark@codesourcery.com>
1768
1769 PR c++/31780
1770 * call.c (standard_conversion): Allow conversion from integer/real
1771 to complex.
1772 (compare_ics): Such a conversion is worse than a normal arithmetic
1773 conversion.
1774
57e2aff2
RG
17752008-01-25 Richard Guenther <rguenther@suse.de>
1776
1777 PR c++/33887
1778 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
1779 to true.
1780
3fe82414
PC
17812008-01-24 Paolo Carlini <pcarlini@suse.de>
1782
1783 PR c++/34603
1784 * pt.c (push_template_decl_real): Return error_mark_node in case
1785 of template definition of non-template.
1786
160b8b80
JM
17872008-01-24 Jason Merrill <jason@redhat.com>
1788
1789 PR c++/34913
1790 * decl2.c (is_late_template_attribute): Defer any attribute with
1791 dependent args. Also defer type attributes if the type is dependent.
1792
3fe82414
PC
17932008-01-22 Jakub Jelinek <jakub@redhat.com>
1794 Alexandre Oliva <aoliva@redhat.com>
24030e4c
JJ
1795
1796 PR c++/33984
1797 * call.c (reference_binding): For bitfields use the declared bitfield
1798 type.
1799 (add_builtin_candidates): Likewise.
1800 * class.c (layout_class_type): For bitfields copy over the
1801 original type quals.
1802
7655e009
JM
18032008-01-22 Jason Merrill <jason@redhat.com>
1804
b2a7def5
JM
1805 PR c++/28560
1806 * decl.c (groktypename): Also ignore attributes on dependent
1807 possibly-class types.
1808
7655e009
JM
1809 PR c++/34912
1810 * friend.c (do_friend): Check for prior declaration of a friend
1811 function of a local class.
1812 * name-lookup.c (lookup_name_innermost_nonclass_level):
1813 No longer static.
1814 * name-lookup.h: Declare it.
1815
255ef034
TT
18162008-01-22 Tom Tromey <tromey@redhat.com>
1817
1818 PR c++/34829:
1819 * init.c (build_new_1): Only disallow Java aggregates.
1820
e94384db
JJ
18212008-01-22 Jakub Jelinek <jakub@redhat.com>
1822
61c3a446
JJ
1823 PR c++/34607
1824 * semantics.c (finish_omp_for): Don't call c_finish_omp_for
1825 if decl or init is error_mark_node.
1826
e94384db
JJ
1827 PR c++/34918
1828 * error.c (dump_expr): Handle VECTOR_CST.
1829
33b45227
JM
18302008-01-21 Jason Merrill <jason@redhat.com>
1831
29b0d1fd
JM
1832 PR c++/33959
1833 * pt.c (tsubst_aggr_type): Make sure our context is complete.
1834
1835 PR c++/34573
1836 * pt.c (retrieve_local_specialization): Robustify.
1837 (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
1838
1839 PR c++/34846
1840 * pt.c (tsubst): Only call retrieve_local_specialization if the
1841 original typedef was in a function template.
1842
33b45227
JM
1843 PR c++/34196
1844 * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
1845
02dcf7ba
RG
18462008-01-21 Richard Guenther <rguenther@suse.de>
1847
1848 PR c++/34850
1849 * error.c (cp_print_error_function): Deal with recursive
1850 BLOCK trees.
1851
b8ce93da
PC
18522008-01-20 Paolo Carlini <pcarlini@suse.de>
1853
1854 PR c++/34891
1855 * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
1856
dbc21af5
PC
18572008-01-20 Paolo Carlini <pcarlini@suse.de>
1858
1859 PR c++/34776
1860 PR c++/34486
1861 * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
1862 on non-IS_AGGR_TYPE scope.
1863 (constructor_name_p): Assert IS_AGGR_TYPE.
1864
1ea193c2
ILT
18652008-01-18 Ian Lance Taylor <iant@google.com>
1866
1867 PR c++/33407
1868 * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
1869 (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
1870 DECL_IS_OPERATOR_NEW flag.
1871
be2b5483
RG
18722008-01-16 Richard Guenther <rguenther@suse.de>
1873
1874 PR c++/33819
1875 * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
1876 for conversions to type variants.
1877
cde7bfee
AT
18782008-01-15 Andreas Tobler <a.tobler@schweiz.org>
1879
1880 * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
1881 declaration and code. Update copyright year.
1882
ac90ae18
DG
18832008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1884
1885 PR c++/34399
1886 * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
1887 know we have a class type.
1888
cdcae745
DG
18892008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1890
1891 PR c++/34751
1892 * pt.c (coerce_template_parameter_pack): When substituting into
1893 the type of a non-type template parameter pack. use the
1894 deduced/substituted arguments.
1895 * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
1896 can be a parameter pack with the ellipsis following it. When we
1897 have an erroneous declaration, allow it to be a parameter pack.
1898 (cp_parser_template_parameter): Complain about default
1899 arguments on non-type template parameter packs, and parse them
1900 using the new cp_parser_default_argument.
1901 (cp_parser_parameter_declaration): Complain about parameter packs
1902 with default arguments. Move parsing of default arguments into a
1903 new function, cp_parser_default_argument.
1904 (cp_parser_default_argument): New; extracted from
1905 cp_parser_parameter_declaration.
1906
4439d02f
DG
19072008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1908
1909 PR c++/34051
1910 PR c++/34055
1911 PR c++/34102
1912 PR c++/34103
1913 * typeck.c (check_return_expr): If there are bare parameter packs
1914 in the return value, set it to error_mark_node.
1915 * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
1916 * pt.c (find_parameter_packs_r): Look at the type of
1917 IDENTIFIER_NODEs (e.g., for user-defined conversions).
1918 (check_for_bare_parameter_packs): Flip the result: now returns
1919 TRUE when there were bare parameter packs, FALSE otherwise.
1920 (push_template_decl_real): Deal with flipped result of
1921 check_for_bare_parameter_packs.
1922 * semantics.c (finish_cond): If there are bare parameter packs in
1923 the conditional, set it to error_mark_node.
1924 (finish_expr_stmt): If there are bare parameter packs in the
1925 expression, set it to error_mark_node.
1926 (finish_for_expr): Ditto.
1927 (finish_switch_cond): If there are bare parameter packs in
1928 the conditional, set it to error_mark_node.
1929 (finish_mem_initializers): If there are bare parameter packs in
1930 the member initializer, set it to error_mark_node.
1931 (finish_member_declaration): Check the attributes of the
1932 declaration for bare parameter packs, and remove the attributes if
1933 any have bare parameter packs.
1934 * parser.c (cp_parser_using_declaration): Check the using
1935 declaration for bare parameter packs.
1936 (cp_parser_base_clause): If there are bare parameter packs in a
1937 base specifier, don't add it to the chain.
1938
a022041e
DG
19392008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1940
1941 PR c++/34314
1942 * error.c (dump_simple_decl): Display ellipsis for template
1943 non-type parameter packs.
1944 (dump_decl): Display ellipsis for template type parameter packs.
1945 (dump_template_decl): Display ellipsis for template template
1946 parameter packs.
1947 * pt.c (redeclare_class_template): When redeclaring a class
1948 template, check for collisions between template parameters and
1949 template parameter packs.
1950
c095a4f8
DG
19512008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1952
1953 PR c++/33964
1954 * pt.c (process_partial_specialization): Don't mark template
1955 parameters that occur in non-deduced contexts.
1956 (struct pair_fn_data): Add include_nondeduced_p.
1957 (for_each_template_parm_r): Only visit non-deduced contexts if
1958 include_nondeduced_p is set.
1959 (for_each_template_parm): Added parameter include_nondeduced_p,
1960 which states whether template parameters found in non-deduced
1961 contexts should be visited.
1962 (uses_template_parms): Visit all template parameters, even those
1963 in non-deduced contexts.
1964
85d85234
DG
19652008-01-15 Douglas Gregor <doug.gregor@gmail.com>
1966
1967 PR c++/34052
1968 * pt.c (check_default_tmpl_args): Check for parameter packs that
1969 aren't at the end of a primary template.
1970 (push_template_decl_real): Remove check for parameter packs that
1971 aren't at the end of a primary template; that now happens in
1972 check_default_tmpl_args.
1973 * semantics.c (finish_template_template_parm): Use
1974 check_default_tmpl_args to check for errors in the template
1975 parameter list.
1976
5db2e9ca
DK
19772008-01-12 Doug Kwan <dougkwan@google.com>
1978
1979 * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
1980 instead of OPT_Wreturn_type in warning due to ignored return type
1981 qualifiers.
1982 * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
1983 instead of OPT_Wreturn_type in warning due to ignored return type
1984 qualifiers.
1985
b2ebd268
JJ
19862008-01-08 Jakub Jelinek <jakub@redhat.com>
1987
1988 PR c++/33890
1989 * semantics.c (finish_omp_for): Don't call
1990 fold_build_cleanup_point_expr if processing_template_decl.
1991
a9fe2f76
PC
19922008-01-04 Paolo Carlini <pcarlini@suse.de>
1993 Jakub Jelinek <jakub@redhat.com>
1994
1995 PR c++/34611
1996 * error.c (dump_template_argument): Deal with TREE_LIST.
1997
1a7817e4
DG
19982008-01-01 Douglas Gregor <doug.gregor@gmail.com>
1999
2000 * parser.c (cp_parser_check_decl_spec): Don't warn about "long
2001 long" in C++0x mode; change the warning to note that "long long"
2002 is only unsupported in C++98 mode.
2003
4c12c8ea
JM
20042007-12-20 Jason Merrill <jason@redhat.com>
2005
2006 PR c++/34111
2007 * call.c (standard_conversion): Derived-to-base is considered a
2008 standard conversion.
2009
5259c813
JJ
20102007-12-19 Jakub Jelinek <jakub@redhat.com>
2011
2012 PR c++/34513
2013 * parser.c (cp_parser_omp_parallel): For non-combined parallel
2014 call cp_parser_statement rather than
2015 cp_parser_already_scoped_statement.
2016
82390eb6
JM
20172007-12-18 Jason Merrill <jason@redhat.com>
2018
2019 PR c++/34206
2020 * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
2021 use template parms.
2022 (dependent_type_p_r): Handle the domain of an array.
2023
a15c0b00
DG
20242007-12-18 Douglas Gregor <doug.gregor@gmail.com>
2025 Jakub Jelinek <jakub@redhat.com>
2026
2027 PR c++/32565
2028 PR c++/33943
2029 PR c++/33965
2030 * pt.c (template_template_parm_bindings_ok_p): New; verifies
2031 bindings of template template parameters after all template
2032 arguments have been deduced.
2033 (coerce_template_parms): Don't complain when COMPLAIN doesn't
2034 include tf_error.
2035 (fn_type_unification): Use template_template_parm_bindings_ok_p.
2036 (unify): Deal with variadic, bound template template parameters.
2037 (get_class_bindings): Use template_template_parm_bindings_ok_p.
2038
ac3b1156
JJ
20392007-12-18 Jakub Jelinek <jakub@redhat.com>
2040
2041 PR c++/34488
2042 * decl.c (grokdeclarator): Reject friend sfk_constructor
2043 FUNCTION_TYPE.
2044
8085ca15
JJ
20452007-12-17 Jakub Jelinek <jakub@redhat.com>
2046
2047 PR c/34506
2048 * parser.c (cp_parser_omp_all_clauses): Accept optional comma
2049 in between clauses.
2050
394d9fe7
AO
20512007-12-15 Alexandre Oliva <aoliva@redhat.com>
2052
2053 PR debug/7081
2054 * cp-lang.c (cp_classify_record): New.
2055 (LANG_HOOKS_CLASSIFY_RECORD): Override.
2056
61a861e6
JJ
20572007-12-11 Jakub Jelinek <jakub@redhat.com>
2058
5b767b9d
JJ
2059 PR c++/34238
2060 * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
2061
61a861e6
JJ
2062 PR c++/34364
2063 * rtti.c (build_dynamic_cast): Call convert_from_reference even for
2064 dynamic_cast in a template.
2065
0197270c
SM
20662007-12-10 Simon Martin <simartin@users.sourceforge.net>
2067
2068 PR c++/34059
2069 * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
2070 MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
2071
214452b9
JJ
20722007-12-10 Jakub Jelinek <jakub@redhat.com>
2073
e7de2d6f
JJ
2074 PR c++/34395
2075 * error.c (dump_type_prefix, dump_type_suffix): Handle
2076 TYPE_PACK_EXPANSION.
2077
214452b9
JJ
2078 PR c++/34394
2079 * error.c (dump_expr): Handle ABS_EXPR.
2080
23372b3f
JJ
20812007-12-09 Jakub Jelinek <jakub@redhat.com>
2082
2083 PR c++/34178
2084 PR c++/34340
2085 * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
2086 in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2087 Return 2 also if DECL_EXPLICIT_INSTANTIATION.
2088 * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
2089 flag_use_repository and repo_emit_p returned 2.
2090
28267cfc
JJ
20912007-12-06 Jakub Jelinek <jakub@redhat.com>
2092
2093 PR c++/34336
2094 * tree.c (stabilize_call, stabilize_init): Do nothing if
2095 processing_template_decl.
2096
91929b4d
JJ
20972007-12-05 Jakub Jelinek <jakub@redhat.com>
2098
2099 PR c++/34271
2100 * semantics.c (finish_decltype_type): For SCOPE_REF issue an
2101 error instead of assertion failure.
2102 * parser.c (cp_parser_decltype): If closing paren is not found,
2103 return error_mark_node.
2104
ba796308
DG
21052007-12-04 Douglas Gregor <doug.gregor@gmail.com>
2106
2107 PR c++/34101
2108 * name-lookup.c (arg_assoc_template_arg): Recurse on argument
2109 packs.
2110 (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
2111 since arg_assoc_template_arg will deal with them (better).
2112
2f93f02c
DG
21132007-12-04 Douglas Gregor <doug.gregor@gmail.com>
2114
2115 PR c++/33509
2116 * pt.c (tsubst_exception_specification): Handle substitutions into
2117 member templates, where tsubst_pack_expansion returns a
2118 TYPE_PACK_EXPANSION.
2119
db60ff18
DG
21202007-12-04 Douglas Gregor <doug.gregor@gmail.com>
2121
2122 PR c++/33091
2123 * pt.c (unify_pack_expansion): If we didn't deduce any actual
2124 bindings for the template parameter pack, don't try to keep the
2125 empty deduced arguments.
2126 (unify): If a parameter is a template-id whose template argument
2127 list contains a pack expansion that is not at the end, then we
2128 cannot unify against that template-id.
2129
0b93f014
PC
21302007-12-02 Paolo Carlini <pcarlini@suse.de>
2131
2132 PR c++/34061
2133 * pt.c (current_template_args): Use error_operand_p.
2134
06be4f56
PC
21352007-12-02 Paolo Carlini <pcarlini@suse.de>
2136
2137 PR c++/34273
2138 * error.c (dump_decl): Handle TREE_BINFO.
2139
867f133e
OW
21402007-12-01 Ollie Wild <aaw@google.com>
2141
2142 PR c++/8171
2143 * typeck.c (build_binary_op): Add conversion of pointers to function
2144 members appearing as operands to the equality operators.
2145
89ab8ba0
JJ
21462007-11-30 Jakub Jelinek <jakub@redhat.com>
2147
2148 PR c++/34275
2149 * error.c (dump_expr): Handle OBJ_TYPE_REF.
2150
7a547b93
JJ
21512007-11-29 Jakub Jelinek <jakub@redhat.com>
2152
42924ed7
JJ
2153 PR c++/34270
2154 * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
2155 in templates.
2156 * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
2157 Likewise.
2158
7a547b93
JJ
2159 PR c++/34267
2160 PR c++/34268
2161 * parser.c (cp_parser_decltype): Don't call finish_id_expression
2162 on ~type.
2163 * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
2164 and ~type early.
2165
ce41114b
JJ
21662007-11-27 Jakub Jelinek <jakub@redhat.com>
2167
62cbbe84
JJ
2168 PR tree-optimization/34181
2169 * method.c (use_thunk): Don't inline the call in the thunk.
2170
ce41114b
JJ
2171 PR c++/34213
2172 * tree.c (decl_linkage): Static data members and static member
2173 functions in anonymous ns classes are lk_external.
2174
182e0d71
AK
21752007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
2176
ce41114b 2177 PR c++/34081
182e0d71
AK
2178 * decl.c (start_preparsed_function): Pass
2179 processing_template_decl for the new allocate_struct_function
2180 parameter.
2181
87caf699
RG
21822007-11-25 Richard Guenther <rguenther@suse.de>
2183
42924ed7 2184 * decl.c (poplevel): Use BLOCK_CHAIN.
87caf699 2185
a298680c
OW
21862007-11-24 Ollie Wild <aaw@google.com>
2187
2188 * typeck.c (delta_from_ptrmemfunc): New function.
2189 (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
2190 (build_binary_op): Call delta_from_ptrmemfunc.
2191
360f866c
JJ
21922007-11-23 Jakub Jelinek <jakub@redhat.com>
2193
2194 PR c++/30293
2195 PR c++/30294
2196 * decl.c (cp_finish_decl): Disallow variable or field
2197 definitions if extern "Java" aggregates.
2198 (grokparms): Disallow parameters with extern "Java"
2199 aggregates.
2200 (check_function_type): Disallow function return values
2201 with extern "Java" aggregates.
2202 * init.c (build_new_1): Disallow placement new with
2203 extern "Java" aggregates.
2204
6ca39fcb
MM
22052007-11-23 Mark Mitchell <mark@codesourcery.com>
2206 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2207
2208 PR c++/5310
2209 * call.c (convert_like_real): Build a zero constant when __null is
2210 converted to an integer type.
2211
6d1f904c
JJ
22122007-11-22 Jakub Jelinek <jakub@redhat.com>
2213
2214 PR c++/34094
2215 * decl2.c (cp_write_global_declarations): Issue error about static
2216 data members in anonymous namespace which are declared and used,
2217 but not defined.
2218
63d34078
JJ
22192007-11-20 Jakub Jelinek <jakub@redhat.com>
2220
542f8eb9
JJ
2221 PR c++/34089
2222 * parser.c (cp_parser_class_head): Reject function template ids.
2223
6da06848
JJ
2224 PR c++/28879
2225 * tree.c (build_cplus_array_type_1): Don't pass any VLA types
2226 when processing_template_decl to build_array_type.
2227
63d34078
JJ
2228 PR c++/33962
2229 * pt.c (more_specialized_fn): Don't segfault if one or
2230 both argument list end with ellipsis.
2231
be461b8f
JJ
22322007-11-18 Jakub Jelinek <jakub@redhat.com>
2233
2234 PR c++/30988
6c01f02b
JJ
2235 * semantics.c (finish_call_expr): Set
2236 current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
2237 or OVERLOAD with all noreturn functions.
be461b8f 2238
823e5f7f
JJ
22392007-11-16 Jakub Jelinek <jakub@redhat.com>
2240
2241 PR c++/34100
2242 * pt.c (apply_late_template_attributes): Do nothing if decl's type is
2243 error_mark_node.
2244
ffbf5813
JJ
22452007-11-13 Jakub Jelinek <jakub@redhat.com>
2246
046e4071
JJ
2247 PR c++/34054
2248 PR c++/34056
2249 PR c++/34057
2250 PR c++/34058
2251 PR c++/34060
2252 * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
2253 set to error_mark_node the outermost POINTER_TYPE to the pack if
2254 it is seen in a POINTER_TYPE.
2255 (push_template_decl_real): If check_for_bare_parameter_packs
2256 fails for function return type, set the return type to
2257 integer_type_node. If check_for_bare_parameter_packs failed
2258 for non-function, return error_mark_node.
2259
ffbf5813
JJ
2260 PR c++/29225
2261 * call.c (build_new_op): Call resolve_args before calling
2262 build_over_call.
2263
f1e20710
TT
22642007-11-11 Tom Tromey <tromey@redhat.com>
2265
2266 PR c++/17577:
2267 * lex.c (handle_pragma_implementation): Use cpp_included_before.
2268
b131ad7c
MLI
22692007-11-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2270
2271 PR c++/8570
2272 * pt.c (redeclare_class_template): Update error message. Use a
2273 note to show the previous declaration.
2274 (tsubst_friend_class): Use the location of the friend template as
2275 the input location before calling redeclare_class_template.
2276
09b1ccd6
JJ
22772007-11-11 Jakub Jelinek <jakub@redhat.com>
2278
2279 PR c++/34068
2280 * semantics.c (finish_pseudo_destructor_expr): Handle
2281 object == error_mark_node.
2282
3d9b2eb6
JJ
22832007-11-10 Jakub Jelinek <jakub@redhat.com>
2284
2285 PR c++/32241
2286 * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
2287 is not scalar type, let finish_class_member_access_expr handle
2288 diagnostics. Pass BIT_NOT_EXPR argument to
2289 finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
2290
49b5e2f6
DG
22912007-11-09 Douglas Gregor <doug.gregor@gmail.com>
2292
2293 PR c++/33510
2294 * decl.c (cp_complete_array_type): If any of the initializer
2295 elements are pack expansions, don't compute the array size yet.
2296
c02cdc25
TT
22972007-11-08 Andrew Pinski <pinskia@gmail.com>
2298
2299 PR c++/30297:
2300 * tree.c (decl_linkage): Fields have no linkage.
2301
8208d7dc
DJ
23022007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
2303
2304 * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
2305
e4fd5b87
DG
23062007-11-07 Douglas Gregor <doug.gregor@gmail.com>
2307
2308 PR c++/33045
2309 PR c++/33837
2310 PR c++/33838
2311 * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
2312 Be careful with ERROR_MARK_NODEs.
2313 * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
2314 argument.
2315
2811f33d
JJ
23162007-11-07 Jakub Jelinek <jakub@redhat.com>
2317
2318 PR c++/33501
2319 * call.c (build_over_call): Don't check TREE_ADDRESSABLE
2320 on incomplete type.
2321
9ae165a0
DG
23222007-11-06 Douglas Gregor <doug.gregor@gmail.com>
2323
2324 PR c++/33977
2325 PR c++/33886
2326 * tree.c (c_build_qualified_type): Define bridge to
2327 cp_build_qualified_type.
2328
1ad8aeeb
DG
23292007-11-06 Douglas Gregor <doug.gregor@gmail.com>
2330
2331 PR c++/31439
2332 PR c++/32114
2333 PR c++/32115
2334 PR c++/32125
2335 PR c++/32126
2336 PR c++/32127
2337 PR c++/32128
2338 PR c++/32253
2339 PR c++/32566
2340 * typeck.c (check_return_expr): Pass address of retval to
2341 check_for_bare_parameter_packs.
2342 * class.c (build_base_field): Tolerate bases that have no layout
2343 due to errors.
2344 (end_of_base): Ditto.
2345 * tree.c (canonical_type_variant): Be careful with
2346 ERROR_MARK_NODE.
2347 * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
2348 tree*.
2349 * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
2350 which states whether parameter packs should be replaced with
2351 ERROR_MARK_NODE.
2352 (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
2353 possible. If set_packs_to_error is set true, replace the parameter
2354 pack with ERROR_MARK_NODE. Manage our own pointer sets.
2355 (uses_parameter_packs): Don't set parameter packs to
2356 ERROR_MARK_NODE.
2357 (check_for_bare_parameter_packs): Now takes a pointer to a tree,
2358 which may be modified (if it is a parameter pack). Instructs
2359 find_parameter_packs_r to replace parameter packs with
2360 ERROR_MARK_NODE (so that they won't cause errors later on).
2361 (process_template_parm): Pass pointer to
2362 check_for_bare_parameter_packs.
2363 (process_partial_specialization): Replace pack expansions before
2364 the end of the template argument list with ERROR_MARK_NODE.
2365 (push_template_decl_real): Pass pointer to
2366 check_for_bare_parameter_packs. Replace parameter packs not at the
2367 end of the template parameter list with ERROR_MARK_NODE.
2368 (convert_template_argument): Be more careful about using DECL_NAME
2369 on only declarations.
2370 (unify): Can't unify against ERROR_MARK_NODE.
2371 * semantics.c (finish_cond): Pass pointer to
2372 check_for_bare_parameter_packs.
2373 (finish_expr_stmt): Ditto.
2374 (finish_for_expr): Ditto.
2375 (finish_switch_cond): Pass pointer to
2376 check_for_bare_parameter_packs, and call it before we put the
2377 condition into the statement.
2378 (finish_mem_initializers): Pass pointer to
2379 check_for_bare_parameter_packs.
2380 (finish_member_declaration): Ditto.
2381 * parser.c (cp_parser_base_clause): Ditto.
2382
239371f9
JJ
23832007-11-06 Jakub Jelinek <jakub@redhat.com>
2384
b0eb6a8f
JJ
2385 PR target/33168
2386 * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
2387 with the final TREE_READONLY flag in place. processing_template_decl
2388 is known to be 0 in this part of function.
2389
239371f9
JJ
2390 PR c++/33894
2391 * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
2392 OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
2393 * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
2394 * semantics.c (finish_omp_atomic): Revert most of the
2395 2007-02-05 changes, just keep the new representation of
2396 OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
2397
565603f8
L
23982007-11-05 H.J. Lu <hongjiu.lu@intel.com>
2399
2400 PR c++/33871
2401 * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
2402 local.
2403
86089be5
DG
24042007-11-05 Douglas Gregor <doug.gregor@gmail.com>
2405
2406 PR c++/33996
2407 PR c++/33235
2408 PR c++/33930
2409 * typeck.c (merge_types): Don't lose rvalue references when
2410 merging types.
2411 * call.c (build_over_call): Don't elide move constructors just
2412 because the copy constructor is trivial (!).
2413 (compare_ics): If comparing cv-qualifiers fails, we can still order
2414 based on binding lvalues vs. rvalues.
2415
2afad0f6
DG
24162007-11-05 Douglas Gregor <doug.gregor@gmail.com>
2417
2418 PR c++/33939
2419 * pt.c (unify_pack_expansion): bring handling of function call
2420 arguments into line with type_unification_real.
2421
278b63df
MLI
24222007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2423
2424 * typeck.c (build_binary_op): Use pedwarn instead of error for
2425 consistency.
2426
1b021ff4
JJ
24272007-11-05 Jakub Jelinek <jakub@redhat.com>
2428
f370e66b
JJ
2429 PR c++/33836
2430 * parser.c (cp_parser_unary_expression): For &&label call
2431 cp_parser_non_integral_constant_expression and return error_mark_node
2432 if it returned true.
2433
1b021ff4
JJ
2434 PR c++/33969
2435 * decl.c (grokdeclarator): Don't call build_memfn_type if type
2436 is neither FUNCTION_TYPE nor METHOD_TYPE.
2437
eba5fc70
JJ
24382007-11-02 Jakub Jelinek <jakub@redhat.com>
2439
2440 PR c++/33516
2441 * parser.c (cp_parser_nested_name_specifier_opt): Use
2442 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
2443 typedef of currently open class.
2444
10a6624a
PC
24452007-11-02 Paolo Carlini <pcarlini@suse.de>
2446
2447 PR c++/33495
2448 * error.c (dump_expr): Deal specially with statements.
2449
ef3b7b17
JM
24502007-11-01 Jason Merrill <jason@redhat.com>
2451
2452 PR c++/30897
2453 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
2454 template parms.
2455 (lookup_template_class): Use it to get the outer template args
2456 for instantiating one.
2457
2458 PR c++/29236
2459 * pt.c (reduce_template_parm_level): tsubst the parameters
2460 of a template template parm.
2461
e1a18c68
DG
24622007-11-01 Douglas Gregor <doug.gregor@gmail.com>
2463
2464 PR c++/33955
2465 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
2466
3a44f395
JJ
24672007-11-01 Jakub Jelinek <jakub@redhat.com>
2468
e426bd2c
JJ
2469 PR c++/32384
2470 * parser.c (cp_parser_postfix_dot_deref_expression): If
2471 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
2472 first and if that succeeds and type is SCALAR_TYPE_P, create
2473 PSEUDO_DTOR_EXPR.
2474
3a44f395
JJ
2475 PR c++/32260
2476 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
2477 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
2478 as for std::type_info.
2479
066f956c
PC
24802007-10-31 Paolo Carlini <pcarlini@suse.de>
2481
2482 PR c++/33494
2483 * cxx-pretty-print.c (pp_cxx_typeid_expression,
2484 pp_cxx_delete_expression): Change to static linkage.
2485 * cxx-pretty-print.h: Adjust declarations.
2486 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
2487 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
2488 MODOP_EXPR): Forward to pp_expression.
2489
2490 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
2491 Fix typo.
2492
0e95aec1
CB
24932007-10-31 Christian Bruel <christian.bruel@st.com>
2494 Mark Mitchell <mark@codesourcery.com>
2495
2496 PR c++/19531
ef3b7b17 2497 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
0e95aec1
CB
2498 if retval is volatile.
2499
4c38e99e
JJ
25002007-10-30 Jakub Jelinek <jakub@redhat.com>
2501
2502 PR c++/33616
2503 * decl2.c (build_offset_ref_call_from_tree): Call
2504 build_non_dependent_expr on object prior to building ADDR_EXPR from it
2505 if FN is DOTSTAR_EXPR.
2506
88b82314
DG
25072007-10-30 Douglas Gregor <doug.gregor@gmail.com>
2508
2509 PR c++/31993
2510 PR c++/32252
2511 * pt.c (find_parameter_packs_r): Fix typo in comment.
2512 (convert_template_argument): Look at the pattern of a pack
2513 expansion to determine what kind of entity we're converting.
2514 (coerce_template_parameter_pack): When we have coerced a non-type
2515 template parameter pack, substitute into the type of that pack.
2516 (tsubst_pack_expansion): When our substitution of a parameter pack
2517 is a "trivial" substitution of itself, just substitute into the
2518 pack expansion rather than actually expanding.
2519
e7df0180
JJ
25202007-10-29 Jakub Jelinek <jakub@redhat.com>
2521
2522 PR c++/33841
2523 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
2524 for non-integral type bitfields. Return true if bitfield is correct, false
2525 error has been diagnosed.
2526 (check_field_decls): If check_bitfield_decl returned false, call also
2527 check_field_decl.
2528
8259e4f5
PC
25292007-10-28 Paolo Carlini <pcarlini@suse.de>
2530 Mark Mitchell <mark@codesourcery.com>
2531
2532 PR c++/30659
2533 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
2534 class member error out and return.
2535
1e3eacc7
JJ
25362007-10-27 Jakub Jelinek <jakub@redhat.com>
2537
d5aa2cf0
JJ
2538 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
2539 to current_function_decl rather than 0.
2540
1e3eacc7
JJ
2541 PR c++/33844
2542 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
2543 ->* rather than .*.
2544 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
2545
d02dbde6
JM
25462007-10-27 Jason Merrill <jason@redhat.com>
2547
2548 PR c++/5247
2549 * call.c (convert_default_arg): Detect recursion.
2550
094a5fe2
JJ
25512007-10-27 Jakub Jelinek <jakub@redhat.com>
2552
2553 PR c++/33842
2554 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
2555 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
2556 OFFSETOF_EXPR.
2557 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
2558 functions.
2559 * error.c (dump_expr): Handle OFFSETOF_EXPR.
2560
91a77d68
JM
25612007-10-26 Jason Merrill <jason@redhat.com>
2562
2563 PR c++/24791
2564 * pt.c (get_template_info): New fn.
2565 (template_class_depth): Use it.
2566 (push_template_decl_real): Check that the template args of the
2567 definition match the args of the previous declaration.
2568
07021f8c
PC
25692007-10-26 Paolo Carlini <pcarlini@suse.de>
2570
2571 PR c++/31988
2572 * decl2.c (coerce_new_type): Do not allow a default argument for
2573 the first parameter.
2574
2b536806
DG
25752007-10-26 Douglas Gregor <doug.gregor@gmail.com>
2576
2577 PR c++/33839
2578 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
2579 don't see the leading '('. Only lookup names if we get an
2580 IDENTIFIER_NODE.
2581
0f1e3321
JJ
25822007-10-26 Jakub Jelinek <jakub@redhat.com>
2583
2584 PR c++/33744
2585 * parser.c (cp_parser_parenthesized_expression_list): Set
2586 greater_than_is_operator_p to true in between the parens.
2587
9b70c6b0
PC
25882007-10-26 Paolo Carlini <pcarlini@suse.de>
2589
2590 PR c++/31747
2591 * decl.c (grokdeclarator): In case of conflicting specifiers
2592 just return error_mark_node.
2593
3459ca23
OW
25942007-10-26 Ollie Wild <aaw@google.com>
2595
2596 * expr.c (cxx_expand_expr): Removed.
2597 * cp-tree.h (exx_expand_expr): Removed.
2598 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
2599 with c_expand_expr.
2600
6735e374
PC
26012007-10-25 Paolo Carlini <pcarlini@suse.de>
2602
2603 PR c++/33843
2604 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
2605
6f4fd536
JM
26062007-10-23 Jason Merrill <jason@redhat.com>
2607
2608 PR c++/25950 (DR 391)
2609 * call.c (struct conversion): Remove check_copy_constructor_p.
2610 (reference_binding): Always bind a reference directly to a
2611 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
2612 temporary creation.
2613 (check_constructor_callable): Remove.
2614 (convert_like_real): Don't call it.
2615 (initialize_reference): Don't call check_constructor_callable.
2616 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
2617 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
2618 conversions if LOOKUP_NO_TEMP_BIND.
2619 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
2620 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
2621 second conversion.
2622 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
2623
6e684eee
JJ
26242007-10-22 Jakub Jelinek <jakub@redhat.com>
2625
2626 PR c++/33372
2627 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
2628 before checking if its type is integral.
2629
5818c8e4
JM
26302007-10-22 Jason Merrill <jason@redhat.com>
2631
2632 PR c++/33620
2633 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
2634 * pt.c (apply_late_template_attributes): Splice out dependent
2635 attributes from DECL_ATTRIBUTES.
2636
2637 * decl.c (cxx_maybe_build_cleanup): Use build_address.
2638
c5409249
MLI
26392007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2640
2641 * typeck.c (build_binary_op) : Use appropriate warning option
2642 instead of unnamed warning.
2643
bf98d3b6
PC
26442007-10-16 Paolo Carlini <pcarlini@suse.de>
2645
2646 PR c++/31446
2647 * pt.c (current_template_args): Do not change TREE_LIST elements
2648 with a TREE_VALUE of error_mark_node.
2649
15896502
MM
26502007-10-16 Mark Mitchell <mark@codesourcery.com>
2651
2652 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
2653 * decl.c (start_decl): Tidy.
2654 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
2655 the type.
2656 (grokdeclarator): Clarify comment.
2657
db160137
AP
26582007-10-14 Andrew Pinski <pinskia@gmail.com>
2659
2660 PR c++/30303
2661 * decl.c (grokfndecl): Return NULL after the "definition of
2662 implicitly-declared" error happened.
2663
a9a81e7d
SM
26642007-10-12 Simon Martin <simartin@users.sourceforge.net>
2665
2666 PR c++/26698
2667 * call.c (build_user_type_conversion_1): Do not consider conversion
2668 functions to convert a (possibly cv-qualified) object to the (possibly
2669 cv-qualified) same object type (or a reference to it), to a (possibly
2670 cv-qualified) base class of that type (or a reference to it).
2671
f4205442
PC
26722007-10-12 Paolo Carlini <pcarlini@suse.de>
2673
2674 * pt.c (tsubst): Use template_parm_level_and_index.
2675
3d3585eb
JJ
26762007-10-12 Jakub Jelinek <jakub@redhat.com>
2677
2678 PR c++/32121
2679 * parser.c (cp_parser_compound_statement): Handle label-declarations
2680 at the beginning of the compound statement.
2681 (cp_parser_block_declaration): Issue diagnostics about __label__
2682 not at the beginning of a block.
2683
c343d5a7
PC
26842007-10-11 Paolo Carlini <pcarlini@suse.de>
2685
2686 PR c++/33461
2687 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
2688 to convert_template_argument.
2689 (coerce_template_parms): Return error_mark_node after fixed-length
2690 error.
2691 (tsubst_decl): Check for error_mark_node the return value of the
2692 first tsubst in 'case VAR_DECL'.
2693
6524147c
OW
26942007-10-08 Ollie Wild <aaw@google.com>
2695
2696 * typeck2.c (digest_init): Call cplus_expand_constant after
2697 convert_for_initialization.
2698 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
2699 * expr.c (cplus_expand_constant): Updated function description.
2700
42f02385
JM
27012007-10-04 Jason Merrill <jason@redhat.com>
2702
2703 PR c++/20416
2704 * call.c (initialize_reference): Handle local static reference
2705 temps properly.
2706
231d0665
JM
27072007-10-03 Jason Merrill <jason@redhat.com>
2708
65567efa
JM
2709 PR c++/32470
2710 * name-lookup.c (push_namespace_with_attrs): Fold back into...
2711 (push_namespace): Here.
2712 (handle_namespace_attrs): New fn for the attr code.
2713 (leave_scope): Don't pop_visibility.
2714 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
2715 * parser.c (cp_parser_namespace_definition): Call
2716 handle_namespace_attrs and pop_visibility as appropriate.
2717
231d0665
JM
2718 PR c++/11756
2719 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
2720
fea10e36
AO
27212007-10-03 Alexandre Oliva <aoliva@redhat.com>
2722
2723 * decl.c (duplicate_decls): Preserve linkage flags for mere
2724 redeclarations of gnu_inline definitions.
2725
a24549d4
JM
27262007-10-03 Jason Merrill <jason@redhat.com>
2727
2728 PR c++/15764
2729 * decl.c (wrap_cleanups_r): New fn.
2730 (wrap_temporary_cleanups): New fn.
2731 (initialize_local_var): Call it.
2732
dc472c59
JM
27332007-09-29 Jason Merrill <jason@redhat.com>
2734
2735 PR c++/33094
2736 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
2737 constant to not have DECL_EXTERNAL if it's file-local.
2738
6dcee2d6
OW
27392007-09-28 Ollie Wild <aaw@google.com>
2740
2741 Revert
2742 2007-09-27 Ollie Wild <aaw@google.com>
2743
2744 * typeck2.c (digest_init): Call cplus_expand_constant after
2745 convert_for_initialization.
2746 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
2747 * expr.c (cplus_expand_constant): Updated function description.
2748
d9d9dbc0
JM
27492007-09-28 Jason Merrill <jason@redhat.com>
2750
2751 PR c++/10179
2752 * class.c (layout_empty_base): Take rli parameter, update
2753 rli->record_align if empty base has user-specified alignment.
2754 (build_base_field): Pass rli to it.
2755
930a1e63
PC
27562007-09-28 Paolo Carlini <pcarlini@suse.de>
2757
2758 PR c++/33213
2759 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
2760
31d40008
PC
27612007-09-28 Paolo Carlini <pcarlini@suse.de>
2762
2763 PR c++/33118
2764 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
2765 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
2766 (dump_parameters): Just call dump_type for argument packs too.
2767
80d86013
JJ
27682007-09-28 Jakub Jelinek <jakub@redhat.com>
2769
2770 PR c++/31434
2771 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
2772 qualification by creating qualified PACK_EXPANSION_PATTERN and
2773 then calling make_pack_expansion on it.
2774
12487dd0
OW
27752007-09-27 Ollie Wild <aaw@google.com>
2776
2777 * typeck2.c (digest_init): Call cplus_expand_constant after
2778 convert_for_initialization.
2779 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
2780 * expr.c (cplus_expand_constant): Updated function description.
2781
533007c1
JM
27822007-09-27 Jason Merrill <jason@redhat.com>
2783
d9d9dbc0 2784 PR c++/33571
533007c1
JM
2785 * decl2.c (is_late_template_attribute): Don't crash on unknown
2786 attribute.
2787
62081704
PC
27882007-09-27 Paolo Carlini <pcarlini@suse.de>
2789
2790 PR c++/33493
2791 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
2792 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
2793 spaces in the formatting.
2794 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
2795
c94ed7a1
JJ
27962007-09-27 Jakub Jelinek <jakub@redhat.com>
2797
2798 * error.c (cxx_print_error_function): Add third argument, pass
2799 it over to lhd_print_error_function.
2800 (cp_print_error_function): If diagnostic->abstract_origin, print
2801 virtual backtrace.
2802 * cp-tree.h (struct diagnostic_info): New forward decl.
2803 (cxx_print_error_function): Add third argument.
2804
dc3ca06f
SM
28052007-09-25 Simon Martin <simartin@users.sourceforge.net>
2806
2807 PR c++/33207
2808 * name-lookup.c (pushtag): Do not create an implicit typedef before
2809 the associated type declaration is known to be valid.
2810
1bde0042
JJ
28112007-09-25 Jakub Jelinek <jakub@redhat.com>
2812
2813 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
2814 rather than pointers.
2815
18ff3013
DS
28162007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
2817
2818 PR c++/14688
2819 * search.c (check_final_overrider): Fail if
2820 targetm.comp_type_attributes returns 0.
2821
7a20d689
JM
28222007-09-24 Jason Merrill <jason@redhat.com>
2823
2824 PR c++/33239
2825 * pt.c (resolve_typename_type): Don't look things up in the original
2826 template if it would mean losing template arguments.
2827
2dff8956
JJ
28282007-09-24 Jakub Jelinek <jakub@redhat.com>
2829
2830 PR c++/33506
2831 * cp-tree.h (cxx_type_hash_eq): New prototype.
2832 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
2833 * tree.c (cxx_type_hash_eq): New function.
2834
c946ce8b
DG
28352007-09-24 Douglas Gregor <doug.gregor@gmail.com>
2836
2837 PR c++/33185
2838 * tree.c (cp_build_qualified_type_real): Build a canonical
2839 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
2840
714f2304
DG
28412007-09-24 Douglas Gregor <doug.gregor@gmail.com>
2842
2843 PR c++/33112
2844 PR c++/33185
2845 * tree.c (cplus_array_compare): Compare pointers, not types.
2846 (build_cplus_array_type_1): Store new array type into the hash
2847 table before building the canonical type; build the canonical type
2848 correctly.
2849 (cp_build_qualified_type_real): Put all of the array types with
2850 cv-qualified element types into the C++ array hash table, built as
2851 variants of the unqualified versions.
2852
823dd937
JM
28532007-09-23 Jason Merrill <jason@redhat.com>
2854
2855 PR c++/16370
2856 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
2857 for deprecation warnings.
2858
a7f6bc8c
JM
28592007-09-22 Jason Merrill <jason@redhat.com>
2860
1a68a4e8
JM
2861 PR c++/15269
2862 * call.c (build_over_call): Warn about deprecated virtuals.
2863
a7f6bc8c
JM
2864 PR c++/19407
2865 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
2866 (MAYBE_TAGGED_TYPE_P): Remove.
2867 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
2868 instead of calling is_late_template_attribute again.
2869 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
2870 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
2871 Don't crash on typedefs from non-template classes.
2872 * decl2.c (grokfield): Don't sorry about attrs on template parms.
2873 (is_late_template_attribute): All attributes applied to template
2874 parms or typename types are dependent. Static.
2875 (splice_template_attributes): Pass decl through.
2876 (save_template_attributes): Likewise.
2877
b6efedac
JJ
28782007-09-20 Jakub Jelinek <jakub@redhat.com>
2879
2880 PR c++/33496
2881 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
2882 returned from tsubst_pack_expansion.
2883 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
2884 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
2885
24f58e74
PC
28862007-09-20 Paolo Carlini <pcarlini@suse.de>
2887
2888 PR c++/33460
2889 * semantics.c (finish_id_expression): Use consistently
2890 context_for_name_lookup.
2891 * decl.c (fixup_anonymous_aggr): Fix error message for
2892 anonymous struct (vs union).
2893
56d0c6e3
JM
28942007-09-19 Jason Merrill <jason@redhat.com>
2895
2896 PR c++/7586
2897 * pt.c (tsubst): Handle typedefs by looking for the specialization.
2898 (retrieve_specialization): Only tagged types use
2899 DECL_TEMPLATE_INSTANTIATIONS.
2900 (instantiate_class_template): Push nested classes too.
2901 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
2902 tagged types.
2903 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
2904 * init.c (is_aggr_type): Remove redundant tests.
2905 * class.c (push_nested_class): Use CLASS_TYPE_P.
2906
b43d1bde
PC
29072007-09-20 Paolo Carlini <pcarlini@suse.de>
2908
2909 PR c++/33459
2910 * init.c (build_zero_init): If, recursively, build_zero_init
2911 returns a NULL_TREE, do not append it to the VEC of constructors.
2912
5044ab0e
JM
29132007-09-18 Jason Merrill <jason@redhat.com>
2914
2915 PR c++/17743
2916 * pt.c (apply_late_template_attributes): Set processing_template_decl.
2917 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
2918 ATTR_FLAG_TYPE_IN_PLACE.
2919 (tsubst): Do unqualified lookup to find typedefs from current class.
2920 [ARRAY_TYPE]: Propagate alignment info.
2921 * decl2.c (is_late_template_attribute): Only defer handling of
2922 attribute aligned if the expression is dependent.
2923 (save_template_attributes): If we're deferring any attributes,
2924 make this a naming typedef.
2925
352d5090
PC
29262007-09-18 Paolo Carlini <pcarlini@suse.de>
2927
2928 PR c++/33462 (again)
2929 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
2930 va_arg instead of __builtin_va_arg.
2931
fdb8f418
PC
29322007-09-18 Paolo Carlini <pcarlini@suse.de>
2933
2934 PR c++/33462
2935 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
2936 (pp_cxx_primary_expression): Use it.
2937 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
2938 * error.c (dump_expr): Use it.
2939
2d65b828
PC
29402007-09-18 Paolo Carlini <pcarlini@suse.de>
2941
2942 PR c++/33463
2943 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
2944 out case TYPEID_EXPR to...
2945 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
2946 and pp_cxx_right_paren.
2947 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
2948 * error.c (dump_expr): Use it.
2949
e74392f0
PC
29502007-09-18 Paolo Carlini <pcarlini@suse.de>
2951
2952 PR c++/33464
2953 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
2954 (pp_cxx_primary_expression): Use it.
2955 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
2956 * error.c (dump_expr): Use it.
2957
57711cd1
PC
29582007-09-16 Paolo Carlini <pcarlini@suse.de>
2959
2960 PR c++/33124
2961 * init.c (build_new): Remove warning for zero-element
2962 allocations.
2963
0ee3f0a8
NS
29642007-09-16 Nathan Sidwell <nathan@codesourcery.com>
2965
0ee3f0a8
NS
2966 PR c++/32756
2967 * call.c (maybe_handle_implicit_object): Set this_p, clear
2968 rvaluedness_matches_p.
2969 (compare_ics): Do not compare rvaluedness matching when one of the
2970 operands is an implicit object.
2971
4f4141ff
JM
29722007-09-14 Jason Merrill <jason@redhat.com>
2973
2974 PR c++/17743, c++/19163
2975 * decl2.c (is_late_template_attribute): New fn.
2976 (splice_template_attributes, save_template_attributes): New fns.
2977 (cplus_decl_attributes): Call save_template_attributes.
2978 * pt.c (apply_late_template_attributes): New fn.
2979 (instantiate_class_template, tsubst_decl): Use it.
2980 * cp-tree.h: Declare is_late_template_attribute.
2981
46c2514e
TT
29822007-09-13 Tom Tromey <tromey@redhat.com>
2983
2984 * parser.c (cp_lexer_new_main): Don't use
2985 c_lex_return_raw_strings.
2986 (cp_lexer_get_preprocessor_token): Update. Add special case when
2987 lexer is NULL.
2988
e89d6010
JH
29892007-09-11 Jan Hubicka <jh@suse.cz>
2990
2991 * method.c (use_thunk): Use tree_rest_of_compilation
2992 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
2993 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
2994 * cp-tree.h (expand_body): Kill.
2995 (emit_associated_thunks): Declare.
2996 * semantics.c (emit_associated_thunks): Export.
2997 (expand_body): Kill.
2998
b2ec1738
DD
29992007-09-09 David Daney <ddaney@avtrex.com>
3000
3001 PR c++/33324
3002 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
3003 to calculate cookie_ptr.
3004
fd452cef
JM
30052007-09-08 Jason Merrill <jason@redhat.com>
3006
3007 PR c++/33342
3008 * pt.c (most_specialized_class): Set processing_template_decl
3009 while tsubsting partial spec args.
3010
3fd40684
JM
30112007-09-06 Jason Merrill <jason@redhat.com>
3012
3013 * decl2.c (get_guard): Copy visibility from the guarded variable.
3014
b2ea030b
JH
30152007-09-06 Jan Hubicka <jh@suse.cz>
3016
3017 * semantics.c (expand_body): Do not mark arguments of clones used.
3018
a125de0c
PC
30192007-09-06 Paolo Carlini <pcarlini@suse.de>
3020
3021 PR c++/32674
3022 * decl.c (cp_finish_decl): When processing_template_decl,
3023 deal correctly with init as TREE_LIST.
3024
5ffeb913
TT
30252007-09-06 Tom Tromey <tromey@redhat.com>
3026
3027 * decl.c (finish_function): Put return's location on line zero of
3028 file.
3029
6f06d231
JM
30302007-09-05 Jason Merrill <jason@redhat.com>
3031
86ef5ebb
JM
3032 PR c++/15745
3033 * except.c (prepare_eh_type): Use type_decays_to.
3034
6f06d231
JM
3035 PR c++/15097
3036 * init.c (build_delete): Use build_headof to get the address of the
3037 complete object if we aren't using the deleting destructor.
3038 * rtti.c (build_headof): No longer static.
3039 * cp-tree.h: Declare it.
3040
62bedd31
JJ
30412007-09-06 Jakub Jelinek <jakub@redhat.com>
3042
3043 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
3044 decl if a prototype for XX is provided with throw().
3045
012c4da9
JJ
3046 PR c++/33289
3047 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
3048 on __*_chk non-__builtin_* decls.
3049
61fdc9d7
PC
30502007-09-05 Paolo Carlini <pcarlini@suse.de>
3051
3052 PR c++/30302
3053 * semantics.c (finish_id_expression): Use context_for_name_lookup
3054 insted of DECL_CONTEXT, to see through anonymous structs and unions.
3055 * class.c (finish_struct_anon): Deal correctly with anonymous
3056 structs (vs unions, as GNU extension) in error messages.
3057
33061862
JH
30582007-09-05 Jan Hubicka <jh@suse.cz>
3059
b97d8153 3060 * sematics.c (expand_body): Remove unnecesary import_export_decl
33061862
JH
3061 call, DECL_EXTERNAL checks and current_function_decl saving.
3062
03ba2e11
PC
30632007-09-05 Paolo Carlini <pcarlini@suse.de>
3064
3065 PR c++/29731 (again)
3066 * parser.c (cp_parser_primary_expression): Return error_mark_node
3067 when a statement-expression is found in a template-argument list.
3068
ba6c89a9
JM
30692007-09-04 Jason Merrill <jason@redhat.com>
3070
6f06d231
JM
3071 * except.c (initialize_handler_parm): Use
3072 fold_build_cleanup_point_expr.
3073
9380ed84
JM
3074 PR c++/31419
3075 * call.c (reference_binding): Don't look for user-defined conversions
3076 to the same type.
3077
ba6c89a9
JM
3078 PR c++/31411
3079 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
3080 the MUST_NOT_THROW_EXPR.
3081
4c5bae34
RS
30822007-09-04 Richard Sandiford <richard@codesourcery.com>
3083
3084 * decl.c (cp_finish_decl): Call determine_visibility before
3085 make_rtl_for_nonlocal_decl.
3086
dc28490d
JM
30872007-09-04 Jason Merrill <jason@redhat.com>
3088
3089 PR c++/14032
3090 * pt.c (most_specialized_class): Substitute outer template
3091 arguments into the arguments of a member template partial
3092 specialization.
3093 (strip_innermost_template_args): New fn.
3094
72c65674
DJ
30952007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
3096
3097 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
3098
b1d5455a
KG
30992007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3100
3101 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
3102 * decl.c (cp_make_fname_decl): Likewise,
3103 * parser.c (cp_parser_string_literal): Likewise,
3104 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
3105 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
3106 Likewise,
3107
8bcebc69
PC
31082007-09-02 Paolo Carlini <pcarlini@suse.de>
3109
3110 PR c++/33208
3111 * typeck.c (build_unary_op): Fix error message for
3112 Boolean expression as operand to operator--.
3113
75547801
KG
31142007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3115
3116 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
3117 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
3118 Likewise.
3119
268127ce
DG
31202007-08-31 Douglas Gregor <doug.gregor@gmail.com>
3121
3122 PR c++/32597
3123 * init.c (build_default_init): Make extern.
3124 * cp-tree.h (build_default_init): Declare here.
3125 * pt.c (tsubst_expr): When the instantiation of the initializer of
3126 a variable results in an empty list, default-initialize the
3127 variable.
3128 (tsubst_copy_and_build): When the instantiation of the initializer
3129 in a new expression results in an empty initializer list,
3130 default-initialize it.
3131
1ab28be5
DG
31322007-08-31 Douglas Gregor <doug.gregor@gmail.com>
3133
3134 * mangle.c (write_type): Change mangling of rvalue reference from
3135 `RR' to `O'.
3136
194ee011
JJ
31372007-08-31 Jakub Jelinek <jakub@redhat.com>
3138
3139 * decl.c (duplicate_decls): Remove duplicated line.
3140
c8c00613
PC
31412007-08-31 Paolo Carlini <pcarlini@suse.de>
3142
3143 PR c++/33210
3144 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
3145 BOUND_TEMPLATE_TEMPLATE_PARM.
3146
5973c743
PC
31472007-08-31 Paolo Carlini <pcarlini@suse.de>
3148
3149 PR c++/32113
3150 * search.c (lookup_member): Check the name argument for
3151 error_mark_node.
3152
a53bf42c
PC
31532007-08-31 Paolo Carlini <pcarlini@suse.de>
3154
3155 PR c++/33212
3156 * parser.c (cp_parser_trait_expr): Check rerurn value of
3157 cp_parser_type_id.
3158
6e03b280
OW
31592007-08-30 Ollie Wild <aaw@google.com>
3160
3161 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
3162 convert_ptrmem for pointer to member conversions.
3163 (convert_to_pointer_force): Update cp_convert_to_pointer call.
3164 (ocp_convert): Update cp_convert_to_pointer call.
3165 * typeck.c (convert_ptrmem): Add conditional for null pointers to
3166 members.
3167 (build_static_cast_1): Check can_convert for conversions in either
3168 direction.
3169 (get_delta_difference_1): New function.
3170 (get_delta_difference): Refactor to call get_delta_difference_1.
3171
f86bfcab
JJ
31722007-08-30 Jakub Jelinek <jakub@redhat.com>
3173
3174 * decl.c (start_preparsed_function): Set
3175 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
3176
0a8fc247
PC
31772007-08-28 Paolo Carlini <pcarlini@suse.de>
3178
3179 PR c++/33209
3180 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
3181 BOUND_TEMPLATE_TEMPLATE_PARM.
3182
92d0af97
JJ
31832007-08-28 Jakub Jelinek <jakub@redhat.com>
3184
3185 PR c++/32596
3186 PR c++/32400
3187 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
3188 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
3189
c206a697
JM
31902007-08-27 Jason Merrill <jason@redhat.com>
3191
c2acde1e
JM
3192 PR c++/29000
3193 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
3194 Look inside STMT_EXPR.
3195 * semantics.c (stmt_expr_value_expr): New fn.
3196 * cp-tree.h: Declare it.
3197
c206a697
JM
3198 PR c++/28558
3199 * decl.c (groktypename): Ignore attributes applied to class type.
3200
c536a6a7
RG
32012007-08-28 Richard Guenther <rguenther@suse.de>
3202
3203 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
3204
7368348c
GDR
32052007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3206
3207 * error.c (dump_expr): Handle COMPLEX_CST.
3208 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
3209 (pp_cxx_expression): Likewise.
3210
3a47c4e4
AO
32112007-08-27 Alexandre Oliva <aoliva@redhat.com>
3212
3213 * decl.c (GNU_INLINE_P): New.
3214 (duplicate_decls): Handle gnu_inline. Merge attributes and
3215 some flags in overriding definitions.
3216 (redeclaration_error_message): Handle gnu_inline.
3217 (start_preparsed_function): Likewise.
3218
58f9752a
KG
32192007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3220
3221 * call.c (sufficient_parms_p): Constify.
3222 * class.c (same_signature_p): Likewise.
3223 * cp-gimplify.c (is_invisiref_parm,
3224 cxx_omp_privatize_by_reference): Likewise.
3225 * cp-objcp-common.c (has_c_linkage): Likewise.
3226 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
3227 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
3228 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
3229 num_artificial_parms_for, comp_template_parms,
3230 template_parameter_pack_p, any_dependent_template_arguments_p,
3231 any_type_dependent_arguments_p, any_value_dependent_elements_p,
3232 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
3233 zero_init_p, member_p, cp_lvalue_kind,
3234 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
3235 varargs_function_p, is_dummy_object, special_function_kind,
3236 string_conv_p, type_unknown_p, comp_except_specs, compparms,
3237 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
3238 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
3239 cp_has_mutable_p, at_least_as_qualified_p,
3240 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
3241 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
3242 * except.c (nothrow_libfn_p): Likewise.
3243 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
3244 Likewise.
3245 * pt.c (comp_template_parms, template_parameter_pack_p,
3246 any_type_dependent_arguments_p, any_value_dependent_elements_p,
3247 any_dependent_template_arguments_p): Likewise.
3248 * repo.c (repo_export_class_p): Likewise.
3249 * semantics.c (anon_aggr_type_p): Likewise.
3250 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
3251 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
3252 varargs_function_p, member_p, is_dummy_object, pod_type_p,
3253 zero_init_p, special_function_p): Likewise.
3254 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
3255 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
3256 compparms, invalid_nonstatic_memfn_p,
3257 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
3258 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
3259 cp_has_mutable_p, lvalue_or_else): Likewise.
3260
e2c3721c
PB
32612007-08-25 Paolo Bonzini <bonzini@gnu.org>
3262
3263 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
3264 * cp-objcp-common.c (cp_tree_size): Ditto.
3265 * tree.c (cp_walk_subtrees): Ditto
3266 * cp-tree.def (TINST_LEVEL): Go away.
3267 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
3268 move together with other non-tree structs.
3269 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
3270 (union lang_tree_node): Eliminate tinst_level field.
3271 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
3272 (current_instantiation, outermost_tinst_level): Return
3273 a "struct tinst_level *".
3274
3275 * error.c (print_instantiation_partial_context): Change second
3276 parameter to a "struct tinst_level *". Replace accessor macros
3277 with field access.
3278 (print_instantiation_full_context): Likewise.
3279 * lex.c (in_main_input_context): Likewise.
3280
3281 * pt.c (struct pending_templates): New.
3282 (pending_templates, last_pending_template): Use it as a type.
3283 (current_tinst_level): Change typo to "struct tinst_level *"
3284 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
3285 (add_pending_template): Construct a "struct pending_template".
3286 Replace TINST_LEVEL accessor macros with field access.
3287 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
3288 (pop_tinst_level): Likewise.
3289 (instantiate_pending_templates): Likewise. Factor common code used
3290 when an instantiation has been done.
3291 (outermost_tinst_level): Replace tree_last with loop.
3292 (current_instantiation): Return a "struct tinst_level *".
3293
89bd2c03
OW
32942007-08-24 Ollie Wild <aaw@google.com>
3295
3296 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
3297 * name-lookup.h (cp_binding_level): Remove vtables member.
3298
18177c7e
RG
32992007-08-24 Richard Guenther <rguenther@suse.de>
3300
3301 * tree.c (cp_cannot_inline_tree_fn): Remove.
3302 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
3303 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
3304 Remove define.
3305
c6f3d2f4
JJ
33062007-08-24 Jakub Jelinek <jakub@redhat.com>
3307
affb3cb2
JJ
3308 PR c++/32567
3309 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
3310 error_mark_node right away if build_expr_type_conversion
3311 returned it.
3312
97dc8e5b
JJ
3313 PR c++/32898
3314 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
3315 is error_mark_node rather than NULL_TREE.
3316 * pt.c (check_explicit_specialization): Likewise.
3317
c6f3d2f4
JJ
3318 PR c++/31941
3319 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
3320 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
3321
61172206
JM
33222007-08-22 Jason Merrill <jason@redhat.com>
3323
3324 PR c++/29365
3325 * pt.c (outermost_tinst_level): New function.
3326 * lex.c (in_main_input_context): New function.
f11b2351 3327 * cp-tree.h: Declare it.
61172206
JM
3328 * decl2.c (constrain_class_visibility): Use it to avoid warning
3329 about uses of the anonymous namespace in the main input file.
3330
af9fc1dd
JJ
33312007-08-21 Jakub Jelinek <jakub@redhat.com>
3332
3333 * init.c (build_new_1): Use get_target_expr instead of save_expr.
3334
43f14744
PS
33352007-08-20 Pawel Sikora <pluto@pld-linux.org>
3336
3337 PR c++/7302
3338 * class.c (finish_struct_1): Warn when a class has virtual
3339 functions and accessible non-virtual destructor.
3340
a489b1f0
RG
33412007-08-20 Richard Guenther <rguenther@suse.de>
3342
3343 PR c++/22369
3344 PR c++/22451
3345 * call.c (build_new_method_call): Convert initializer to
3346 the basetype.
3347 * init.c (build_aggr_init): Do not fiddle with types.
3348 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
3349 * except.c (build_throw): Do not drop qualifiers for the
3350 pointer type.
3351 * typeck.c (get_member_function_from_ptrfunc): Do not
3352 fiddle with types, instead convert.
3353 (build_ptrmemfunc1): Convert to the target type for
3354 initialization.
3355 (gfc_trans_allocate): Convert result to target type.
3356 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
3357 pointer-to-member structures shall have alias set zero as well.
3358
50886bf1
RG
33592007-08-20 Richard Guenther <rguenther@suse.de>
3360
3361 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
3362 Remove.
3363 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
3364 (nonstatic_local_decl_p): Likewise.
3365 * tree.c (cp_auto_var_in_fn_p): Remove.
3366 * decl.c (nonstatic_local_decl_p): Remove.
3367
14588106
RG
33682007-08-20 Richard Guenther <rguenther@suse.de>
3369
3370 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
3371 Remove define.
3372 * tree.h (cp_walk_tree): New define to walk_tree_1 with
3373 cp_walk_subtrees lh parameter.
3374 (cp_walk_tree_without_duplicates): New define to
3375 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
3376 * tree.c (count_trees): Call
3377 cp_walk_tree_without_duplicates.
3378 (verify_stmt_tree): Call cp_walk_tree.
3379 (break_out_target_exprs): Likewise.
3380 (WALK_SUBTREE): Likewise.
3381 * cp-gimplify.c (cp_genericize): Likewise.
3382 * cp-pt.c (find_parameter_packs_r): Likewise.
3383 (uses_parameter_packs): Likewise.
3384 (make_pack_expansion): Likewise.
3385 (check_for_bare_parameter_packs): Likewise.
3386 (for_each_template_parm): Likewise.
3387 * decl.c (check_default_argument): Call
3388 cp_walk_tree_without_duplicates.
3389 * except.c (build_throw): Likewise.
3390 * decl2.c (type_visibility): Likewise.
3391 * semantics.c (expand_or_defer_fn): Likewise.
3392 (finalize_nrv): Call cp_walk_tree.
3393
412bbe81
JJ
33942007-08-20 Jakub Jelinek <jakub@redhat.com>
3395
3396 PR c++/33025
3397 * init.c (build_new_1): Rename placement_var variable to placement_expr.
3398 Initialize it with save_expr rather than get_temp_regvar.
3399
8f4361eb
AP
34002007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
3401
3402 PR c++/28989
3403 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
3404 lvalues.
3405
44fd0e80
OW
34062007-08-17 Ollie Wild <aaw@google.com>
3407
3408 PR c++/31749
3409 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
3410 declarations into appropriate slots for comparison. Fix type
3411 comparison.
3412
2658bdae
PC
34132007-08-17 Paolo Carlini <pcarlini@suse.de>
3414
3415 PR c++/32112
3416 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
3417 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
3418
968fc32d
PC
34192007-08-17 Paolo Carlini <pcarlini@suse.de>
3420
3421 PR c++/32870
3422 * parser.c (cp_parser_class_head): Improve error message.
3423
75407da3
SP
34242007-08-16 Seongbae Park <seongbae.park@gmail.com>
3425
968fc32d
PC
3426 * pt.c (instantiate_decl): Set input_location
3427 for the function end.
75407da3 3428
ac7d7749
KG
34292007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3430
3431 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
3432 Constify.
3433 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
3434 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
3435 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
3436 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
3437 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
3438 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
3439 * typeck.c (cp_type_quals): Likewise.
3440 * typeck2.c (cxx_incomplete_type_diagnostic,
3441 cxx_incomplete_type_error): Likewise.
3442
684939ce
PC
34432007-08-16 Paolo Carlini <pcarlini@suse.de>
3444
3445 PR c++/31132
3446 * pt.c (tsubst_friend_function): When check_classfn
3447 returns error_mark_node likewise return it.
3448
59fe9274
JJ
34492007-08-15 Jakub Jelinek <jakub@redhat.com>
3450
3451 PR c++/32992
3452 * typeck.c (check_return_expr): Don't NRV optimize vars in
3453 anonymous unions.
3454 * decl.c (finish_function): Comment fix.
3455
ba75df2b
PC
34562007-08-15 Paolo Carlini <pcarlini@suse.de>
3457
3458 PR c++/33035
3459 * pt.c (push_template_decl_real): Depending on TYPE_P
3460 use either TYPE_CONTEXT or DECL_CONTEXT.
3461
67f9922b
MM
34622007-08-14 Mark Mitchell <mark@codesourcery.com>
3463
3464 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
3465 constructors and destructors return this.
3466
f8c3b097
PC
34672007-08-14 Paolo Carlini <pcarlini@suse.de>
3468
3469 PR c++/27211
3470 * decl2.c (check_classfn): Return error_mark_node in case of error;
3471 in that case, do not call add_method.
3472 * decl.c (start_decl): Deal with check_classfn returning
3473 error_mark_node.
3474 (grokfndecl): Likewise.
3475 * pt.c (tsubst_friend_function): Likewise.
3476
9ef0c8d9
AP
34772007-08-14 Andrew Pinski <pinskia@gmail.com>
3478
3479 PR c++/30428
3480 * typeck.c (build_binary_op): Disallow vector float types with
3481 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
3482
4862826d
ILT
34832007-08-11 Ian Lance Taylor <iant@google.com>
3484
3485 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
3486 alias_set_type.
b97d8153 3487 * cp-tree.h (cxx_get_alias_set): Update declaration.
4862826d 3488
19831e2b
OW
34892007-08-10 Ollie Wild <aaw@google.com>
3490
3491 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
3492 type lookups.
3493 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
3494 function parameter.
3495 (unqualified_namespace_lookup): Fix ambiguous_decl call.
3496 (lookup_using_namespace): Fix ambiguous_decl call.
3497 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
3498
68a57691
KG
34992007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3500
3501 * call.c (name_as_c_string): Use CONST_CAST.
3502 * decl.c (build_decl): Likewise.
3503 * parser.c (cp_parser_string_literal): Likewise.
3504
2fbe0e5a
PC
35052007-08-10 Paolo Carlini <pcarlini@suse.de>
3506
3507 PR c++/17763
3508 * error.c (dump_expr): Consistently use the *_cxx_*
3509 variants of the pretty-print functions.
3510
caba2081
PC
35112007-08-10 Paolo Carlini <pcarlini@suse.de>
3512
3513 PR c++/22256
3514 * decl.c (check_special_function_return_type): Just error
3515 on return type specified for conversion operator.
3516
d7705934
DB
35172007-08-09 Daniel Berlin <dberlin@dberlin.org>
3518
3519 * typeck2.c (readonly_error): Handle general expressions.
3520 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
3521
af34b82f
DH
35222007-08-06 Dan Hipschman <dsh@google.com>
3523
3524 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
3525 access function name.
3526
5958f5cb
AM
35272007-08-04 Alfred Minarik <a.minarik@aon.at>
3528
3529 PR pch/13676
3530 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
3531 * g++spec.c (lang_specific_driver): Check them.
3532
ae95e46e
PC
35332007-08-06 Paolo Carlini <pcarlini@suse.de>
3534
3535 PR c++/19532
13678df8 3536 * pt.c (inline_needs_template_parms): Fix comment; change return type
ae95e46e
PC
3537 to bool.
3538
9dfbac5b
VR
35392007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
3540
3541 Revert:
3542 2007-03-26 Dirk Mueller <dmueller@suse.de>
3543
3544 * parser.c (cp_parser_member_declaration): Pedwarn
3545 about stray semicolons after member declarations.
f8ff69ea
LM
3546
35472007-08-02 Lee Millward <lee.millward@gmail.com>
3548
3549 PR c++/30849
3550 PR c++/30850
3551 PR c++/30851
3552 * parser.c (cp_parser_asm_definition): Detect and discard asm
3553 statements with invalid inputs or outputs.
3554 (cp_parser_asm_operand_list): Return error mark node if any
3555 of the operands are invalid. Adjust documentation.
3556
e77f031d
NC
35572007-08-02 Nick Clifton <nickc@redhat.com>
3558
3559 * typeck.c: Change copyright header to refer to version 3 of the
3560 GNU General Public License and to point readers at the COPYING3
3561 file and the FSF's license web page.
3562 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
3563 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
3564 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
3565 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
3566 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
3567 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
3568 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
3569 name-lookup.h, parser.c: Likewise.
3570
59f89d34
KG
35712007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3572
3573 PR middle-end/32668
3574 * call.c (magic_varargs_p): Honor the "type generic" attribute.
3575
a6d76a95
PC
35762007-07-30 Paolo Carlini <pcarlini@suse.de>
3577
3578 PR c++/32108
3579 * semantics.c (finish_label_stmt): Reject the __label__
3580 extension outside function scopes.
3581
fa233e34
KG
35822007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3583
3584 * parser.c (eof_token): Un-constify.
3585 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
3586 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
3587 casts.
3588
d732e98f
KH
35892007-07-28 Kazu Hirata <kazu@codesourcery.com>
3590
3591 * pt.c, tree.c, typeck2.c: Fix comment typos.
3592
d4d8c232
SM
35932007-07-28 Simon Martin <simartin@users.sourceforge.net>
3594 Mark Mitchell <mark@codesourcery.com>
3595
3596 PR c++/30917
3597 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
3598 hidden due to friend declarations in local classes.
3599
3ad6a8e1
DG
36002007-07-27 Douglas Gregor <doug.gregor@gmail.com>
3601
3602 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
3603 * cp-tree.def (DECLTYPE_TYPE): New.
3604 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
3605 (dump_type_prefix): Ditto.
3606 (dump_type_suffix): Ditto.
3607 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
3608 * mangle.c (write_type): Handle DECLTYPE_TYPE.
3609 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
3610 types.
3611 (DECLTYPE_TYPE_EXPR): New.
3612 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
3613 (finish_declared_type): Declare.
3614 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
3615 DECLTYPE_TYPE nodes.
3616 (pp_cxx_type_id): Ditto.
3617 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
3618 (tsubst): Substitute into a DECLTYPE_TYPE node.
3619 (tsubst_copy): Ditto.
3620 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
3621 nodes.
3622 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
3623 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
3624 structural equality (because we can't hash the expressions).
3625 (finish_declared_type): New.
3626 * lex.c (reswords): Add "decltype" keyword.
3627 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
3628 (cp_parser_postfix_expression): Add member_access_only_p to
3629 restrict postfix expression to member access expressions.
3630 (cp_parser_unary_expression): Update call to
3631 cp_parser_postfix_expression to reflect new parameter.
3632 (cp_parser_declared_type): New.
3633 (cp_parser_simple_type_specifier): Parse decltype types.
3634
83144bd6
MM
36352007-07-27 Mark Mitchell <mark@codesourcery.com>
3636
3637 PR c++/32346
3638 * call.c (convert_for_arg_passing): Only widen bitfields to their
3639 declared types if necessary.
3640
e5cfc29f
KG
36412007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3642
3643 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
3644 Constify.
3645
741ac903
KG
36462007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3647
3648 * decl.c (typename_hash, typename_compare): Constify.
3649 * mangle.c (hash_type, compare_type): Likewise.
3650 * pt.c (eq_local_specializations, hash_local_specialization):
3651 Likewise.
3652 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
3653 list_hash): Likewise.
3654 * typeck2.c (pat_compare): Likewise.
3655
b21a6ea1
NS
36562007-07-24 Nathan Sidwell <nathan@codesourcery.com>
3657
3658 * method.c (implicitly_declare_fn): Increase alignment if member
3659 function pointer format requires it.
3660
aedfac0e
PC
36612007-07-24 Paolo Carlini <pcarlini@suse.de>
3662
3663 PR c++/29001
3664 * typeck.c (check_return_expr): Do not pass a null argument
3665 to null_ptr_cst_p.
3666
36672007-07-24 Paolo Carlini <pcarlini@suse.de>
3668
3669 PR c++/32561
3670 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
3671 only on VAR_DECL.
3672
4195a767
NS
36732007-07-22 Nathan Sidwell <nathan@codesourcery.com>
3674
823c22f9
NS
3675 PR c++/32839
3676 * typeck.c (convert_arguments): Only use default args if we have
3677 a function decl.
3678
4195a767
NS
3679 PR c++/30818
3680 * typeck.c (structural_comptypes): No need to check
3681 resolve_typename_type return value here.
3682 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
3683 * pt.c (resolve_typename_type): Follow typename typedefs. Return
3684 original type rather than error_mark_node in case of failure.
3685 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
3686 resolve_typename_type result check.
3687 (cp_parser_direct_declarator, cp_parser_head,
3688 cp_parser_constructor_declarator_p): Likewise.
3689
2fe5bb9b
KH
36902007-07-12 Kazu Hirata <kazu@codesourcery.com>
3691
3692 * pt.c (template_parms_variadic_p): Remove.
3693 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
3694
99c1f1ce
JJ
36952007-07-12 Jakub Jelinek <jakub@redhat.com>
3696
3697 PR c++/30854
3698 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
3699 argument to dump_aggr_init_expr_args instead of false.
3700
7313518b
DG
37012007-07-11 Douglas Gregor <doug.gregor@gmail.com>
3702
3703 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
3704 canonical types; otherwise, fall back to structural type
3705 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
3706 internal compiler error if the canonical types are wrong.
3707
b8ade407
PC
37082007-07-11 Paolo Carlini <pcarlini@suse.de>
3709
3710 PR c++/32560
3711 * parser.c (cp_parser_make_indirect_declarator): When the
3712 the code argument is ERROR_MARK return cp_error_declarator.
3713
837edd5f
GK
37142007-07-09 Geoffrey Keating <geoffk@apple.com>
3715
3716 PR 32617
3717 * decl.c (cxx_init_decl_processing): Don't set
3718 force_align_functions_log.
3719 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
3720 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
3721 FUNCTION_DECL, return its alignment.
3722
f967586f
RG
37232007-07-09 Richard Guenther <rguenther@suse.de>
3724
3725 * decl.c (start_preparsed_function): Do not promote return type.
3726
833be229
PC
37272007-07-08 Paolo Carlini <pcarlini@suse.de>
3728
3729 PR c++/30535
3730 * pt.c (unify): Never pass error_mark_node to template_decl_level.
3731
acde59b4
MM
37322007-07-07 Mark Mitchell <mark@codesourcery.com>
3733
3734 PR c++/32232
3735 * pt.c (resolve_overloaded_unification): Robustify. Return a
3736 bool, not an int.
3737 (type_unification_real): Adjust accordingly.
3738
b5119fa1
RG
37392007-07-06 Richard Guenther <rguenther@suse.de>
3740
3741 * init.c (build_new_1): Use the correct pointer type.
3742 * typeck2.c (build_m_component_ref): Likewise.
3743
32a11c08
MM
37442007-07-05 Mark Mitchell <mark@codesourcery.com>
3745
3746 PR c++/32245
3747 * init.c (build_zero_init): Always build an initializer for
3748 non-static storage.
3749 * typeck2.c (build_functional_cast): Use build_zero_init.
3750
3751 PR c++/32251
3752 * init.c (build_new_1): Always pass the allocation function to
3753 build_op_delete_call.
3754 * call.c (build_op_delete_call): Handle operator delete with a
3755 variable-argument list. Do not issue an error when no matching
3756 deallocation function is available for a new operator.
3757
3758 PR c++/31992
3759 * cp-tree.h (any_value_dependent_elements_p): Declare it.
3760 * decl.c (value_dependent_init_p): New function.
3761 (cp_finish_decl): Use it.
3762 * pt.c (value_dependent_expression_p): Use
3763 any_value_dependent_elements_p.
3764 * parser.c (cp_parser_primary_expression): Add comment about
3765 treating dependent qualified names as integral
3766 constant-expressions.
3767
8de08f4c
DG
37682007-07-04 Douglas Gregor <doug.gregor@gmail.com>
3769
3770 * decl.c (build_ptrmemfunc_type): Always use structural equality
3771 tests when comparing pointer-to-member-function types, because the
3772 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
3773 types.
3774
57ccb546
MM
37752007-07-03 Mark Mitchell <mark@codesourcery.com>
3776
3777 * init.c (build_new): Tweak comment.
3778
39fb9d72
DB
37792007-06-29 Dave Brolley <brolley@redhat.com>
3780
3781 PR c++/31743
3782 * parser.c (cp_parser_new_type_id): Don't reduce a named array
3783 type to its base type and number of elements here.
3784 * init.c (build_new): Call complete_type_or_else to ensure that the
3785 type is complete and to issue a diagnostic if it is not.
3786 (build_new_1): Don't call complete_type_or_else here.
3787
e656a465
RG
37882007-07-03 Richard Guenther <rguenther@suse.de>
3789
3790 PR c++/32609
3791 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
3792 after recursing.
3793
2a7b8343
SB
37942007-07-02 Simon Baldwin <simonb@google.com>
3795
3796 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
3797 for inner-style nested forward declarations that don't declare
3798 anything useful.
3799
76dc15d4
JJ
38002007-07-02 Jakub Jelinek <jakub@redhat.com>
3801
3802 PR c++/31748
3803 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
3804 DECL_P in not a variable and appears more than once error messages.
3805
af92ab36
OW
38062007-07-01 Ollie Wild <aaw@google.com>
3807
3808 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
3809 (select_decl): Remove function.
3810 (unqualified_namespace_lookup): Populate binding by calling
3811 ambiguous_decl. Remove select_decl call.
3812 (lookup_qualified_name): Remove select_decl call.
3813 * decl.c (lookup_and_check_tag): Check for ambiguous references.
3814 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
3815 generation when name lookup is ambiguous.
3816
bfa8d90b
DG
38172007-06-29 Douglas Gregor <doug.gregor@gmail.com>
3818
3819 PR c++/31724
3820 * init.c (build_new_1): Use structural equality on the copy of the
3821 array type.
3822
ddbfd28d
GK
38232007-06-28 Geoffrey Keating <geoffk@apple.com>
3824
3825 * decl2.c (determine_visibility): Implement
3826 flag_visibility_ms_compat effect on type info.
3827 * decl.c (cxx_init_decl_processing): Implement
3828 global effect of flag_visibility_ms_compat.
3829
32d49134
GK
38302007-06-28 Geoffrey Keating <geoffk@apple.com>
3831
e301e2c4 3832 * decl2.c (start_objects): Mark constructor-running function
32d49134
GK
3833 as artificial.
3834
b46ce77f
SM
38352007-06-26 Simon Martin <simartin@users.sourceforge.net>
3836
3837 PR c++/32111
3838 * decl.c (grokdeclarator): Reset friendp for member functions declared
3839 friend of their own class.
3840
3a687f8b
MM
38412007-06-23 Mark Mitchell <mark@codesourcery.com>
3842
3843 * decl2.c (determine_visibility): Don't look for dllexport here.
3844 (determine_visibility_from_class): Tidy.
3845
736b8100
SB
38462007-06-18 Simon Baldwin <simonb@google.com>
3847
3848 PR c++/31923
3849 * parser.c (cp_parser_single_declaration): Added check for storage
3850 class other than sc_none in parsed declaration, and a flag to indicate
3851 if the call is part of an explicit template specialization parse.
3852 * (cp_parser_explicit_specialization): Specialization check flag added
3853 to call to cp_parser_single_declaration(), set true.
3854 * (cp_parser_template_declaration_after_export): Specialization check
3855 flag added to call to cp_parser_single_declaration(), set false.
3856 * pt.c (check_explicit_specialization): Added code to copy visiblity
3857 and linkage from the templated function to the explicit specialization.
3858
5be014d5
AP
38592007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
3860
3861 * typeck.c (build_binary_op): For templates build the
3862 expression in pieces to avoid the assert in build2_stat.
3863 (get_member_function_from_ptrfunc):
3864 Change over to using POINTER_PLUS_EXPR and convert
3865 the second operand to sizetype.
3866 * typeck2.c (build_m_component_ref): Likewise.
3867 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
3868 instead of PLUS_EXPR for pointers.
3869 (build_new_1): Likewise.
3870 (build_vec_delete_1): Likewise.
3871 (build_vec_delete): Likewise.
3872 * class.c (build_base_path): Likewise.
3873 (build_base_path): Likewise.
3874 (convert_to_base_statically): Likewise.
3875 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
3876 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
3877 instead of PLUS_EXPR.
3878 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
3879 instead of PLUS_EXPR for pointers.
3880 * call.c (build_special_member_call): Likewise.
3881 * rtti.c (build_headof): Likewise.
3882 Use sizetype instead of ptrdiff_type_node.
3883 (tinfo_base_init): Create a POINTER_PLUS_EXPR
3884 instead of PLUS_EXPR for pointers.
3885 * except.c (expand_start_catch_block): Do a
3886 NEGATIVE and then a POINTER_PLUS_EXPR instead
3887 of a MINUS_EXPR.
3888 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
3889 PLUS_EXPR on pointer types over to use
3890 POINTER_PLUS_EXPR and remove the conversion
3891 to the pointer types.
3892 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
3893 adding to a pointer type. Use size_int instead of
3894 ssize_int. Convert the index to sizetype before
3895 adding it to the pointer.
3896
555551c2
MM
38972007-06-15 Mark Mitchell <mark@codesourcery.com>
3898
3899 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
3900 (DECL_ANON_UNION_VAR_P): New macro.
3901 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
3902 than DECL_VAR_MARKED_P, to keep track of which variables we have
3903 seen.
3904 * decl.c (redeclaration_error_message): Complain about redeclaring
3905 anonymous union members at namespace scope.
3906 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
3907
7dbd86a5
GK
39082007-06-14 Geoff Keating <geoffk@apple.com>
3909
c96f0001
GK
3910 * decl2.c (determine_visibility): Ensure that functions with
3911 hidden types as parameters are hidden.
3912
7dbd86a5
GK
3913 PR 31093
3914 * decl2.c (determine_visibility): Remove duplicate code for
3915 handling type info.
3916
058dcc25
ILT
39172007-06-12 Ian Lance Taylor <iant@google.com>
3918
3919 PR libstdc++/29286
3920 * init.c (avoid_placement_new_aliasing): New static function.
3921 (build_new_1): Call it.
3922
b0464c88
RE
39232007-06-11 Rafael Avila de Espindola <espindola@google.com>
3924
3925 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
3926 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
3927
969c111d
JJ
39282007-06-08 Jakub Jelinek <jakub@redhat.com>
3929
3930 PR c++/32177
3931 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
3932 on init, the non-decl cond operand and increment value.
3933
c1ae8be5
SM
39342007-06-07 Simon Martin <simartin@users.sourceforge.net>
3935
3936 PR c++/30759
3937 * decl.c (check_initializer): Report an error when a brace enclosed
3938 initializer is used for a non-aggregate type in C++98.
3939 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
3940 cxx_dialect.
3941 (grokdeclarator): Likewise.
3942 (move_fn_p): Likewise.
3943 * typeck.c (check_return_expr): Likewise.
3944 * call.c (reference_binding): Likewise.
3945 * error.c (cp_cpp_error): Likewise.
3946 * pt.c (check_default_tmpl_args): Likewise.
3947 (tsubst): Likewise.
3948 * lex.c (init_reswords): Likewise.
3949 * parser.c (p_parser_primary_expression): Likewise.
3950 (TOKEN_PRECEDENCE): Likewise.
3951 (cp_parser_init_declarator): Likewise.
3952 (cp_parser_ptr_operator): Likewise.
3953 (cp_parser_parameter_declaration): Likewise.
3954 (cp_parser_enclosed_template_argument_list): Likewise.
3955 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
3956 (cp_parser_next_token_ends_template_argument_p): Likewise.
3957
b08f991d
SB
39582007-06-04 Simon Baldwin <simonb@google.com>
3959
3960 * decl.c (grokdeclarator): Readability change. Moved case labels
3961 into direct switch statement scope.
3962
cab203bf
PC
39632007-06-04 Paolo Carlini <pcarlini@suse.de>
3964
3965 * call.c (convert_like_real): Remove pointless code.
3966
46a9e521
MM
39672007-05-31 Mark Mitchell <mark@codesourcery.com>
3968
3969 * decl.c (get_atexit_fn_ptr_type): New function.
3970 (get_atexit_node): Use it.
3971 (start_cleanup_fn): Likewise.
3972 (register_dtor_fn): Use the object's destructor, instead of a
3973 separate cleanup function, where possible.
3974 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
3975 (atexit_fn_ptr_type_node): New macro.
3976 * decl2.c (build_cleanup): Use build_address.
3977
2c751309
DB
39782007-05-31 Daniel Berlin <dberlin@dberlin.org>
3979
3980 * typeck.c (build_binary_op): Include types in error.
3981
32735518
JJ
39822007-05-31 Jakub Jelinek <jakub@redhat.com>
3983
3984 PR c++/31806
3985 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
3986 needs runtime initialization.
3987
10c1d4af
PC
39882007-05-31 Paolo Carlini <pcarlini@suse.de>
3989
3990 PR c++/32158
3991 * semantics.c (finish_trait_expr): Complete the types.
3992
8af2fec4
RY
39932007-05-30 Russell Yanofsky <russ@yanofsky.org>
3994 Douglas Gregor <doug.gregor@gmail.com>
3995 Pedro Lamarao <pedro.lamarao@mndfck.org>
3996 Howard Hinnant <howard.hinnant@gmail.com>
3997
3998 PR c++/7412
3999 PR c++/29939
4000 * typeck.c (comptypes): Don't consider rvalue and lvalue
4001 reference types to be equivalent.
4002 (check_return_expr): Move from certain lvalues when returning
4003 them.
4004 * decl.c (grokdeclarator): Implement reference collapsing.
4005 (copy_fn_p): Don't consider constructors taking rvalue references
4006 to be copy constructors.
4007 (move_fn_p): New.
5be014d5 4008 * call.c (conversion): New "rvaluedness_matches_p" member.
8af2fec4
RY
4009 (convert_class_to_reference): Require reference type as first
4010 parameter instead of base type.
4011 (reference_binding): Add logic to handle rvalue references.
4012 (implicit_conversion): Update inaccurate comment.
4013 (convert_like_real): Disable creation of temporaries that are
4014 impossible to initialize for types with move constructors.
4015 (build_over_call): Elide move constructors when possible.
4016 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
4017 (maybe_handle_ref_bind): Return conversion instead of type node.
4018 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
4019 determine preferred conversion sequences.
4020 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
4021 (LOOKUP_PREFER_RVALUE): New.
4022 (DECL_MOVE_CONSTRUCTOR_P): New.
4023 (struct cp_declarator): Add "reference" member for reference
4024 types, with new "rvalue_ref" flag.
4025 (cp_build_reference_type): Declare.
4026 (move_fn_p): Declare.
4027 * error.c (dump_type_prefix): Format rvalue reference types
4028 correctly in error messages.
4029 * except.c (build_throw): Move from certain lvalues when
4030 throwing.
4031 * mangle.c (write_type): Mangle rvalue references differently
4032 than regular references.
4033 * parser.c (make_reference_declarator): Add boolean parameter for
4034 rvalue references.
4035 (cp_parser_make_indirect_declarator): New.
4036 (cp_parser_new_declarator_opt): Call
4037 cp_parser_make_indirect_declarator.
4038 (cp_parser_conversion_declarator_opt): Ditto.
4039 (cp_parser_declarator): Ditto.
4040 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
4041 declarators.
4042 * pt.c (tsubst): Implement reference collapsing.
4043 (maybe_adjust_types_for_deduction): Implement special template
4044 parameter deduction rule for rvalue references.
4045 (type_unification_real): Update calls to
4046 maybe_adjust_types_for_deduction.
4047 (try_one_overload): Ditto.
4048 (unify_pack_expansion): Ditto.
4049 * tree.c (lvalue_p_1): Handle rvalue reference types.
4050 (cp_build_reference_type): New.
4051
27edb548
JJ
40522007-05-30 Jakub Jelinek <jakub@redhat.com>
4053
4054 PR c++/31809
4055 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
4056 variables that need runtime initialization.
4057
a87db577
AP
40582007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
4059
5be014d5 4060 PR c++/31339
a87db577
AP
4061 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
4062 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
4063 case POSTDECREMENT_EXPR>): Return the error_mark_node
4064 if either the real or imaginary parts would an
4065 error_mark_node.
4066
1094da91
SM
40672007-05-25 Simon Martin <simartin@users.sourceforge.net>
4068 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4069
4070 PR c++/31745
4071 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
4072 token is a closing brace, false if there are no tokens left.
4073 (cp_parser_namespace_alias_definition): Only consume the next token if
4074 it is a closing brace.
4075
4076 * parser.c (cp_parser_class_specifier): Likewise.
4077
eb89f88c
L
40782007-05-25 H.J. Lu <hongjiu.lu@intel.com>
4079
4080 * semantics.c (finish_member_declaration): Fix a typo in the
4081 last checkin.
4082
b1d7b1c0
DG
40832007-05-25 Douglas Gregor <doug.gregor@gmail.com>
4084
4085 PR c++/31431
4086 PR c++/31432
4087 PR c++/31434
4088 PR c++/31435
4089 PR c++/31437
4090 PR c++/31438
4091 PR c++/31442
4092 PR c++/31443
4093 PR c++/31444
4094 PR c++/31445
4095 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
4096 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
4097 * pt.c (check_for_bare_parameter_packs): Return bool indicated
4098 whether everything was okay. Fix indentation.
4099 (push_template_decl_real): Check for bare parameter packs in
4100 function parameters; where errors occur, mark the parameter types
4101 with ERROR_MARK_NODEs to avert ICEs.
4102 (coerce_template_parameter_pack): New.
4103 (coerce_template_parms): Moved parameter pack coercion into
4104 coerce_template_parameter_pack, and permit it anywhere in the
4105 template parameter list (not just at the end). Parameter and
4106 argument indices can vary (somewhat) separately now, so add
4107 PARM_IDX and ARG_IDX.
4108 (fn_type_unification): Don't set an argument pack as incomplete if
4109 no argument pack was deduced.
4110 (type_unification_real): If a type parameter is a parameter pack
4111 and has not otherwise been deduced, it will be deduced to an empty
4112 parameter pack.
4113 (more_specialized_fn): Use the actual lengths of the argument
4114 lists when comparing against expansions.
4115 * semantics.c (finish_member_declaration): If a field's type has
4116 bare parameter packs, error and set its type to ERROR_MARK_NODE.
4117
5234b8f5
DS
41182007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
4119
4120 PR target/27067
4121 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
4122
8e89cbfe
OW
41232007-05-22 Ollie Wild <aaw@google.com>
4124
4125 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
4126 (unqualified_namespace_lookup): Adds check for hidden types.
4127
6936461f
OW
41282007-05-22 Ollie Wild <aaw@google.com>
4129
4130 * decl.c (duplicate_decls): Verify namespace names are unique.
4131
5c113154
MM
41322007-05-21 Mark Mitchell <mark@codesourcery.com>
4133
4134 * decl.c (cxx_maybe_build_cleanup): Handle
4135 __attribute__((cleanup)).
4136
7060db96
MLI
41372007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4138
4139 * cvt.c (cp_convert_and_check): Don't check warnings if the
4140 conversion failed.
4141
8d5b1b67
GK
41422007-05-18 Geoffrey Keating <geoffk@apple.com>
4143
4144 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
4145
9c49a5e4
PC
41462007-05-14 Paolo Carlini <pcarlini@suse.de>
4147
4148 PR c++/29928
4149 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
4150 type only if is a class type (5.2.8/4).
4151
ca5ba2a3
RAE
41522007-05-14 Rafael Avila de Espindola <espindola@google.com>
4153
4154 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
4155 * decl.c (grokdeclarator): Use unsigned_type_for instead of
4156 c_common_unsigned_type.
4157
79bedddc
SR
41582007-05-11 Silvius Rus <rus@google.com>
4159
b97d8153 4160 * typeck.c (build_indirect_ref): Add call to
79bedddc
SR
4161 strict_aliasing_warning.
4162 (build_reinterpret_cast_1): Condition call to
4163 strict_aliasing_warning.
4164
7be82279
JH
41652007-05-11 Jan Hubicka <jh@suse.cz>
4166
4167 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
4168 * decl2.c (start_objects): ctors and dtors are no longer public.
4169 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
4170
ee72fa38
AP
41712007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
4172
4173 * typeck.c (build_unary_op): Remove code that used to
4174 handle non lvalue increments/decrements.
4175
841cc7da
MS
41762007-05-07 Mike Stump <mrs@apple.com>
4177
4178 * parser.c (check_empty_body): Add.
4179 (cp_parser_iteration_statement): Add call to check_empty_body.
4180
a2aa65f0
GK
41812007-05-05 Geoffrey Keating <geoffk@apple.com>
4182
4183 PR 31775
4184 * mangle.c (write_mangled_name): Mangle static variable names.
4185 (write_unqualified_name): Use local-source-name for
4186 namespace-scope static variables.
4187
820b51ae
DM
41882007-05-04 Dirk Mueller <dmueller@suse.de>
4189
4190 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
4191 not in effect.
4192
ba992967
SP
41932007-05-02 Seongbae Park <seongbae.park@gmail.com>
4194
4195 PR c++/31663
4196 * decl2.c (constrain_class_visibility):
4197 Use strip_pointer_or_array_types instead of strip_array_types.
4198
70ec16f7
AP
41992007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
4200
4201 PR C++/30221
4202 * decl.c (reshape_init_r): Don't reshape the first element if it
4203 is a pointer to member function.
4204
631ee856
SB
42052007-04-27 Simon Baldwin <simonb@google.com>
4206
4207 * decl.c (grokparms): Changed message format from %qD to %qE.
4208
4af96f9f
DG
42092007-04-27 Douglas Gregor <doug.gregor@gmail.com>
4210
4211 * error.c (maybe_warn_variadic_templates): Variadic templates are
4212 now in C++0x, so only warn about them in C++98 mode.
4213
d333b74f
AP
42142007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
4215
4216 PR C++/30016
4217 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
4218 integeral types from vectors types.
4219
6f719560
JJ
42202007-04-26 Jakub Jelinek <jakub@redhat.com>
4221
4222 PR c++/31598
4223 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
4224 for type dependent OMP_CLAUSE_DECLs.
4225
b8063b29
MM
42262007-04-24 Mark Mitchell <mark@codesourcery.com>
4227
fb0b79e5 4228 PR c++/31338
b8063b29
MM
4229 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
4230 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
4231 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
4232 * init.c (build_zero_init): Adjust, as
4233 COMPLEX_TYPE is now a SCALAR_TYPE.
4234 * typeck2.c (digest_init): Allow brace-enclosed initializers for
4235 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
4236
b29441ec
PC
42372007-04-25 Paolo Carlini <pcarlini@suse.de>
4238
4239 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
4240 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
4241 (trait_expr_value): Adjust.
4242
0d83bf5a
SB
42432007-04-23 Simon Baldwin <simonb@google.com>
4244
4245 * decl.c (grokparms): Added new error for duplicate function
4246 parameters names in function prototypes, to match gcc behavior.
4247
09191b7e
JH
42482007-04-23 Jan Hubicka <jh@suse.cz>
4249
b97d8153 4250 * decl2.c (finish_objects): Do not call target constructor/destructor
09191b7e
JH
4251 bits dirrectly.
4252
3d95caa4
AP
42532007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
4254
4255 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
4256 instead of checking GIMPLE_STMT_P in chain_next.
4257
431ed7a1
MM
42582007-04-17 Mark Mitchell <mark@codesourcery.com>
4259
4260 PR c++/31513
4261 * call.c (convert_for_arg_passing): Convert bitfields to their
4262 declared types.
4263
f01ec37d
SM
42642007-04-17 Simon Martin <simartin@users.sourceforge.net>
4265
4266 PR c++/31517
4267 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
4268
fe24078a
SP
42692007-04-16 Seongbae Park <seongbae.park@gmail.com>
4270
4271 PR c++/29365
b97d8153 4272 * decl2.c (constrain_class_visibility):
fe24078a
SP
4273 Do not warn about the use of anonymous namespace in the main input file.
4274
cac4ddf0
MM
42752007-04-15 Mark Mitchell <mark@codesourcery.com>
4276
4277 * cp-tree.h (current_template_parms): Fix typo in comment.
4278
a57a55de
KH
42792007-04-15 Kazu Hirata <kazu@codesourcery.com>
4280
4281 * cp-tree.h, error.c: Fix comment typos.
4282
44ba4c4e
JM
42832007-04-13 Jason Merrill <jason@redhat.com>
4284
4285 PR c++/31074
4286 * call.c (reference_binding): Add c_cast_p parm. If true,
4287 add quals to TO as needed to make it reference-compatible.
4288
ffd34392
JH
42892007-04-11 Jan Hubicka <jh@suse.cz>
4290
b97d8153 4291 * class.c (convert_to_base_statically): Fold produced tree; verify
ffd34392
JH
4292 that we are not processing template_decl.
4293
a607b96e
MM
42942007-04-09 Mark Mitchell <mark@codesourcery.com>
4295
4296 PR c++/31449
4297 * class.c (build_base_path): Ensure that the converted pointer has
4298 the same cv-qualification as the input.
4299
ea798d0f
PC
43002007-04-09 Paolo Carlini <pcarlini@suse.de>
4301
4302 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
4303
cb9c159d
SB
43042007-04-08 Steven Bosscher <steven@gcc.gnu.org>
4305
4306 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
4307 Do not set it.
4308 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
4309 * tree.c (cp_add_pending_fn_decls): Remove.
4310 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
4311
270c60bb
DB
43122007-04-07 Daniel Berlin <dberlin@dberlin.org>
4313
4314 Revert change removing staticp.
4315
1df918ac
DB
43162007-04-06 Daniel Berlin <dberlin@dberlin.org>
4317
4318 * cp-objcp-common.c (cxx_staticp): Remove.
4319 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
4320 * cp-tree.h (cxx_staticp):
4321
6acd8838
DS
43222007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
4323
4324 * class.c (check_for_override): Don't remove dllmport attribute
4325 of virtual methods.
4326
df3473fa
JJ
43272007-04-03 Jakub Jelinek <jakub@redhat.com>
4328
4329 PR c++/30847
4330 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
4331 type issue error and return early.
4332
c3b7031d
JM
43332007-03-30 Jason Merrill <jason@redhat.com>
4334
4335 PR c++/31187
4336 * typeck.c (cp_type_readonly): New fn.
4337 * cp-tree.h: Declare it.
4338 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
4339 (cp_finish_decl): Not here.
4340
6be42dd4
RG
43412007-03-31 Richard Guenther <rguenther@suse.de>
4342
4343 * optimize.c (maybe_clone_body): Replace splay-tree usage by
4344 pointer-map.
4345
d393153e
DG
43462007-03-31 Douglas Gregor <doug.gregor@gmail.com>
4347
4348 PR c++/31138
4349 PR c++/31140
4350 PR c++/31141
4351 * parser.c (declarator_can_be_parameter_pack): New.
4352 (cp_parser_template_parameter): Only parse the `...' if the
4353 declarator can be a parameter pack.
4354 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
4355 is NULL.
4356 * pt.c (find_parameter_packs_r): Look into the bounds on integer
4357 types (they could be used as array bounds).
4358 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
4359 (tsubst_pack_expansion): Handle failure to expand parameter
4360 packs.
4361
cb68ec50
PC
43622007-03-30 Paolo Carlini <pcarlini@suse.de>
4363
4364 PR c++/26099
4365 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
4366 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
4367 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
4368 (CLASS_TYPE_NON_UNION_P): Add.
4369 (struct lang_type_class): Add has_complex_dflt.
4370 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
4371 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
4372 * cp-tree.def: Add TRAIT_EXPR.
4373 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
4374 * lex.c (struct resword): Add __has_nothrow_assign,
4375 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
4376 __has_trivial_constructor, __has_trivial_copy,
4377 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
4378 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
4379 __is_pod, __is_polymorphic, __is_union.
4380 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
4381 (cp_parser_trait_expr): New.
4382 * semantics.c (finish_trait_expr, trait_expr_value
4383 classtype_has_nothrow_copy_or_assign_p): New.
4384 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
4385 as static.
4386 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
4387 * class.c (check_bases, check_field_decl, check_bases_and_members):
4388 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
4389 * pt.c (uses_template_parms, tsubst_copy_and_build,
4390 value_dependent_expression_p, type_dependent_expression_p): Deal with
4391 TRAIT_EXPR.
4392 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
4393
2a42f4aa
RG
43942007-03-29 Richard Guenther <rguenther@suse.de>
4395
4396 * tree.c (cp_walk_subtrees): Do not set input_location.
4397
71aea5f2
SM
43982007-03-28 Simon Martin <simartin@users.sourceforge.net>
4399
4400 PR c++/29077
4401 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
4402 destructor.
4403
a2ca1ab2
DG
44042007-03-28 Douglas Gregor <doug.gregor@gmail.com>
4405
4406 * parser.c (struct cp_parser): Update comment for
4407 greater_than_is_operator_p.
4408 (cp_parser_primary_expression): In C++0x mode, a cast operator can
4409 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
4410 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
4411 !GREATER_THAN_IS_OPERATOR_P.
4412 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
4413 `>>' operators that will become two `>' tokens in C++0x.
4414 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
4415 mode, allowing it to terminate default arguments.
4416 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
4417 `>>' like two consecutive `>' tokens.
4418 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
4419 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
4420 ends a template argument.
4421
9b7dd5e8
DG
44222007-03-28 Douglas Gregor <doug.gregor@gmail.com>
4423
4424 * decl.c (redeclaration_error_message): Complain when redeclaring
4425 a friend function with default template arguments (C++0x mode only).
4426 * cp-tree.h (check_default_tmpl_args): Declare.
4427 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
4428 template arguments in function templates. Add support for checking
4429 the default template arguments of friend templates.
4430 (push_template_decl_real): Fix call to check_default_tmpl_args.
4431 (type_unification_real): If a template parameter has not been
4432 deduced but provides a default template argument, substitute into
4433 that default template argument.
4434 * parser.c (cp_parser_init_declarator): When declaring (but not
4435 defining!) a function template in C++0x mode, check for default
4436 template arguments.
4437
771026dd
DG
44382007-03-28 Douglas Gregor <doug.gregor@gmail.com>
4439
4440 PR c++/29993
4441 * decl.c (grokdeclarator): Deal with cv-qualified function type
4442 typedefs in the same way for member and non-member functions.
4443
df12b78f
DM
44442007-03-26 Dirk Mueller <dmueller@suse.de>
4445
4446 * parser.c (cp_parser_member_declaration): Pedwarn
4447 about stray semicolons after member declarations.
4448
912291ca
PC
44492007-03-26 Paolo Carlini <pcarlini@suse.de>
4450
4451 PR c++/30500
4452 * pt.c (instantiate_decl): Set in_system_header.
4453
8b84995a
MM
44542007-03-22 Mark Mitchell <mark@codesourcery.com>
4455
03c17ccd
MM
4456 * cp-tree.h (current_tempalte_parms): Improve documentation.
4457 * pt.c (current_template_args): Likewise.
4458
8b84995a
MM
4459 PR c++/30863
4460 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
4461 not consume tokens when failing.
4462
725d6b87
MM
44632007-03-22 Jim Wilson <wilson@specifix.com>
4464 Mark Mitchell <mark@codesourcery.com>
4465
4466 PR c++/31273
4467 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
4468 consistent with FROM.
4469
5a023baa
GDR
44702007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
4471
4472 * error.c (dump_expr): Handle dependent names that designate types.
4473 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
4474
a757b5c5
KH
44752007-03-17 Kazu Hirata <kazu@codesourcery.com>
4476
4477 * cp-tree.def, parser.c, pt.c: Fix comment typos.
4478
07231d4f
MLI
44792007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4480
4481 * cvt.c (cp_convert_and_check) : Define.
4482 * cp-tree.h (cp_convert_and_check): Declare.
4483 * call.c (convert_conversion_warnings): Rename to
4484 conversion_null_warnings. The warning for floating-point to
4485 integer is handled by convert_and_check in convert_like_real.
4486 (convert_like_real): convert_conversion_warnings was renamed as
4487 conversion_null_warnings.
4488 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
4489 overflow and changes of value during conversion.
4490
2ce88bea
MLI
44912007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4492
4493 PR c++/30891
4494 * parser.c (cp_parser_statement): If 'namespace' is found, this
4495 only can be a namespace alias definition, so parse it now.
4496 (cp_parser_namespace_alias_definition): if we find an open brace
4497 instead of '=', then this is actually a misplaced namespace
4498 definition.
4499
9b439fe1
MLI
45002007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4501
4502 PR c++/24924
4503 * decl.c (cxx_init_decl_processing): Move command-line options
4504 processing to c-opts.c.
4505
30bcc028
DG
45062007-03-15 Douglas Gregor <doug.gregor@gmail.com>
4507
4508 * ptree.c (cxx_print_type): Use formatting markup for integers
4509 when printing template parameter index/level/orig level.
4510 (cxx_print_xnode): Ditto.
4511 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
4512 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
4513 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
4514 HOST_WIDE_INTs.
4515 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
4516 rather than a HOST_WIDE_INT.
4517 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
4518 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
4519 better bit-packing.
4520 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
4521 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
4522 IN_BASE_INITIALIZER bool bitfields.
4523 (struct cp_declarator): Make KIND a 4-bit field. Make
4524 PARAMETER_PACK_P a bool bitfield just after KIND.
4525 * pt.c (uses_parameter_packs): Destroy the pointer set.
4526 (make_pack_expansion): Ditto.
4527 (check_for_bare_parameter_packs): Ditto.
4528 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
4529
344bd5a8
AP
45302007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
4531
4532 PR c++/31165
4533 * call.c (convert_default_arg): Instead of copying the node,
4534 unshare it.
4535
1f7f19c4
DM
45362007-03-15 Dirk Mueller <dmueller@suse.de>
4537
4538 PR c++/30860
4539 * call.c (convert_conversion_warnings): New..
4540 (convert_like_real): .. factored out from here.
4541 (convert_conversion_warnings): Add warning about
4542 false being converted to NULL in argument passing.
4543
62e00e94
DM
45442007-03-14 Dirk Mueller <dmueller@suse.de>
4545
b97d8153 4546 * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
62e00e94
DM
4547 (finish_do_body): Warn about empty body in do/while statement.
4548
286d12f9
MLI
45492007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4550
4551 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
4552
2e9cb75e
MLI
45532007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4554
4555 PR c/21438
4556 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
4557 warning.
4558
403d4851
AO
45592007-03-13 Alexandre Oliva <aoliva@redhat.com>
4560
b97d8153 4561 * repo.c (init_repo): Initialize random_seed saved options.
403d4851
AO
4562 (finish_repo): Adjust.
4563
4844b167
MM
45642007-03-13 Mark Mitchell <mark@codesourcery.com>
4565
4566 PR bootstrap/30899
4567 * Make-lang.in (doc/g++.1): Use $< to specify the location from
4568 which to copy.
4569
50d50fc7
SP
45702007-03-12 Seongbae Park <seongbae.park@gmail.com>
4571
4572 * decl.c (compute_array_index_type): New warning flag warn_vla.
4573
3026f2df
MM
45742007-03-12 Mark Mitchell <mark@codesourcery.com>
4575
4576 PR c++/30108
4577 * call.c (convert_default_arg): Copy non-constant arguments.
4578
3c38f0ff
MM
45792007-03-11 Mark Mitchell <mark@codesourcery.com>
4580
4581 PR c++/31038
4582 * parser.c (cp_parser_postfix_expression): Disallow compound
4583 literals in constant expressions.
4584
4585 PR c++/30328
4586 * semantics.c (finish_typeof): Use unlowered_expr_type.
4587
f9aa54d3
MM
45882007-03-10 Mark Mitchell <mark@codesourcery.com>
4589
4590 PR c++/30274
4591 * cp-tree.h (unlowered_expr_type): New function.
4592 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
4593 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
4594 (unlowered_expr_type): New function.
4595 (build_unary_op): Disallow predecrements of bool bitfields.
4596 * call.c (build_conditional_expr): Use unlowered_expr_type.
4597 * pt.c (type_unification_real): Likewise.
4598
5d80a306
DG
45992007-03-09 Douglas Gregor <doug.gregor@gmail.com>
4600
4601 PR c++/20599
4602 * typeck.c (check_return_expr): Check for bare parameter packs.
4603 (comptypes): Compare template parameter packs and
4604 type pack expansions.
4605 * decl.c (grokdeclarator): Deal with the declaration of function
4606 parameter packs.
4607 (grokparms): Verify that the (optional) function parameter pack is
4608 at the end of the parameter list.
4609 (xref_basetypes): Handle pack expansions in the base class.
4610 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
4611 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
4612 (NONTYPE_ARGUMENT_PACK): New.
4613 (TYPE_PACK_EXPANSION): New.
4614 (EXPR_PACK_EXPANSION): New.
4615 (ARGUMENT_PACK_SELECT): New.
4616 * cp-objcp-common.c (cp_tree_size): Compute size of
4617 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
4618 ARGUMENT_PACK_SELECT.
4619 * error.c (dump_template_argument): Print template argument packs.
4620 (dump_template_argument_list): Ditto.
4621 (dump_template_parameter): Dump `...' for template type parameter
4622 packs.
4623 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
4624 (dump_parameters): Print function parameter packs.
4625 (dump_template_parms): Print template argument packs.
4626 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
4627 (maybe_warn_variadic_templates): New.
4628 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
4629 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
4630 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
4631 CAST_EXPR.
4632 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
4633 (write_template_arg): Write argument packs as separate arguments.
4634 * cp-tree.h (struct template_parm_index_s): Add flag that
4635 indicates that the template parameter is actually a parameter
4636 pack.
4637 (struct tree_argument_pack_select): New.
4638 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
4639 (union lang_tree_node): Add argument_pack_select.
4640 (FUNCTION_PARAMETER_PACK_P): New.
4641 (PACK_EXPANSION_P): New.
4642 (PACK_EXPANSION_PATTERN): New.
4643 (SET_PACK_EXPANSION_PATTERN): New.
4644 (PACK_EXPANSION_PARAMETER_PACKS): New.
4645 (ARGUMENT_PACK_P): New.
4646 (ARGUMENT_PACK_ARGS): New.
4647 (SET_ARGUMENT_PACK_ARGS): New.
4648 (ARGUMENT_PACK_INCOMPLETE_P): New.
4649 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
4650 (TEMPLATE_PARM_PARAMETER_PACK): New.
4651 (TEMPLATE_TYPE_PARAMETER_PACK): New.
4652 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
4653 (ARGUMENT_PACK_SELECT_INDEX): New.
4654 (ARGUMENT_PACK_SELECT_ARG): New.
4655 (struct cp_declarator): Add parameter_pack_p flag.
4656 (maybe_warn_variadic_templates): Declare.
4657 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
4658 indicate a template parameter pack.
4659 (uses_parameter_packs): Declare.
4660 (template_parameter_pack_p): Declare.
4661 (template_parms_variadic_p): Declare.
4662 (make_pack_expansion): Declare.
4663 (check_for_bare_parameter_packs): Declare.
4664 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
4665 sizeof... expressions.
4666 (pp_cxx_expression): Print pack expansions and non-type argument
4667 packs.
4668 (pp_cxx_exception_specification): Print pack expansions.
4669 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
4670 (pp_cxx_ctor_initializer): Print pack expansions.
4671 (pp_cxx_type_id): Print pack expansions.
4672 (pp_cxx_template_argument_list): Print argument packs.
4673 (pp_cxx_template_parameter): Print ellipsis for template parameter
4674 packs.
4675 * pt.c (comp_template_parms): Compare template parameter packs.
4676 (template_parameter_pack_p): New.
4677 (template_parms_variadic_p): New.
4678 (template_args_variadic_p): New.
4679 (make_ith_pack_parameter_name): New.
4680 (struct find_parameter_pack_data): New.
4681 (find_parameter_packs_r): New.
4682 (uses_parameter_packs): New.
4683 (make_pack_expansion): New.
4684 (check_for_bare_parameter_packs): New.
4685 (expand_template_argument_pack): New.
4686 (reduce_template_parm_level): Propagate parameter pack flag.
4687 (process_template_parm): Add is_parameter_pack parameter to state
4688 when the parameter is actually a parameter pack. Create template
4689 parameter packs when is_parameter_pack is true.
4690 (current_template_args): The argument for a template parameter
4691 pack is an argument pack containing a single pack expansion.
4692 (process_partial_specialization): When checking that non-type
4693 argument expressions do not involve template parameters, loop over
4694 the arguments in argument packs separately.
4695 (push_template_decl_real): Check that the type of the declaration
4696 does not have any bare parameter packs. Check that primary
4697 templates have no more than one parameter pack, and that it comes
4698 at the end of the template parameter list.
4699 (convert_template_argument): Handle coercions for pack expansion
4700 expressions by coercing the pattern then rebuilding the expansion.
4701 (coerce_template_parms): When coercing the arguments for a
4702 variadic template, pack "extra" arguments into an argument pack.
4703 (coerce_template_template_parms): Cannot coerce between parameter
4704 packs and non-pack parameters.
4705 (template_args_equal): Compare PACK_EXPANSION_P expressions.
4706 (comp_template_args): Expand all template arguments packs before
4707 comparing template argument lists.
4708 (mangle_class_name_for_template): Make argument packs as separate
4709 template arguments.
4710 (for_each_template_parm_r): No need to handle BASELINK.
4711 (instantiate_class_template): Handle pack expansions in the base
4712 class list.
4713 (tsubst_pack_expansion): New.
4714 (tsubst_template_args): Handle substitutions of argument packs and
4715 pack expansion into template argument lists.
4716 (tsubst_decl): Expand function parameter packs into separate
4717 function parameters.
4718 (tsubst_arg_types): Expand a type pack expansion into separate
4719 argument types.
4720 (tsubst_exception_specification): Handle pack expansions in
4721 exception specifiers.
4722 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
4723 replacing a template parameter with its argument. If we encounter
4724 a substitution for an argument pack, just return the parameter
4725 itself.
4726 (tsubst_copy): sizeof(X...) returns the number of elements in
4727 parameter pack X. See through ARGUMENT_PACK_SELECT when the
4728 PARM_DECL is a parameter pack.
4729 (tsubst_expr): Expression pack expansions and argument packs
4730 cannot show up here; they will all be handled through function
4731 calls, sizeof, and template argument lists.
4732 (tsubst_copy_and_build): sizeof(X...) returns the number of
4733 elements in parameter pack X. Handle pack expansions in TREE_LIST
4734 and CONSTRUCTOR nodes.
4735 (fn_type_unification): Handle "incomplete" explicit template
4736 argument lists that specify some of the arguments for a template
4737 parameter pack.
4738 (type_unification_real): Unify arguments against pack expansions.
4739 (template_parm_level_and_index): New, helper function.
4740 (unify_pack_expansion): New.
4741 (unify): Unify argument packs on an argument-by-argument basis,
4742 handling variadic argument packs as well.
4743 (more_specialized_fn): Handle unification of function parameter
4744 packs. All things being equal, prefer non-variadic function
4745 templates to variadic function templates.
4746 (more_specialized_class): Prefer the variadic class template
4747 partial specialization that binds fewer arguments to a parameter
4748 pack.
4749 (regenerate_decl_from_template): Expand function parameter packs
4750 into separate parameters.
4751 (instantiate_decl): Ditto.
4752 (tsubst_initializer_list): Handle pack expansions for base-class
4753 initializers.
4754 (dependent_type_p_r): Determine dependent types in argument packs
4755 and pack expansions.
4756 (value_dependent_expression_p): Determine value-dependence of
4757 non-type argument packs.
4758 (dependent_template_arg_p): Handle argument packs.
4759 * semantics.c (finish_cond): Check for bare parameter packs.
4760 (finish_expr_stmt): Ditto.
4761 (finish_for_expr): Ditto.
4762 (finish_switch_cond): Ditto.
4763 (finish_mem_initializers): Ditto.
4764 * name-lookup.c (arg_assoc_type): Handle pack expansions and
4765 argument packs.
4766 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
4767 * parser.c (make_declarator): Declarator is not an expansion.
4768 (make_pointer_declarator): Transfer parameter pack flag to outer
4769 declarator.
4770 (make_reference_declarator): Ditto.
4771 (make_ptrmem_declarator): Ditto.
4772 (make_call_declarator): Ditto.
4773 (make_array_declarator): Ditto.
4774 (cp_parser_postfix_expression): Allow pack expansion expressions
4775 in the argument list for a call expression.
4776 (cp_parser_parenthesized_expression_list): Add new parameter
4777 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
4778 into separate arguments."
4779 (cp_parser_new_placement): Allow pack expansion expressions.
4780 (cp_parser_new_initializer): Ditto.
4781 (cp_parser_mem_initializer_list): Allow ellipsis to create a
4782 base-class initializer expansion.
4783 (cp_parser_mem_initializer): Ditto.
4784 (cp_parser_template_parameter_list): Keep track of whether the
4785 template parameter is a template parameter pack.
4786 (cp_parser_template_parameter): Parse the ellipsis to indicate a
4787 template parameter pack.
4788 (cp_parser_type_parameter): Ditto.
4789 (cp_parser_template_argument_list): Parse the ellipsis to indicate
4790 a pack expansion.
4791 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
4792 this declarator is a parameter pack.
4793 (cp_parser_parameter_declaration): The ellipsis does not end the
4794 parameter declaration, because it might be a parameter pack. Parse
4795 the ellipsis to indicate a parameter pack.
4796 (cp_parser_initializer): Allow pack expansions.
4797 (cp_parser_initializer_list): Allow ellipsis to create an
4798 initializer expansion.
4799 (cp_parser_base_clause): Allow ellipsis to create a base specifier
4800 expansion.
4801 (cp_parser_type_id_list): Allow ellipsis to create an exception
4802 specifier expansion.
4803 (cp_parser_attribute_list): Don't allow pack expansions.
4804 (cp_parser_functional_cast): Allow pack expansions.
4805 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
4806 compute the length of a parameter pack.
4807 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
4808 end a template argument.
4809 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
4810 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
4811 CAST_EXPR.
4812
63a08740
DM
48132007-03-09 Dirk Mueller <dmueller@suse.de>
4814
b97d8153 4815 * call.c (build_new_op): Call warn_logical_operator.
63a08740 4816
cc891727
VR
48172007-03-08 Volker Reichelt <reichelt@netcologne.de>
4818
1916c916
VR
4819 PR c++/30852
4820 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
4821
cc891727
VR
4822 PR c++/30534
4823 * pt.c (any_template_arguments_need_structural_equality_p):
4824 Robustify.
4825
ab53bae2
AO
48262007-03-08 Alexandre Oliva <aoliva@redhat.com>
4827
4828 * decl.c (grokdeclarator): Disable warnings for anonymous
4829 bitfields.
4830
fabb00fc
VR
48312007-03-05 Volker Reichelt <reichelt@netcologne.de>
4832
4833 * typeck2.c (readonly_error): Always emit a hard error.
4834 Remove last argument.
4835 * cp-tree.h (readonly_error): Adjust prototype.
4836 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
4837 * typeck.c (build_unary_op): Likewise.
4838 (build_modify_expr): Likewise.
4839
2a2193e0
SM
48402007-03-04 Simon Martin <simartin@users.sourceforge.net>
4841
4842 PR c++/30895
4843 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
4844
4606b05c
MLI
48452007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4846
4847 PR c++/15787
4848 * parser.c (struct cp_parser): New IN_IF_STMT.
4849 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
4850 returning if parsing the body of an 'if' statement or issuing an
4851 error and continuing.
4852 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
4853 body of 'if'.
4854 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
4855
49fedf5a
SM
48562007-03-02 Simon Martin <simartin@users.sourceforge.net>
4857
4858 PR c++/28253
4859 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
4860 for thunks.
4861
f9dedbe3
GK
48622007-03-02 Geoffrey Keating <geoffk@apple.com>
4863
4864 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
4865 Objective-C++. Don't exit early if -shared-libgcc needs to be
4866 added.
4867
4e223867
MLI
48682007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4869
4870 * typeck.c (common_base_type): Delete unused function.
4871
7fe3e184
BM
48722007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
4873
4874 * Make-lang.in: Add dummy lang.install-pdf target.
4875
41dc91a8
SB
48762007-03-01 Simon Baldwin <simonb@google.com>
4877
4878 PR c++/23689
4879 * decl.c (check_tag_decl): Added new warning for typedef ignored
4880 when it precedes an otherwise valid non-typedef declaration.
4881
94a0dd7b
SL
48822007-02-28 Sandra Loosemore <sandra@codesourcery.com>
4883
4884 * typeck.c (build_function_call): Store converted arguments
4885 in a stack-allocated array instead of building a list.
4886 (convert_arguments): Store arguments in the array passed in as an
4887 argument, and return the actual number of arguments.
4888 * call.c (build_call): Delete, and replace with...
4889 (build_call_n, build_call_a): New.
4890 (build_op_delete_call): Rewrite to avoid constructing argument lists.
4891 (build_over_call): Store converted arguments in a stack-allocated
4892 array instead of building a list.
4893 (build_cxx_call): Pass arguments in an array instead of as a list.
4894 (build_java_interface_fn_ref): Rewrite to avoid constructing
4895 argument lists.
4896 * tree.h: Update declarations to reflect above changes.
4897 * method.c (use_thunk): Use a stack-allocated array to hold
4898 the arguments instead of a list.
4899 * rtti.c (throw_bad_cast): Update call to cxx_call.
4900 (throw_bad_typeid): Likewise.
4901 (build_dynamic_cast_1): Likewise.
4902 * init.c (build_builtin_delete_call): Use build_call_n.
4903 * decl.c (expand_static_init): Likewise.
4904 * except.c (cp_protect_cleanup_actions): Likewise.
4905 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
4906 (gimplify_must_not_throw_expr): Likewise.
4907 (cxx_omp_apply_fn): Use build_call_a.
4908
57a4c089
MM
49092007-02-26 Mark Mitchell <mark@codesourcery.com>
4910
4911 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
4912 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
4913
fc8600f9
MM
49142007-02-25 Mark Mitchell <mark@codesourcery.com>
4915
4916 * cp-tree.h (static_ctors): Remove.
4917 * cp-tree.h (static_dtors): Likewise.
4918 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
4919 refactoring of tree_map hierarchy.
4920 (decl_shadowed_for_var_insert): Likewise.
4921 * semantics.c (expand_body): Use c_expand_body.
4922 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
4923 * decl2.c (static_ctors): Remove.
4924 (static_dtors): Likewise.
4925 (generate_ctor_or_dtor_function): Pass NULL_TREE to
4926 objc_generate_static_init_call. Do not call static_[cd]tors.
4927 (generate_ctor_and_dtor_functions_for_priority): Do not check for
4928 static_[cd]tors.
4929 (cp_write_global_declarations): Likewise.
4930
2ae2031e
RG
49312007-02-23 Richard Guenther <rguenther@suse.de>
4932
4933 * class.c (note_name_declared_in_class): Make declaration
4934 changes meaning a pedwarn.
4935
a0ad3539
MM
49362007-02-22 Michael Matz <matz@suse.de>
4937
4938 PR c++/29433
4939 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
4940 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
4941 dump_function_decl): Guard emitting outer scopes by new flag.
4942 * cp-lang.c (cxx_dwarf_name): New function.
4943 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
4944 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
4945 Remove functions.
4946 (push_template_decl_real, lookup_template_class): Remove calls
4947 to above functions.
4948
c88b0c50
MM
49492007-02-19 Mark Mitchell <mark@codesourcery.com>
4950
4951 * call.c (build_new_method_call): Ensure that explicit calls of
4952 destructors have type "void".
4953
c116cd05
MLI
49542007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4955
4956 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
4957 and -Walways-true with -Waddress.
4958 * cvt.c (convert_to_void): Replace unconditional warning with
4959 -Waddress.
4960
b9704fc5
KH
49612007-02-18 Kazu Hirata <kazu@codesourcery.com>
4962
4963 * decl.c, tree.c: Fix comment typos.
4964
76b9a2a1
AP
49652007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
4966
4967 PR C++/30158
4968 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
4969 statement expression if we had an error mark node.
5be014d5 4970
5039610b
SL
49712007-02-15 Sandra Loosemore <sandra@codesourcery.com>
4972 Brooks Moses <brooks.moses@codesourcery.com>
4973 Lee Millward <lee.millward@codesourcery.com>
4974
4975 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
4976 Change class to tcc_vl_exp.
4977
4978 * call.c (build_call): Use build_call_list instead
4979 of build3.
4980 (build_over_call): Likewise.
4981 (build_new_method_call): Use build_min_non_dep_call_list
4982 instead of build_min_non_dep.
4983
4984 * error.c (dump_call_expr_args): New function.
4985 (dump_aggr_init_expr_args): New function.
4986 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
4987 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
4988
4989 * cvt.c (convert_to_void): Use build_call_array instead
4990 of build3; use new AGGR_INIT_EXPR accessor macros.
4991
4992 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
4993 instead of TREE_CODE_LENGTH.
4994
4995 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
4996 AGGR_INIT_EXPR accessor macros.
4997
4998 * cp-gimplify.c (cp_gimplify_init_expr): Use
4999 AGGR_INIT_EXPR_SLOT to set the slot operand.
5000
5001 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
5002 (AGGR_INIT_EXPR_SLOT): New macro.
5003 (AGGR_INIT_EXPR_ARG): New macro.
5004 (aggr_init_expr_nargs): New macro.
5005 (AGGR_INIT_EXPR_ARGP): New macro.
5006 (aggr_init_expr_arg_iterator): New.
5007 (init_aggr_init_expr_arg_iterator): New.
5008 (next_aggr_init_expr_arg): New.
5009 (first_aggr_init_expr_arg): New.
5010 (more_aggr_init_expr_args_p): New.
5011 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
5012 (stabilize_aggr_init): New declaration.
5013 (build_min_non_dep_call_list): Likewise.
5014
5015 * tree.c (process_aggr_init_operands): New function.
5016 (build_aggr_init_array) New function.
5017 (build_cplus_new): Update to use new CALL_EXPR and
5018 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
5019 build_aggr_init_array.
5020 (build_min_non_dep_call_list) New function.
5021 (build_min_nt): Assert input code parameter is not a variable
5022 length expression class.
5023 (build_min, build_min_non_dep): Likewise.
5024 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
5025 to check for equality instead of recursing. Handle tcc_vl_exp
5026 tree code classes.
5027 (stabilize_call): Update to only handle CALL_EXPRs, not
5028 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
5029 (stabilize_aggr_init): New function.
5030 (stabilize_init): Use it.
5031
5032 * cxx-pretty-print.c (pp_cxx_postfix_expression)
5033 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
5034 AGGR_INIT_EXPR accessor macros and argument iterators.
5035
5036 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
5037 build_vl_exp. Iterate through the operands, recursively
5038 processing each one.
5039 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
5040 CALL_EXPR accessor macros.
5041 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
5042 tree code classes. Use TREE_OPERAND_LENGTH instead of
5043 TREE_CODE_LENGTH.
5044
5045 * semantics.c (finish_call_expr): Use build_nt_call_list
5046 instead of build_nt.
5047 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
5048 accessor macros. Use build_call_array to construct the
5049 CALL_EXPR node instead of build3
5050
5051 * decl2.c (build_offset_ref_call_from_tree): Use
5052 build_nt_call_list and build_min_non_dep_call_list instead
5053 of build_min_nt and build_min_non_dep.
5054
5055 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
5056 Use build_nt_call_list instead of build_min_nt.
5057
21493102
MLI
50582007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5059
5060 PR c++/28943
5061 * call.c (build_conditional_expr): Improve error message.
5062
20af23d3
DM
50632007-02-13 Dirk Mueller <dmueller@suse.de>
5064
5065 * friend.c (do_friend): Annotate warning about friend
5066 declarations in templates with OPT_Wnon_template_friend.
5067 Convert informal message from warning() to inform().
5068
8ea6dfae
SM
50692007-02-12 Simon Martin <simartin@users.sourceforge.net>
5070 Mark Mitchell <mark@codesourcery.com>
5071
5072 PR c++/14622
5073 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
5074 instantiations for variables.
5075
27f33b15
MLI
50762007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5077
5078 PR middle-end/7651
5079 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
5080 Check warn_unused_value just once.
5081
ba139ba8
MM
50822007-02-11 Mark Mitchell <mark@codesourcery.com>
5083
5084 PR c++/26988
5085 * pt.c (determine_specialization): Use skip_artificial_parms_for.
5086 (fn_type_unificiation): Likewise.
5087 (get_bindings): Likewise.
5088
5089o2007-02-06 Mark Mitchell <mark@codesourcery.com>
56fd65c7
MM
5090
5091 PR target/29487
5092 * decl.c (finish_function): Use DECL_REPLACEABLE.
5093 * tree.c (cp_cannot_inline_tree_fn): Likewise.
5094
097552fa
GDR
50952007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
5096
5097 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
5098
8893239d
RH
50992007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
5100
5101 * decl.c (grokvardecl): Don't error if !have_tls.
5102 (grokdeclarator): Likewise.
5103 * parser.c (cp_parser_omp_threadprivate): Likewise.
5104
e02a048f
JJ
51052007-02-07 Jakub Jelinek <jakub@redhat.com>
5106
5107 PR c++/30703
5108 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
5109 parameters and result decls in omp clauses.
5110 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
5111 by reference.
5112
583c0b05
DM
51132007-02-05 Dirk Mueller <dmueller@suse.de>
5114
5115 PR bootstrap/30510
5116 * parser.c (cp_parser_class_specifier): Always initialize bases.
5117
4fe70b31
PB
51182007-02-05 Paolo Bonzini <bonzini@gnu.org>
5119
5120 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
5121 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
5122 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
5123 expressions.
5124 * semantics.c (finish_omp_atomic): Store a whole expression node
5125 in operand 1, and integer_zero_node in operand 0, for dependent
5126 OMP_ATOMIC. Rewrite to make flow easier to understand.
5127
b10fc6f5
GDR
51282007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
5129
5130 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
5131
3b426391
KH
51322007-02-04 Kazu Hirata <kazu@codesourcery.com>
5133
5134 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
5135 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
5136
f1283f8f
DG
51372007-02-03 Douglas Gregor <doug.gregor@gmail.com>
5138
5139 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
5140 keyword warning to -Wc++0x-compat.
5141
5e32a5cf
GDR
51422007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
5143
5144 * decl.c (grokdeclarator): Update documentation.
5145
3e66d096
JJ
51462007-02-02 Jakub Jelinek <jakub@redhat.com>
5147
5148 PR c++/30536
5149 * decl.c (grokdeclarator): If __thread is used together with
5150 a storage class other than extern and static, clear thread_p
5151 after issuing diagnostics and fall through to checking the
5152 storage class.
5153
5e203bf8
RS
51542007-01-30 Roger Sayle <roger@eyesopen.com>
5155
5156 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
5157 calculating the size of an array (to avoid recursive errors).
5158
b9edb4b1
MLI
51592007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5160
5161 PR c++/24745
5162 * typeck.c (build_binary_op): Fix logic for warning. Move warning
5163 to -Wpointer-arith.
5164 * call.c (convert_like_real): Don't warn when converting to
5165 boolean type.
5166
c616e51b
MLI
51672007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5168
5169 * decl.c (pop_label): Replace warning with call to
5170 warn_for_unused_label.
5171
5cf10afb
AP
51722007-01-28 Andrew Pinski <pinskia@gmail.com>
5173
5174 PR C++/28988
5175 * semantics.c (finish_pseudo_destructor_expr): Check the
5176 destrutor name by calling check_dtor_name.
5177
54654d29
DG
51782007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
5179
5180 * lex.c (D_CPP0X): Rename.
5181 (D_CXX0X): To this.
5182 (reswords): D_CPP0X -> D_CXX0X.
5183 (init_reswords): Ditto.
5184 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
5185 of C++0x keywords as identifiers.
5186
815951d8
SM
51872007-01-23 Simon Martin <simartin@users.sourceforge.net>
5188
5189 PR c++/27492
5190 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
5191 function decls.
5192
a99e5cb4
ILT
51932007-01-23 Ian Lance Taylor <iant@google.com>
5194
5195 * typeck.c (convert_for_assignment): Only warn about a = b = c
5196 when converting to bool.
5197
dc569621
RS
51982007-01-23 Roger Sayle <roger@eyesopen.com>
5199
5200 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
5201 TREE_OVERFLOW.
5202 * typeck.c (ignore_overflows): Remove the remaining uses of
5203 TREE_CONSTANT_OVERFLOW.
5204
77dbd49b
JH
52052007-01-20 Jan Hubicka <jh@suse.cz>
5206
5207 * decl2.c (start_objects, start_static_storage_duration_function):
5208 Do not make the functions uninlinable.
5209
efb7e1e0
ILT
52102007-01-17 Ian Lance Taylor <iant@google.com>
5211
5212 * class.c (add_method): Call VEC_reserve_exact rather than passing
5213 a negative size to VEC_reserve.
5214
6f9f76e3
SM
52152007-01-11 Simon Martin <simartin@users.sourceforge.net>
5216
5217 PR c++/29573
5218 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
5219
50ef2c18
MM
52202007-01-10 Mark Mitchell <mark@codesourcery.com>
5221
5222 PR c++/28999
5223 * decl.c (make_typename_type): If the qualified name is not a
5224 type, issue an error.
5225 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
5226 formatting.
5227
157600d0
GK
52282007-01-08 Geoffrey Keating <geoffk@apple.com>
5229
5230 * rtti.c: Include target.h.
5231 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
5232 don't emit typeinfo for fundamental types as weak.
5233 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
5234
2ac7cbb5
RG
52352007-01-08 Richard Guenther <rguenther@suse.de>
5236
5237 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
5238
00c8e9f6
MS
52392007-01-08 Mark Shinwell <shinwell@codesourcery.com>
5240
5241 * call.c (standard_conversion): Pass flag to
5242 vector_types_convertible_p to disallow emission of note.
5243 * typeck.c (convert_for_assignment): Pass flag to
5244 vector_types_convertible_p to allow emission of note.
5245 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
5246 to disallow emission of note.
5247
16fd4d2d
MLI
52482007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5249
5250 PR c++/28986
5251 * typeck.c (build_binary_op): Call overflow_warning if
5252 TREE_OVERFLOW_P is true for the result and not for any of the
5253 operands.
5254
fc40d49c
LM
52552007-01-06 Lee Millward <lee.millward@codesourcery.com>
5256
5257 PR c++/19439
5258 * class.c (add_method): Don't wait until template
5259 instantiation time to complain about duplicate methods.
5260
59c0753d
MLI
52612007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5262
5263 PR c/19978
5264 * semantics.c (finish_unary_op_expr): Warn only if result
5265 overflowed and operands did not.
5266
b3c6d2ea
ILT
52672007-01-05 Ian Lance Taylor <iant@google.com>
5268
5269 * typeck.c (build_binary_op): Warn about comparing a non-weak
5270 address to NULL.
5271
3d761c46
DG
52722007-01-05 Douglas Gregor <doug.gregor@gmail.com>
5273
5274 * pt.c (tsubst): Propagate the need for structural equality checks
5275 when reducing the level of template parameters.
5276
c3e188fc
KH
52772007-01-03 Kazu Hirata <kazu@codesourcery.com>
5278
5279 * pt.c: Fix a comment typo.
5280
2c405565 52812007-01-02 Ian Lance Taylor <iant@google.com>
fbc8d2d3
ILT
5282
5283 * semantics.c (maybe_convert_cond): Optionally warn when using an
5284 assignment as a condition.
5285 * typeck.c (convert_for_assignment): Optionally warn about
5286 assigning the result of an assignment to a bool.
5287
410cf6e6
DG
52882007-01-02 Douglas Gregor <doug.gregor@gmail.com>
5289
5290 * pt.c (canonical_template_parms): Correct typo in comment.
5291
06d40de8
DG
52922007-01-02 Douglas Gregor <doug.gregor@gmail.com>
5293
5294 * typeck.c (structural_comptypes): Renamed from "comptypes".
5295 (comptypes): Use canonical type information to perform fast type
5296 comparison. When VERIFY_CANONICAL_TYPES, verify that the
5297 canonical type comparison returns the same results as we would see
5298 from the current, structural check. Support COMPARE_STRUCTURAL
5299 when we need structural checks.
5300 * decl.c (typename_compare): Fix comment.
5301 (build_typename_type): TYPENAME_TYPE nodes require structural
5302 equality checks, because they resolve different based on the
5303 current class type.
5304 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
5305 require structural equality checks (for now).
5306 (build_ptrmemfunc_type): Build the canonical pointer to member
5307 function type.
5308 (compute_array_index_type): Whenever we build a new index type
5309 to represent the size of an array in a template, we need to mark
5310 this index type as requiring structural equality. This goes for
5311 arrays with value-dependent sizes with the current ABI, or all
5312 arrays with ABI-1.
5313 * tree.c (cplus_array_hash): New.
5314 (struct cplus_array_info): New.
5315 (cplus_array_compare): New.
5316 (cplus_array_htab): New.
5317 (build_cplus_array_type_1): Use a hash table to cache the array
5318 types we build. Build the canonical array type for each array
5319 type.
5320 (cp_build_qualified_type_real): When building a cv-qualified array
5321 type, use the hash table of array types and build canonical array
5322 types as necessary.
5323 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
5324 use structural equality (for now).
5325 * cp-tree.h (COMPARE_STRUCTURAL): New.
5326 * pt.c (canonical_template_parms): New.
5327 (canonical_type_parameter): New.
5328 (process_template_parm): Find the canonical type parameter.
5329 (lookup_template_class): When we have named the primary template
5330 type, set the canonical type for our template class to the primary
5331 template type. If any of the template arguments need structural
5332 equality checks, the template class needs structural equality
5333 checks.
5334 (tsubst): When reducing the level of a template template
5335 parameter, we require structural equality tests for the resulting
5336 parameter because its template parameters have not had their types
5337 canonicalized. When reducing a template type parameter, find the
5338 canonical reduced type parameter.
5339 (any_template_arguments_need_structural_equality_p): New.
5340
This page took 1.035356 seconds and 5 git commands to generate.