OSDN Git Service

PR c++/41774
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-11-02  Jakub Jelinek  <jakub@redhat.com>
2
3         PR c++/41774
4         * name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
5         push_visibility.
6         * parser.c (cp_parser_namespace_definition): Pass 1 as argument to
7         pop_visibility.
8         * rtti.c (push_abi_namespace): Pass 2 as last argument to
9         push_visibility.
10         (pop_abi_namespace): Pass 2 as argument to pop_visibility.
11
12 2009-10-31  Jason Merrill  <jason@redhat.com>
13
14         * tree.c (cv_unqualified): New fn.
15         * cp-tree.h: Declare it.
16         * typeck.c (decay_conversion): Use it instead of TYPE_MAIN_VARIANT.
17
18         * rtti.c (tinfo_name): Fix lengths for private case.
19
20 2009-10-31  Jason Merrill  <jason@redhat.com>
21
22         PR c++/41754
23         * call.c (compare_ics): Avoid bad union use when
24         comparing two ck_lists.
25
26 2009-10-30  Jerry Quinn  <jlquinn@optonline.net>
27
28         * mangle.c (mangle_type_string_for_rtti): Reapply 153734.
29         (needs_fake_anon): Likewise.
30         (write_name): Likewise.
31         (write_nested_name): Likewise.
32         * cp-tree.h (mangle_type_string_for_rtti): Likewise.
33         (get_anonymous_namespace): Likewise.
34         * name-lookup.c (get_anonymous_namespace_name): Likewise.
35         * rtti.c (tinfo_name): Likewise, with +1 in the second
36         build_string call fixed.
37         (tinfo_base_init): Likewise.
38
39 2009-10-30  Jason Merrill  <jason@redhat.com>
40
41         Revert:
42         * decl.c (cp_fname_init): Correct build_string argument.
43
44 2009-10-30  Jerry Quinn  <jlquinn@optonline.net>
45
46         * mangle.c (mangle_type_string_for_rtti): Revert 153734.
47         (needs_fake_anon): Likewise.
48         (write_name): Likewise.
49         (write_nested_name): Likewise.
50         * cp-tree.h (mangle_type_string_for_rtti): Likewise.
51         (get_anonymous_namespace): Likewise.
52         * name-lookup.c (get_anonymous_namespace_name): Likewise.
53         * rtti.c (tinfo_name): Likewise.
54         (tinfo_base_init): Likewise.
55
56 2009-10-30  Dodji Seketeli  <dodji@redhat.com>
57
58         PR c++/41863
59         * pt.c (iterative_hash_template_arg): articifial parms
60         don't have DECL_PARM_INDEX set. Do not hash it.
61
62 2009-10-28  Jerry Quinn  <jlquinn@optonline.net>
63
64         * mangle.c (mangle_type_string_for_rtti): Revert r149964.
65         (needs_fake_anon): Likewise.
66         (write_name): Likewise.
67         (write_nested_name): Likewise.
68         * cp-tree.h (mangle_type_string_for_rtti): Likewise.
69         (get_anonymous_namespace): Likewise.
70         * name-lookup.c (get_anonymous_namespace_name): Likewise.
71         * rtti.c (tinfo_name): Insert '*' in front of private names.
72         (tinfo_base_init): Use it.
73
74 2009-10-28  Jason Merrill  <jason@redhat.com>
75
76         Core issue 812, 861
77         * name-lookup.c (set_decl_namespace): Deal properly with inline
78         namespaces.
79         (qualified_lookup_using_namespace): Overhaul.
80         * pt.c (print_candidates): Handle getting an OVERLOAD.
81
82 2009-10-28  Jason Merrill  <jason@redhat.com>
83
84         * decl.c (cp_fname_init): Correct build_string argument.
85
86 2009-10-27  Jason Merrill  <jason@redhat.com>
87
88         Allow no-capture lambdas to convert to function pointer.
89         * semantics.c (maybe_add_lambda_conv_op): New.
90         * parser.c (cp_parser_lambda_expression): Call it.
91         (cp_parser_lambda_declarator_opt): Make op() static if
92         no captures.
93         * mangle.c (write_closure_type_name): Adjust.
94         * semantics.c (finish_this_expr): Adjust.
95         * decl.c (grok_op_properties): Allow it.
96         * call.c (build_user_type_conversion_1): Handle static conversion op.
97         (build_op_call): And op().
98
99 2009-10-26  Jakub Jelinek  <jakub@redhat.com>
100
101         PR debug/41828
102         * cp-lang.c (cxx_dwarf_name): Return NULL instead of
103         <anonymous ...> for anonymous aggregate names.
104
105 2009-10-26  Jason Merrill  <jason@redhat.com>
106
107         PR c++/38796, Core issue 906
108         * cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
109         (DECL_DEFAULTED_IN_CLASS_P): New.
110         * class.c (user_provided_p): Non-static.
111         (check_methods): Use it.
112         (check_bases_and_members): Check defaulted fns.
113         (defaultable_fn_p): Move and rename to...
114         * method.c (defaultable_fn_check): ...this.
115         (defaulted_late_check): New.
116         * pt.c (tsubst_decl): Call it.
117         * decl2.c (grokfield): Adjust.
118         * decl.c (cp_finish_decl): Adjust.
119         (grok_special_member_properties): Use user_provided_p.
120
121 2009-10-26  Dodji Seketeli  <dodji@redhat.com>
122
123         PR c++/41785
124         * pt.c (template_args_equal): Handle comparison of
125         an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
126         * cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
127
128 2009-10-26  Dodji Seketeli  <dodji@redhat.com>
129
130         PR c++/41020
131         * decl.c (decls_match): Use DECL_IS_BUILTIN instead of
132         DECL_BUILT_IN.
133
134 2009-10-23  Dodji Seketeli  <dodji@redhat.com>
135
136         PR c++/40808
137         * mangle.c (write_template_args): Allow mangling of empty template
138         argument list. Updated function comments.
139
140 2009-10-23  Jason Merrill  <jason@redhat.com>
141
142         * semantics.c (lambda_expr_this_capture): Use thisify_lambda_field.
143
144         * semantics.c (outer_lambda_capture_p): New fn.
145         (thisify_lambda_field): Factor out...
146         (add_default_capture): ...from here.
147         (finish_id_expression): Use them.
148
149         Core issue 899
150         * call.c (add_function_candidate): Only permit explicit conversion
151         ops if copy ctor was called with a single argument.
152
153         * call.c (initialize_reference): Tweak error message.
154
155 2009-10-21  Jakub Jelinek  <jakub@redhat.com>
156
157         * mangle.c (finish_mangling_get_identifier): Use
158         obstack_base (mangle_obstack) instead of name_base.
159
160 2009-10-19  Jakub Jelinek  <jakub@redhat.com>
161
162         * parser.c (cp_lexer_print_token, cp_parser_is_string_literal,
163         cp_parser_string_literal, cp_parser_primary_expression): Likewise.
164         (cp_lexer_get_preprocessor_token): Use C_LEX_STRING_JOIN instead
165         of C_LEX_RAW_STRINGS.
166
167 2009-10-15  Jason Merrill  <jason@redhat.com>
168
169         PR c++/38888
170         * error.c (dump_template_bindings): Wrap argument packs in {}.
171
172         PR c++/38798
173         * parser.c (CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS): New.
174         (cp_parser_type_specifier): Don't try to parse a class-specifier
175         or enum-specifier in that case.
176         (cp_parser_trailing_type_id): New.
177         (cp_parser_late_return_type_opt): Call it.
178         (cp_parser_type_id_1): Add is_trailing_return parm.
179         (cp_parser_type_specifier_seq): Likewise.
180
181 2009-10-14  Jason Merrill  <jason@redhat.com>
182
183         PR c++/39866
184         * call.c (print_z_candidates): Don't print deleted candidates.
185         (print_z_candidate): Note deleted candidates.
186
187 2009-10-14  Larry Evans  <cppljevans@suddenlink.net>
188
189         PR c++/40092
190         * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
191         equality.
192
193 2009-10-12  Jason Merrill  <jason@redhat.com>
194
195         PR c++/37875
196         * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
197
198         PR c++/37766
199         * pt.c (type_unification_real): Call convert_template_argument
200         for function default template arguments.
201         (check_default_tmpl_args): Suggest -std=c++0x when function default
202         template args seen in C++98 mode.
203
204 2009-10-11  Jason Merrill  <jason@redhat.com>
205
206         PR c++/37204
207         * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
208         properly.
209
210 2009-10-11  Richard Guenther  <rguenther@suse.de>
211
212         * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
213
214 2009-10-08  Jason Merrill  <jason@redhat.com>
215
216         PR c++/36816
217         * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
218         even when DEDUCE_EXACT.
219
220         PR c++/37177
221         * pt.c (resolve_nondeduced_context): New.
222         * cvt.c (convert_to_void): Call it.
223         * semantics.c (finish_decltype_type): Likewise.
224         * typeck.c (decay_conversion): Here too.
225         * pt.c (tsubst_decl): Don't clobber input_location.
226         Don't register a bad specialization.
227
228 2009-10-07  Gabriel Dos Reis  <gdr@cs.tamu.edu>
229
230         * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
231
232 2009-10-07  Jason Merrill  <jason@redhat.com>
233
234         PR c++/39863
235         * pt.c (tsubst_pack_expansion): Don't do anything now if we
236         have incomplete packs of different lengths.
237
238         PR c++/41038
239         * tree.c (build_qualified_name): Call convert_from_reference.
240
241 2009-10-06  Jason Merrill  <jason@redhat.com>
242
243         Fix lookup of initialized captures in unevaluated context.
244         * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
245         * name-lookup.c (qualify_lookup): Check it.
246         * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
247         to add_capture.
248         * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
249         on captures without explicit init.
250         (add_default_capture): Pass explicit_init_p.
251
252         Fix capture by copy of types with explicit copy constructor.
253         * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
254         (DIRECT_INIT_EXPR_P): New.
255         * typeck.c (convert_for_initialization): Just return if
256         DIRECT_INIT_EXPR_P.
257         * semantics.c (build_lambda_object): Use
258         TARGET_EXPR_DIRECT_INIT_P for normal captures.
259
260 2009-10-05  Jason Merrill  <jason@redhat.com>
261
262         * parser.c: Mark lambda_scope and lambda_count for PCH.
263
264 2009-10-03  Jason Merrill  <jason@redhat.com>
265
266         PR c++/41553
267         * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
268         parse error.
269
270 2009-10-02  Jason Merrill  <jason@redhat.com>
271
272         * mangle.c (write_unnamed_type_name): Implement.
273         (local_class_index): Split out from...
274         (discriminator_for_local_entity): ...here.
275         (nested_anon_class_index): New.
276         * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
277
278 2009-10-02  Janis Johnson  <janis187@us.ibm.com>
279
280         * call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
281         to double.
282
283 2009-10-01  Jason Merrill  <jason@redhat.com>
284
285         * parser.c (cp_parser_lambda_expression): Compute visibility.
286         (no_linkage_lambda_type_p): Remove.
287         * cp-tree.h: Remove declaration.
288         * tree.c (no_linkage_check): Don't call it.  Don't check template
289         args.  Don't check TREE_PUBLIC Types.
290
291 2009-10-01  Gabriel Dos Reis  <gdr@cse.tamu.edu>
292             Jason Merrill <jason@redhat.com>
293
294         * decl.c (grokdeclarator): Set constexprness before announcing
295         friendship.
296
297 2009-10-01  Gabriel Dos Reis  <gdr@cs.tamu.edu>
298
299         * decl.c (record_builtin_java_type): Undo unintended change.
300         (cxx_init_decl_processing): Likewise.
301
302 2009-10-01  Jason Merrill  <jason@redhat.com>
303
304         * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
305         clones.
306
307         * decl.c (grok_special_member_properties): Only adjust
308         TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
309         (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
310         clones.
311
312 2009-09-30  Gabriel Dos Reis  <gdr@cs.tamu.edu>
313
314         * decl.c (check_for_uninitialized_const_var): Check constexpr
315         variables too.
316         (grokdeclarator): Handle `constexpr'.
317         (check_tag_decl): Reject `constexpr'.
318         (check_function_type): Check constexpr functions.
319         * cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
320         (CLASSTYPE_LITERAL_P): New.
321         (lang_type_class::is_literal): New.
322         (lang_type_class::dummy): Adjust width.
323         (literal_type_p): Declare.
324         * parser.c (cp_parser_check_decl_spec): Print it.
325         (cp_parser_decl_specifier_seq): Accept "constexpr".
326         * semantics.c (validate_constexpr_fundecl): Define.
327         (literal_type_p): Define.
328
329 2009-09-30  Jason Merrill  <jason@redhat.com>
330
331         * semantics.c (lambda_expr_this_capture): Fix default capture
332         of explicit capture of 'this'.
333
334 2009-09-30  Jason Merrill  <jason@redhat.com>
335
336         * parser.c (cp_parser_lambda_expression): Don't add __ to __this.
337
338 2009-09-30  Jason Merrill  <jason@redhat.com>
339
340         * cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
341
342 2009-09-29  John Freeman  <jfreeman08@gmail.com>
343             Jason Merrill  <jason@redhat.com>
344
345         Add support for lambda-expressions as per N2927.
346         * cp-tree.def (VEC_INIT_EXPR, LAMBDA_EXPR): New.
347         * cp-tree.h (LAMBDA_TYPE_P, LAMBDA_FUNCTION_P): New.
348         (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE): New.
349         (LAMBDA_EXPR_DEFAULT_CAPTURE_LIST): New.
350         (LAMBDA_EXPR_THIS_CAPTURE, LAMBDA_EXPR_CAPTURES_THIS_P): New.
351         (LAMBDA_EXPR_MUTABLE_P, LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): New.
352         (LAMBDA_EXPR_RETURN_TYPE, LAMBDA_EXPR_LOCATION): New.
353         (LAMBDA_EXPR_EXTRA_SCOPE, LAMBDA_EXPR_DISCRIMINATOR): New.
354         (struct tree_lambda_expr): New.
355         (union lang_tree_node): Add lambda_expression.
356         (struct lang_type_class): Add lazy_move_ctor flag, lambda_expr field.
357         (CLASSTYPE_LAZY_MOVE_CTOR, CLASSTYPE_LAMBDA_EXPR): New.
358         (LAMBDA_TYPE_EXTRA_SCOPE, VEC_INIT_EXPR_SLOT): New.
359         (VEC_INIT_EXPR_INIT, DECLTYPE_FOR_LAMBDA_CAPTURE): New.
360         (DECLTYPE_FOR_LAMBDA_RETURN): New.
361         (enum special_function_kind): Add sfk_move_constructor.
362         (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT, LAMBDANAME_P): New.
363         * parser.c (cp_parser_lambda_expression, cp_parser_lambda_introducer)
364         (cp_parser_lambda_declarator_opt, cp_parser_lambda_body): New.
365         (start_lambda_scope, record_lambda_scope, finish_lambda_scope): New.
366         (no_linkage_lambda_type_p): New.
367         (cp_parser_primary_expression): Recognize lambda expression.
368         (cp_parser_init_declarator): Note lambda scope.
369         (cp_parser_function_definition_after_declarator): Likewise.
370         (cp_parser_late_parsing_default_args): Likewise.
371         (cp_parser_skip_to_closing_parenthesis): Skip to end of lambda capture
372         lists, too.
373         (cp_parser_parameter_declaration): Don't defer lambda default args.
374         * semantics.c (finish_non_static_data_member, finish_id_expression):
375         Handle default capture for lambda expressions.
376         (finish_this_expr): Handle 'this' keyword inside of lambda expressions.
377         (outer_automatic_var_p): New.
378         (finish_decltype_type): Handle decltypes within lambda expressions.
379         (classtype_has_nothrow_assign_or_copy_p): Synthesized move constructor.
380         (build_lambda_expr, build_lambda_object, begin_lambda_type)
381         (lambda_return_type, lambda_capture_field_type, apply_lambda_return_type)
382         (capture_decltype, add_capture, add_default_capture)
383         (lambda_expr_this_capture): New.
384         * mangle.c (write_unnamed_type_name): New. Incomplete.
385         (write_closure_type_name): New.
386         (write_unqualified_name): Recognize unnamed, closure types.
387         (write_type): Do not write decltypes from lambda expressions.
388         (decl_mangling_context): New.
389         (write_name): Use it.  Handle PARM_DECL scope.
390         (write_prefix): Likewise.  Handle VAR_DECL/FIELD_DECL scope.
391         (write_compact_number): Factor out from...
392         (write_expression, write_template_param): ...here.
393         (discriminator_for_local_entity): Recognize lambdas.
394         (write_local_name): Handle PARM_DECL scope.
395         * typeck.c (structural_comptypes): Compare decltypes from lambda
396         expressions.
397         (check_return_expr): Deduce lambda return type from multiple return
398         statements.
399         * class.c (add_implicitly_declared_members): Add lazy move constructor
400         for lambda types.
401         (check_bases_and_members): Delete default constructor and assignment
402         operator for lambda types.
403         (maybe_note_name_used_in_class): Do not confuse lambda expression with
404         defining a class.
405         * decl.c (reshape_init_r): Array copy.
406         (grokfndecl): Synthesized move constructor.
407         (cp_tree_node_structure): Lambda expression.
408         * method.c (use_thunk): Synthesized move constructor.
409         (do_build_copy_constructor): Likewise.
410         (locate_copy): Likewise.
411         (implicitly_declare_fn): Likewise.
412         * cp-objcp-common.c (cp_tree_size): Handle LAMBDA_EXPR.
413         * error.c (dump_aggr_type): Recognize lambda type.
414         (dump_function_decl): Recognize lambda function.
415         (function_category): Likewise.
416         (dump_function_name): Hide lambda name.
417         * tree.c (build_array_copy, move): New.
418         (special_function_p): Synthesized move constructor.
419         (no_linkage_check): Handle lambdas.
420         * search.c (lookup_fnfields_1): Synthesized move constructor.
421         * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr):
422         Handle VEC_INIT_EXPR.
423         * typeck2.c (digest_init_r): Array copy.
424         * pt.c (get_template_info): Don't touch typedefs.
425         (instantiate_decl): Don't resubstitute artificial decls.
426         (tsubst_decl, tsubst, tsubst_copy_and_build): Handle lambdas.
427         (lookup_template_class): Don't fall back on name lookup.
428         * name-lookup.c (make_lambda_name): New.
429         (pushdecl_class_level): Handle default capture for lambda expressions.
430         (qualify_lookup): Handle decltypes within lambda expressions.
431         (pushtag): Handle ts_within_enclosing_non_class in function scope.
432
433 2009-09-28  Janis Johnson  <janis187@us.ibm.com>
434
435         * mangle.c (write_builtin_type): Support decimal float types.
436
437 2009-09-28  Richard Henderson  <rth@redhat.com>
438
439         * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
440
441 2009-09-24  Jakub Jelinek  <jakub@redhat.com>
442
443         * method.c (make_thunk, make_alias_for): Don't set
444         DECL_NO_STATIC_CHAIN.
445         * decl.c (builtin_function_1, grokfndecl): Likewise.
446         * lex.c (build_lang_decl): Likewise.
447
448 2009-09-23  Dodji Seketeli  <dodji@redhat.com>
449
450         PR debug/41065
451         * decl.c (cp_finish_decl): Record the types used by the global
452         variable declaration we've just parsed.
453
454 2009-09-22  Dodji Seketeli  <dodji@redhat.com>
455
456         * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
457         LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
458         LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
459         hooks for the c++ FE.
460         * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
461         function_parameter_expanded_from_pack_p): Declare ...
462         * pt.c (function_parameter_pack_p, get_function_template_decl,
463         function_parameter_expanded_from_pack_p): ... new hooks.
464         (get_template_info): Make this more robust.
465         (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
466         line between comment and function.
467         (get_template_argument_pack_elems): Fix comment.
468         (tsubst_decl): Arguments of function parameter packs are not
469         parameter packs themselves.
470
471 2009-09-21  Jason Merrill  <jason@redhat.com>
472
473         PR c++/41421
474         * tree.c (trivial_type_p): Fix logic.
475
476 2009-09-21  Jason Merrill  <jason@redhat.com>
477
478         * name-lookup.c (push_class_level_binding): Sanity check.
479
480 2009-09-18  Jason Merrill  <jason@redhat.com>
481
482         * decl2.c (determine_visibility): Make anonymous types internal.
483         (mark_used): Complain about types without linkage used in
484         decls with internal linkage.
485         (vague_linkage_fn_p): Split out from...
486         * decl.c (maybe_commonize_var): ...here.
487         (grokdeclarator): Adjust linkage when a typedef gives linkage name.
488         * tree.c (no_linkage_check): Check the enclosing class and template
489         arguments.
490
491         * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New.
492
493         * pt.c (get_pattern_parm): New.
494         (listify): Split out from...
495         (listify_autos): ...here.
496         (unify): Deduce std::initializer_list for T.
497         * call.c (build_over_call): Warn about it.
498
499 2009-09-17  Andrew Pinski  <pinskia@gcc.gnu.org>
500
501         PR c++/39365
502         * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
503         using same_type_p.
504         (convert_for_assignment): Likewise.
505         * cvt.c (type_promotes_to): Likewise.
506
507 2009-09-14  Richard Henderson  <rth@redhat.com>
508             Jakub Jelinek  <jakub@redhat.com>
509
510         * cp-tree.h (finish_asm_stmt): Update decl.
511         * parser.c (cp_parser_asm_definition): Parse asm goto.
512         (cp_parser_asm_label_list): New.
513         * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
514         (tsubst_expr): Handle asm labels.
515         * semantics.c (finish_asm_stmt): Add and use labels parameter.
516
517 2009-09-14  Richard Henderson  <rth@redhat.com>
518
519         * except.c (init_exception_processing): Don't call
520         default_init_unwind_resume_libfunc.
521         (cp_protect_cleanup_actions): Return the decl to call.
522         (build_exc_ptr): Use __builtin_eh_pointer.
523         * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
524
525 2009-09-13  Richard Guenther  <rguenther@suse.de>
526         Rafael Avila de Espindola  <espindola@google.com>
527
528         * except.c (init_exception_processing): Do not set
529         lang_eh_runtime_type.
530         (choose_personality_routine): Do not set eh_personality_decl,
531         set pragma_java_exceptions.
532         * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
533         (LANG_HOOKS_EH_PERSONALITY): Likewise.
534         (cp_eh_personality_decl): New.
535         (cp_eh_personality): Likewise.
536         * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
537         dependencies.
538
539 2009-09-13  Wei Guozhi  <carrot@google.com>
540
541         PR c++/3187
542         * cp/optimize.c (build_delete_destructor_body): New function.
543         (maybe_clone_body): Call build_delete_destructor_body for
544         deleting destructor.
545
546 2009-09-10  Jason Merrill  <jason@redhat.com>
547
548         * repo.c (extract_string, get_base_filename, init_repo): constify.
549
550 2009-09-09  Jason Merrill  <jason@redhat.com>
551
552         * error.c (find_typenames_r): Also add decltypes.
553
554 2009-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
555
556         PR c++/28293
557         * decl2.c (grokfield): Check for explicit template argument lists.
558
559 2009-09-09  Jack Howarth  <howarth@bromo.med.uc.edu>
560
561         PR bootstrap/41180
562         * Make-lang.in: Remove redundant code from linkage for darwin10.
563
564 2009-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
565
566         PR c++/39923
567         * decl.c (build_init_list_var_init): Check return value of
568         perform_implicit_conversion.
569
570 2009-09-08  Jason Merrill  <jason@redhat.com>
571
572         * class.c (currently_open_class): Make sure we're dealing with the
573         main variant.
574
575         * cp-tree.h (enum overload_flags): Remove OP_FLAG.
576         * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
577
578         * name-lookup.c (is_class_level): Remove.
579         (push_binding_level, leave_scope, resume_scope): Adjust.
580         (pushlevel_class): Adjust.
581         (poplevel_class): Make sure we're on class_binding_level.
582
583         * decl.c (grokmethod): Rename from start_method.
584         (finish_method): Remove.
585         * cp-tree.h: Adjust.
586         * parser.c (cp_parser_save_member_function_body): Adjust.
587
588 2009-09-03  Doug Kwan  <dougkwan@google.com>
589
590         * tree.c (cp_fix_function_decl_p): New.
591         (cp_free_lang_data): New.
592
593 2009-09-03  Diego Novillo  <dnovillo@google.com>
594
595         * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
596         * decl2.c: Include pointer-set.h.
597         (collect_candidates_for_java_method_aliases): New.
598         (cp_write_global_declarations): Call it.
599         Add local variable CANDIDATES.  If set, call
600         build_java_method_aliases.
601         (build_java_method_aliases): Add argument CANDIDATES.
602         Use it to determine if FNDECL should get a hidden alias.
603         * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
604         * cp-tree.h (cp_free_lang_data): Declare.
605
606 2009-09-03  Richard Guenther  <rguenther@suse.de>
607
608         * method.c (use_thunk): Use cgraph_finalize_function to hand
609         off thunks to the cgraph.
610         * semantics.c (emit_associated_thunks): Do not emit thunks
611         for really extern functions.
612
613 2009-09-03  Diego Novillo  <dnovillo@google.com>
614
615         * cp-lang.c (lang_hooks): Remove const qualifier.
616
617 2009-09-02  Jason Merrill  <jason@redhat.com>
618
619         * semantics.c (describable_type): Don't pretend to be in a template.
620
621         * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
622
623 2009-09-01  Alexandre Oliva  <aoliva@redhat.com>
624
625         * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
626         * cp-lang.c (cxx_dwarf_name): Pass it.
627         * error.c (count_non_default_template_args): Take flags as
628         argument.  Adjust all callers.  Skip counting of default
629         arguments if the new flag is given.
630
631 2009-09-01  Dodji Seketeli  <dodji@redhat.com>
632
633         PR bootstrap/41205
634         * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
635         GNU extension.
636
637 2009-09-01  Richard Guenther  <rguenther@suse.de>
638
639         * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
640         * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
641
642 2009-09-01  Richard Guenther  <rguenther@suse.de>
643
644         * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
645
646 2009-08-31  Dodji Seketeli  <dodji@redhat.com>
647
648         PR debug/30161
649         * cp-tree.h (get_template_info): Parameter should be const.
650         (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
651         (get_template_argument_pack_elems,
652         get_primary_template_innermost_parameters,
653         get_template_innermost_arguments, template_template_parameter_p):
654         Declare ...
655         * pt.c (get_template_argument_pack_elems,
656         get_template_innermost_parameters, get_template_innermost_arguments,
657         template_template_parameter_p):
658         ... New C++ front end implementation of new language hooks.
659         (primary_template_instantiation_p): New private helper.
660         (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
661         printf and strlen.
662         (get_template_info): Const-ify parameter.
663         * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
664         LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
665         LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
666         LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
667         interfaces for the C++ front-end.
668
669 2009-08-31  Jason Merrill  <jason@redhat.com>
670
671         PR c++/41127
672         * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
673         type-specifier-seq before we commit.
674
675 2009-08-28  Richard Guenther  <rguenther@suse.de>
676
677         PR lto/41058
678         * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
679         into the generic IL.
680
681 2009-08-27  Richard Guenther  <rguenther@suse.de>
682
683         * class.c (build_vtbl_ref_1): Remove excess vertical space.
684         * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
685         tracked by $(TREE_H).
686         * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
687
688 2009-08-26  Jason Merrill  <jason@redhat.com>
689
690         * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
691         if we're contextually converting to bool.
692         (build_conditional_expr): Likewise.
693         * typeck.c (condition_conversion): Likewise.
694
695         * call.c (build_conditional_expr): Fix logic errors.
696         (build_new_op): Remove dead COND_EXPR handling.
697
698 2009-08-24  Jason Merrill  <jason@redhat.com>
699
700         * cp-tree.h (DECL_DEFERRED_FN): Remove.
701         (struct lang_decl_fn): Remove deferred flag.
702         * class.c (build_clone): Don't set it.
703         * decl2.c (note_vague_linkage_fn): Don't check or set it.
704         (mark_used): Don't check it.
705         * method.c (make_thunk, make_alias_for): Don't set it.
706
707         * decl2.c (mark_used): Streamline logic.
708
709         PR c++/41109
710         PR c++/41110
711         PR c++/41134
712         * cp-tree.h (DECL_ODR_USED): New macro.
713         (struct lang_decl_base): Add odr_used flag.
714         * decl.c (duplicate_decls): Propagate it.  Use it for error.
715         * pt.c (register_specialization): Use it for error.
716         * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
717         (cp_write_global_declarations): Use it for error.
718         (tree_used_ok): Remove.
719         * cp-tree.h: Remove tree_used_ok.
720         * call.c (build_call_a): Don't call it.
721         * init.c (build_offset_ref): Likewise.
722
723 2009-08-21  Jakub Jelinek  <jakub@redhat.com>
724
725         PR c++/41131
726         * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
727         not TREE_STATIC.
728
729 2009-08-19  Jason Merrill  <jason@redhat.com>
730
731         PR c++/41119
732         PR c++/41120
733         * decl2.c (mark_used): Increment function_depth during synthesis.
734         * parser.c (cp_parser_default_argument): Not here.
735
736 2009-08-19  Jakub Jelinek  <jakub@redhat.com>
737
738         * method.c (use_thunk): Call free_after_compilation after
739         assemble_end_function.
740
741 2009-08-17  Richard Guenther  <rguenther@suse.de>
742
743         * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
744         Avoid useless copy.
745         (finish_enum): Keep variant chain intact.
746         * tree.c (cp_build_reference_type): Likewise.
747
748 2009-08-16  Jason Merrill  <jason@redhat.com>
749
750         Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
751         and VAR_DECL, so mark_used only has effect the first time.
752         * decl2.c (mark_used): Just return if TREE_USED is already set.
753         Don't set TREE_USED if cp_unevaluated_operand is set.
754         (tree_used_ok): New fn.
755         * init.c (build_offset_ref): Check it instead of TREE_USED.
756         * call.c (build_call_a): Likewise.
757         * cp-tree.h: Declare it.
758         (DECL_NO_LINKAGE_CHECKED): No longer needed.
759         (struct lang_decl_base): Remove no_linkage_checked bitfield.
760
761         * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
762
763         * decl2.c (mark_used): It's ok to synthesize for default args now.
764
765 2009-08-10  Jason Merrill  <jason@redhat.com>
766
767         Implement DR 757: It's OK for a decl to use a type without linkage
768         so long as the decl is defined in the current translation unit.
769         * decl2.c (no_linkage_decls): New vector.
770         (mark_used): Add decls that use types with no linkage.
771         (cp_write_global_declarations): Check that they are defined.
772         (decl_defined_p, no_linkage_error): New fns.
773         * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
774         (struct lang_decl_base): Add flag.
775         * decl.c (grokfndecl): Don't check type linkage.
776         (grokvardecl): If the type has no linkage, just make sure
777         DECL_LANG_SPECIFIC is set.
778         * pt.c (check_instantiated_arg): Don't check type linkage.
779         * name-lookup.c (is_local_extern): New fn.
780         * name-lookup.h: Declare it.
781
782 2009-08-05  Jason Merrill  <jason@redhat.com>
783
784         PR c++/40948
785         * init.c (build_vec_init): Evaluate the initializer before
786         starting the initialization try block.
787
788 2009-08-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>
789
790         PR c++/36069
791         * typeck.c (convert_for_assignment): Do not warn for any boolean
792         variant. Use explicit location.
793
794 2009-08-04  Dodji Seketeli  <dodji@redhat.com>
795
796         PR c++/39987
797         * pt.c (tsubst_default_argument): Let access checks of the
798         default argument happen in the context of the current function.
799
800 2009-08-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
801
802         PR c++/16696
803         * call.c (build_new_op): Only try prefix operator if -fpermissive,
804         otherwise just error.
805
806 2009-08-04  Dodji Seketeli  <dodji@redhat.com>
807
808         PR debug/39706
809         * error.c (lang_decl_name): Print qualified names for decls
810         in  namespace scope.
811
812 2009-08-03  Jason Merrill  <jason@redhat.com>
813             Jakub Jelinek  <jakub@redhat.com>
814
815         PR c++/40948
816         * init.c (build_vec_init): Look through a TARGET_EXPR around a
817         CONSTRUCTOR.
818
819 2009-07-31  Jason Merrill  <jason@redhat.com>
820             Douglas Gregor  <doug.gregor@gmail.com>
821
822         Remove implicit binding of lvalues to rvalue references (N2831)
823         * call.c (convert_class_to_reference): Binding an lvalue to an
824         rvalue reference is bad.  If the user-defined conversion is bad,
825         set bad_p before merging conversions.
826         (maybe_handle_ref_bind): Don't push down bad_p.
827         (reference_binding): Binding an lvalue to an rvalue reference is bad.
828         (convert_like_real): Give a helpful error about binding lvalue
829         to rvalue reference.
830         (reference_related_p): No longer static.
831         * typeck.c (build_typed_address): New.
832         (build_static_cast_1): Add static_cast from lvalue to &&.
833         * cp-tree.h: Adjust.
834
835 2009-07-31  Jason Merrill  <jason@redhat.com>
836
837         * call.c (reference_binding): Rename lvalue_p to is_lvalue.
838         Do direct binding of "rvalues" in memory to rvalue references.
839         * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
840         "rvalue" in memory.
841         * typeck.c (build_static_cast_1): Do direct binding of memory
842         "rvalues" to rvalue references.
843         * cvt.c (cp_fold_convert): New.
844         * cp-tree.h: Declare it.
845
846 2009-07-31  Jason Merrill  <jason@redhat.com>
847
848         * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
849         * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
850
851 2009-07-29  Jason Merrill  <jason@redhat.com>
852
853         PR c++/14912
854         * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
855         * error.c (count_non_default_template_args): Pass it.
856         * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
857
858 2009-07-29  Richard Guenther  <rguenther@suse.de>
859
860         PR c++/40834
861         * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
862         vars.
863
864 2009-07-26  Simon Martin  <simartin@users.sourceforge.net>
865
866         PR c++/40749
867         * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
868         with a qualified return type.
869
870 2009-07-24  Jason Merrill  <jason@redhat.com>
871
872         Core issue 901
873         * call.c (build_op_delete_call): If this is for a new-expression
874         and the op delete is deleted, do nothing.
875
876         Core issue 702
877         * call.c (compare_ics): Give list-initialization of std::init_list
878         priority over conversion to scalar, too.
879
880 2009-07-22  Jason Merrill  <jason@redhat.com>
881
882         * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
883         (needs_fake_anon): New.
884         (write_name): Check it.
885         (write_nested_name): Add a fake anonymous namespace scope if true.
886         * name-lookup.c (get_anonymous_namespace_name): No longer static.
887         * rtti.c, cp-tree.h: Adjust.
888
889 2009-07-22  Richard Guenther  <rguenther@suse.de>
890
891         PR c++/40799
892         * cp-gimplify.c (cp_gimplify_expr): Move handling of using
893         related exprs to ...
894         (cp_genericize_r): ... genericization stage.
895         (cp_genericize): Adjust.
896
897 2009-07-21  Jason Merrill  <jason@redhat.com>
898
899         Core issue 934
900         * call.c (reference_binding): Implement binding to { }.
901         (initialize_reference): Binding temporary to non-const && is fine.
902         * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
903
904         * decl.c (reshape_init_r): { T } is not an aggregate initializer
905         for class T.
906
907 2009-07-17  Richard Guenther  <rguenther@suse.de>
908
909         PR c/40401
910         * decl.c (finish_function): Do not emit unused result warnings
911         from here.
912         * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
913         c_warn_unused_result_pass.
914         * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
915         * optimize.c (clone_body): Clone in GENERIC.
916         (maybe_clone_body): Do not clear DECL_SAVED_TREE.
917         * decl2.c (cp_write_global_declarations): Fix body test.
918         Do not call cgraph_optimize.
919         * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
920         * method.c (use_thunk): Register thunk with
921         cgraph_finalize_function.
922         * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
923
924 2009-07-17  Richard Guenther  <rguenther@suse.de>
925
926         * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
927         temporary pointer.
928
929 2009-07-17  Aldy Hernandez  <aldyh@redhat.com>
930             Manuel López-Ibáñez  <manu@gcc.gnu.org>
931
932         PR 40435 
933         * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
934         tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
935         call.c, cvt.c, mangle.c: Add location argument to
936         fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
937         build_size_arg, build_fold_addr_expr, build_call_array,
938         non_lvalue, size_diffop, fold_build1_initializer,
939         fold_build2_initializer, fold_build3_initializer,
940         fold_build_call_array, fold_build_call_array_initializer,
941         fold_single_bit_test, omit_one_operand, omit_two_operands,
942         invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
943         fold_indirect_ref, combine_comparisons, fold_builtin_*,
944         fold_call_expr, build_range_check, maybe_fold_offset_to_address,
945         round_up, round_down.
946
947 2009-07-16  Jason Merrill  <jason@redhat.com>
948
949         PR libstdc++/37907
950         Split POD into "standard-layout" and "trivial" as per N2230,
951         Support std::is_standard_layout and std::is_trivial traits.
952         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
953         CPTK_IS_TRIVIAL.
954         (struct lang_type_class): Add non_std_layout.
955         (CLASSTYPE_NON_STD_LAYOUT): New.
956         * class.c (check_bases): Set it.
957         (check_field_decls): Likewise.
958         (check_bases_and_members): Likewise.
959         * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
960         RID_IS_TRIVIAL.
961         (cp_parser_trait_expr): Likewise.
962         * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
963         CPTK_IS_TRIVIAL.
964         (finish_trait_expr): Likewise.
965         * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
966         (pod_type_p): Use them.
967         (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
968
969         Adjust bits of the language that no longer refer to POD types.
970         * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
971         and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
972         (build_x_va_arg): Likewise.
973         (call_builtin_trap): Remove.
974         * decl.c (declare_local_label): Use type_has_nontrivial_default_init
975         and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
976         (cp_finish_decl): Likewise.
977         (check_previous_goto_1, check_goto): Adjust error.
978         * typeck.c (build_class_member_access_expr): Check
979         CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
980
981 2009-07-14  Taras Glek  <tglek@mozilla.com>
982             Rafael Espindola  <espindola@google.com>
983
984         * Make-lang.in: Added CP_PLUGIN_HEADERS and
985         c.install-target to export cp-tree.h cxx-pretty-print.h
986         name-lookup.h headers for plugins.
987
988 2009-07-14  Jason Merrill  <jason@redhat.com>
989
990         PR c++/37276
991         * decl.c (decls_match): A non-extern-C declaration doesn't match
992         a builtin extern-C declaration.
993
994         PR c++/40746
995         * name-lookup.c (qualified_lookup_using_namespace): Don't stop
996         looking in used namespaces just because we found something on
997         another branch.
998
999         PR c++/40740
1000         * semantics.c (perform_koenig_lookup): Handle empty template args.
1001
1002         * call.c (build_over_call): Use can_trust_pointer_alignment.
1003
1004 2009-07-14  Dodji Seketeli  <dodji@redhat.com>
1005
1006         PR debug/40705
1007         PR c++/403057
1008         * decl2.c (grokfield): Don't call set_underlying_type on typedef
1009         decls that are type names.
1010
1011 2009-07-13  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1012
1013         PR C++/22154
1014         * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
1015         front of qualified names.
1016
1017 2009-07-12  Jason Merrill  <jason@redhat.com>
1018
1019         PR c++/36628
1020         * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
1021
1022         PR c++/37206
1023         * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
1024         * tree.c (lvalue_p_1): Return it.  Remove
1025         treat_class_rvalues_as_lvalues parm.
1026         (real_lvalue_p): Disallow pseudo-lvalues here.
1027         (lvalue_or_rvalue_with_address_p): New fn.
1028         * call.c (initialize_reference): Use it instead of real_lvalue_p.
1029
1030         PR c++/40689
1031         * init.c (build_new_1): Handle initializer list as array initializer.
1032         (build_vec_init): Likewise.
1033         * typeck.c (cp_build_modify_expr): Likewise.
1034         * typeck2.c (process_init_constructor_array): Error rather than abort
1035         if too many initializers.
1036
1037 2009-07-10  Jakub Jelinek  <jakub@redhat.com>
1038
1039         PR c++/40502
1040         * error.c (cp_print_error_function): Check for NULL block.
1041
1042 2008-07-09  Simon Martin  <simartin@users.sourceforge.net>
1043             Jason Merrill  <jason@redhat.com>
1044
1045         * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1046         append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
1047
1048 2009-07-09  Dodji Seketeli  <dodji@redhat.com>
1049
1050         PR c++/40684
1051         * pt.c (type_unification_real): Use tsubst_template_arg instead
1052         of tsubst to substitute default template arguments.
1053
1054 2009-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1055
1056         PR c++/31246
1057         * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
1058         code.
1059         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1060         
1061
1062 2009-07-07  Jason Merrill  <jason@redhat.com>
1063
1064         PR c++/35828
1065         * pt.c (tsubst_decl): Don't abort if we didn't change anything
1066         in a TEMPLATE_DECL's args.
1067
1068 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1069
1070         * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
1071         EXPR_LOCATION.
1072         
1073 2009-07-07  Jason Merrill  <jason@redhat.com>
1074
1075         PR c++/37816
1076         * decl.c (build_enumerator): Don't add enumerators for a
1077         scoped enum to the enclosing class.
1078
1079         PR c++/40639
1080         * decl.c (start_enum): Allow dependent underlying type.
1081
1082         PR c++/40633
1083         * decl.c (finish_enum): Finish scope even in a template.
1084
1085 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1086
1087         * init.c: Replace %J by an explicit location. Update all calls.
1088         * decl.c: Likewise.
1089         * typeck2.c: Likewise.
1090         * pt.c: Likewise.
1091         * name-lookup.c: Likewise.
1092         
1093 2009-07-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1094
1095         * decl.c: Replace %H by an explicit location. Update all calls.
1096         * except.c: Likewise.
1097         * semantics.c: Likewise.
1098         * parser.c: Likewise.
1099
1100 2009-07-06  Simon Martin  <simartin@users.sourceforge.net>
1101
1102         PR c++/40557
1103         * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1104         append_type_to_template_for_access_check_1): Use
1105         RECORD_OR_UNION_CODE_P.
1106
1107 2009-07-04  Jason Merrill  <jason@redhat.com>
1108
1109         * pt.c (retrieve_specialization): Don't get confused by a
1110         using-declaration that brings in another instance of this template
1111         from a base class.
1112
1113         * ptree.c (cxx_print_type): Fix logic.
1114
1115         * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
1116
1117         PR c++/40619
1118         * cp-tree.h (struct lang_decl_parm): New.
1119         (struct lang_decl): Add it.
1120         (LANG_DECL_PARM_CHECK): New.
1121         (DECL_PARM_INDEX): New.
1122         * decl2.c (parm_index): Remove.
1123         * lex.c (retrofit_lang_decl): Handle parms.
1124         (cxx_dup_lang_specific_decl): Likewise.
1125         * mangle.c (write_expression): Adjust.
1126         * tree.c (cp_tree_equal): Adjust.
1127         (decl_linkage): Only check DECL_COMDAT for functions and variables.
1128         * parser.c (cp_parser_parameter_declaration_list): Set
1129         DECL_PARM_INDEX.
1130         * pt.c (iterative_hash_template_arg): Hash it.
1131
1132 2009-07-03  Jason Merrill  <jason@redhat.com>
1133
1134         * cp-tree.h (struct lang_decl): Overhaul.
1135         (struct lang_decl_flags): Remove.
1136         (struct lang_decl_base): New.
1137         (struct lang_decl_min): New.
1138         (struct lang_decl_fn): New.
1139         (struct lang_decl_ns): New.
1140         (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
1141         (LANG_DECL_MIN_CHECK): New.
1142         (LANG_DECL_FN_CHECK): New.
1143         (LANG_DECL_NS_CHECK): New.
1144         (STRIP_TEMPLATE): New.
1145         (NON_THUNK_FUNCTION_CHECK): Remove.
1146         (DECL_DECLARES_FUNCTION_P): New.
1147         (lots): Adjust.
1148         * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
1149         * decl.c (push_local_name, duplicate_decls): Adjust.
1150         * decl2.c (start_objects): Don't set u2sel.
1151         * semantics.c (finish_omp_threadprivate): Adjust.
1152         * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
1153         (decl_cloned_function_p): Out-of-line implementation of macros.
1154         (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
1155         * mangle.c (write_unqualified_name): Don't check function flags
1156         on non-functions.
1157         * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
1158         * pt.c (build_template_decl): Don't set function flags.
1159         (check_default_tmpl_args): Check that it's a function.
1160         (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
1161         cloned template.
1162
1163         * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
1164         DECL_CLONED_FUNCTION.
1165
1166         * cp-tree.h (struct lang_type_class): Move sorted_fields here.
1167         * class.c (finish_struct_1): Adjust.
1168         * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
1169         * search.c (lookup_field_1): Adjust.
1170
1171         * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
1172         * decl.c (finish_method): Don't add to it.
1173         * class.c (fixup_pending_inline): Remove.
1174         (fixup_inline_methods): Remove.
1175         (finish_struct_1): Don't call it.
1176
1177         * error.c (dump_function_name): Handle null name.
1178
1179 2009-07-02  Mark Mitchell  <mark@codesourcery.com>
1180
1181         * typeck.c (cp_build_binary_op): Move warnings about use of NULL
1182         in arithmetic earlier and allow comparisions of NULL with
1183         pointers-to-members.
1184
1185 2009-07-02  Jason Merrill  <jason@redhat.com>
1186
1187         Use hash tables for template specialization lookup.
1188         * pt.c (struct spec_entry): New type.
1189         (decl_specializations, type_specializations): New hash tables.
1190         (register_specialization, retrieve_specialization): Use them.
1191         (reregister_specialization, lookup_template_class): Use them.
1192         (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
1193         (iterative_hash_template_arg): New.
1194         (init_template_processing): New
1195         (process_partial_specialization): Don't look to see if we already
1196         have this partial specialization.
1197         (maybe_process_partial_specialization): Handle reassigning
1198         full specializations when we get an explicit specialization
1199         of the partial instantiation.
1200         (tsubst_friend_function): Adjust specialization reassignment code.
1201         (instantiate_template): Only do one lookup.
1202         (instantiate_decl): Don't do any lookup.
1203         * cp-tree.h: Declare init_template_processing.
1204         * decl.c (duplicate_decls): Pass args to reregister_specialization.
1205
1206 2009-07-01  Jason Merrill  <jason@redhat.com>
1207
1208         * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
1209
1210         * pt.c (register_specialization): Use duplicate_decls to merge
1211         the argument with a previous specialization.
1212         (check_explicit_specialization): Call register_specialization to
1213         merge the TEMPLATE_DECL with a previous version.
1214         (determine_specialization): Return the args even if fn is a template.
1215
1216 2009-07-01  Ian Lance Taylor  <iant@google.com>
1217
1218         * g++spec.c (lang_specific_driver): Bump num_args by 1.
1219
1220 2009-06-30  Jason Merrill  <jason@redhat.com>
1221
1222         PR c++/40595
1223         * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
1224         EXPR_PACK_EXPANSION.
1225
1226 2009-06-29  Jason Merrill  <jason@redhat.com>
1227
1228         PR c++/40274
1229         * error.c (dump_template_parms): Pass all args to
1230         count_non_default_template_args.
1231         (count_non_default_template_args): Pull out the inner ones.
1232
1233 2009-06-26  H.J. Lu  <hongjiu.lu@intel.com>
1234
1235         * decl.c (duplicate_decls): Re-indent.
1236
1237 2009-06-25  Ian Lance Taylor  <iant@google.com>
1238
1239         * call.c (avoid_sign_compare_warnings): New static function.
1240         (build_new_op): Call it.
1241         * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
1242         TREE_NO_WARNING is set on either operand.
1243
1244 2009-06-25  Ian Lance Taylor  <iant@google.com>
1245
1246         * g++spec.c (SKIPOPT): define.
1247         (lang_specific_driver): Handle -static-libstdc++.  Only add
1248         LIBSTDCXX_STATIC if we add LIBSTDCXX.
1249
1250 2009-06-25  Ian Lance Taylor  <iant@google.com>
1251
1252         * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
1253         the second nor third operand has side effects.
1254
1255 2009-06-25  Ian Lance Taylor  <iant@google.com>
1256
1257         * parser.c (cp_parser_binary_expression): Increment
1258         c_inhibit_evaluation_warnings while parsing the right hand side of
1259         "true || x" or "false && x".
1260         * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
1261         if c_inhibit_evaluation_warnings is zero.
1262
1263 2009-06-24  Jason Merrill  <jason@redhat.com>
1264
1265         * error.c (dump_decl): Do say "typedef" for the injected class name.
1266
1267         * pt.c (lookup_template_class): Use currently_open_class,
1268         compare template args later.
1269
1270         PR c++/40342
1271         * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
1272         * class.c (resolve_address_of_overloaded_function): Fix typo.
1273
1274 2009-06-18  Aldy Hernandez  <aldyh@redhat.com>
1275
1276         * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
1277         * decl.c (finish_decl): Remove.
1278         (declare_global_var): Replace finish_decl with cp_finish_decl.
1279         (start_method): Same.
1280         * rtti.c (emit_tinfo_decl): Same.
1281         * pt.c (tsubst_expr): Same.
1282         (instantiate_decl): Same.
1283         * decl2.c (grokbitfield): Same.
1284         * name-lookup.c (pushdecl_top_level_1): Same.
1285         * cp-tree.h: Remove finish_decl.
1286
1287 2009-06-16  David Edelsohn  <edelsohn@gnu.org>
1288
1289         * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
1290         (lang_specific_driver): Always allocate extra argument.
1291         Add LIBSTDCXX_STATIC to arglist if defined and linking
1292         statically.
1293
1294 2009-06-16  Ian Lance Taylor  <iant@google.com>
1295
1296         * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
1297         (cp/semantics.o): Depend upon gt-cp-semantics.h.
1298
1299 2009-06-16  Ian Lance Taylor  <iant@google.com>
1300
1301         * parser.c (cp_unevaluated_operand): Define global variable.
1302         (cp_parser_question_colon_clause): Increment
1303         c_inhibit_evaluation_warnings when evaluating an expression which
1304         will never be executed.
1305         (cp_parser_decltype): Increment cp_unevaluated_operand and
1306         c_inhibit_evaluation_warnings, not skip_evaluation.
1307         (cp_parser_sizeof_operand): Likewise.
1308         (cp_parser_enclosed_template_argument_list): Save
1309         cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1310         skip_evaluation.
1311         * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
1312         Add unevaluated_operand and inhibit_evaluation_warnings fields.
1313         (cp_unevaluated_operand): Declare.
1314         * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
1315         and c_inhibit_evaluation_warnings rather than skip_evaluation.
1316         (pop_from_top_level): Restore cp_unevaluated_operand and
1317         c_inhibit_evaluation_warnings rather than skip_evaluation.
1318         * class.c (build_base_path): Check cp_unevaluated_operand rather
1319         than skip_evaluation.
1320         * typeck.c (build_class_member_access_expr): Likewise.
1321         (cp_build_binary_op): Don't warn about bad shift counts if
1322         c_inhibit_evaluation_warnings is non-zero.
1323         * pt.c (coerce_template_parms): Save state of
1324         cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1325         skip_evaluation.
1326         (tsubst_aggr_type): Likewise.
1327         (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
1328         skip_evaluation.
1329         (tsubst_copy): Likewise.
1330         (tsubst): Set cp_unevaluated_operand and
1331         c_inhibit_evaluation_warnings, not skip_evaluation.
1332         (tsubst_copy_and_build): Likewise.
1333         * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
1334         rather than skip_evaluation.
1335         * decl2.c (mark_used): Likewise.
1336         * semantics.c (finish_non_static_data_member): Likewise.
1337         * cvt.c (cp_convert_and_check): Check
1338         c_inhibit_evaluation_warnings rather than skip_evaluation.
1339         * mangle.c (write_type): Set cp_unevaluated_operand rather than
1340         skip_evaluation.
1341
1342 2009-06-15  Ian Lance Taylor  <iant@google.com>
1343
1344         * parser.c (cp_parser_direct_declarator): Add braces around
1345         variables declared before label.
1346
1347 2009-06-15  Rafael Avila de Espindola  <espindola@google.com>
1348
1349         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
1350         * cp-tree.h (cxx_comdat_group): Change signature.
1351         * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
1352         (cxx_comdat_group): Change signature.
1353         * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
1354         make_decl_one_only.
1355         (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
1356         * method.c (use_thunk): Update call to make_decl_one_only.
1357         * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
1358
1359 2009-06-12  Aldy Hernandez  <aldyh@redhat.com>
1360
1361         * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
1362         (build_modify_expr): New arg.
1363         * semantics.c (finish_unary_op_expr): Pass location to
1364         overflow_warning.
1365         (handle_omp_for_class_iterator): Pass location to build_modify_expr.
1366         * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
1367         c_sizeof_or_alignof_type.
1368         (build_array_ref): New argument.
1369         (build_compound_expr): Same.
1370         (build_const_cast): Same.
1371         (build_ptrmemfunc): Pass location to build_c_cast.
1372         * init.c (avoid_placement_new_aliasing): Pass location to
1373         build_stmt.
1374         (build_vec_delete_1): Pass location to cp_build_modify_expr,
1375         build_compound_expr.
1376         * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1377         * decl.c (poplevel): Pass location to c_build_bind_expr.
1378         (finish_case_label): Pass location to build_case_label.
1379         (finish_constructor_body): Same.
1380         (finish_destructor_body): Pass location to build_stmt.
1381         (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
1382         * call.c (build_new_op): Pass location to build_array_ref.
1383         (build_x_va_arg): Pass location to build_va_arg.
1384         * except.c (expand_end_catch_block): Pass location to
1385         build_stmt.
1386         * cp-tree.h (build_array_ref): New argument.
1387         (build_compound_expr): Same.
1388         (build_c_cast): Same.
1389         * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
1390         (gimplify_switch_stmt): Same.
1391         * typeck2.c (split_nonconstant_init_1): Same.
1392         * pt.c (tsubst_copy): Same.
1393         * semantics.c (add_decl_expr): Same.
1394         (do_poplevel): Same.
1395         (push_cleanup): Same.
1396         (finish_goto_stmt): Same.
1397         (finish_expr_stmt): Same.
1398         (begin_if_stmt): Same.
1399         (begin_while_stmt): Same.
1400         (begin_do_stmt): Same.
1401         (finish_return_stmt): Same.
1402         (begin_for_stmt): Same.
1403         (finish_break_stmt): Same.
1404         (finish_continue_stmt): Same.
1405         (begin_switch_stmt): Same.
1406         (begin_try_block): Same.
1407         (begin_handler): Same.
1408         (finish_asm_stmt): Same.
1409         (finish_label_stmt): Same.
1410         (finish_stmt_expr_expr): Same.
1411         (finalize_nrv_r): Same.
1412         (finish_omp_atomic): Same.
1413         * name-lookup.c (do_using_directive): Same.
1414         * decl2.c (grok_array_decl): Same.
1415         * parser.c (cp_parser_cast_expression): Same.
1416         (cp_parser_selection_statement): Same.
1417         (cp_parser_implicitly_scoped_statement): Same.
1418         (cp_parser_objc_selector_expression): Same.
1419         (cp_parser_objc_synchronized_statement): Same.
1420         (cp_parser_objc_throw_statement): Same.
1421         (cp_parser_omp_critical): Same.
1422         (cp_parser_omp_master): Same.
1423         * typeck.c (build_function_call): Add location argument.
1424         * init.c: Add location argument to all build_decl calls.
1425         * class.c: Same.
1426         * method.c: Same.
1427         * rtti.c: Same.
1428         * tree.c: Same.
1429         * pt.c: Same.
1430         * semantics.c: Same.
1431         * lex.c: Same.
1432         * decl2.c: Same.
1433         * cp-gimplify.c: Same.
1434         * decl.c: Same.
1435         (cp_make_fname_decl): Add location argument.  Pass location ot
1436         build_decl.
1437         (finish_case_label): Same.
1438         * cp-tree.h (finish_case_label): Add location argument.
1439         * parser.c (cp_parser_label_for_labeled_statement): Pass location to
1440         finish_case_label.
1441         
1442 2009-06-09  Jason Merrill  <jason@redhat.com>
1443
1444         PR c++/40381
1445         * decl2.c (mark_used): Return after complaining about deleted fn.
1446
1447 2009-06-08  Jason Merrill  <jason@redhat.com>
1448
1449         * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
1450         late-specified return type.
1451
1452 2009-06-08  Jakub Jelinek  <jakub@redhat.com>
1453
1454         PR c++/40373
1455         * call.c (check_dtor_name): Return false even if
1456         get_type_value (name) is error_mark_node.
1457
1458         PR c++/40370
1459         PR c++/40372
1460         * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
1461         on error_mark_node.  Check for VLAs outside of function context
1462         before check whether to wrap bounds into a NOP_EXPR with
1463         TREE_SIDE_EFFECTS.
1464
1465 2009-06-08  Alexandre Oliva  <aoliva@redhat.com>
1466
1467         * repo.c (get_base_filename): Use aux_base_name rather than
1468         alternate temporary file during second compare debug compilation.
1469         (finish_repo): Skip during -fcompare-debug-second.
1470
1471 2009-06-06  Ian Lance Taylor  <iant@google.com>
1472
1473         * parser.c (cp_parser_label_for_labeled_statement): Support
1474         attribute on labels if immediately followed by semicolon.
1475         * semantics.c (finish_label_stmt): Return new label.
1476         * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
1477
1478 2009-06-03  Ian Lance Taylor  <iant@google.com>
1479
1480         * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
1481         $(SYSTEM_H).
1482
1483 2009-06-02  Mark Mitchell  <mark@codesourcery.com>
1484
1485         * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
1486
1487 2009-06-02  Jason Merrill  <jason@redhat.com>
1488
1489         PR c++/40308
1490         PR c++/40311
1491         * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1492         conversion code.
1493         * call.c (implicit_conversion): Allow init-list conversion to scalar
1494         during direct-initialization, too.  Mark the conversion bad if it
1495         has too many levels of braces.
1496         (convert_like_real): And give a helpful error.
1497
1498         PR c++/40306
1499         PR c++/40307
1500         * decl.c (cp_finish_decl): Handle auto deduction from ().
1501         * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1502         with dependent type that is known to be a pointer.
1503
1504 2009-06-02  Simon Martin  <simartin@users.sourceforge.net>
1505
1506         PR c++/38089
1507         * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1508         specializations in an invalid namespace.
1509
1510 2009-06-01  Aldy Hernandez  <aldyh@redhat.com>
1511
1512         * error.c (print_instantiation_partial_context): Print column
1513         numbers.
1514
1515 2009-05-29  Ian Lance Taylor  <iant@google.com>
1516
1517         * error.c (cp_printer): Don't use va_arg with enum type.
1518
1519 2009-05-28  Dodji Seketeli  <dodji@redhat.com>
1520
1521         PR c++/39754
1522         * cp-tree.h (canonical_type_variant): Remove this function declaration.
1523         (strip_typedefs): New function declaration.
1524         * tree.c (strip_typedefs): New function definition.
1525         (canonical_type_variant): Remove function definition.
1526         * cvt.c (convert_from_reference): No need to use
1527         canonical_type_variant.
1528         * typeck.c (cp_build_indirect_ref): Likewise.
1529         * error.c (dump_template_bindings): Use strip_typedefs instead of
1530         canonical_type_variant.
1531         * pt.c (convert_template_argument, unify): Likewise.
1532         * mangle.c (canonicalize_for_substitution): Don't use
1533         canonical_type_variant.
1534
1535 2009-05-27  Jason Merrill  <jason@redhat.com>
1536
1537         * call.c (implicit_conversion): Handle conversion from
1538         initializer-list to scalar.
1539         (convert_like_real): Likewise.  Avoid crashing on list
1540         initialization with bad conversions.
1541         (can_convert): Use LOOKUP_EXPLICIT.
1542         (can_convert_arg_bad): Add flags parm.
1543         * cp-tree.h: Adjust.
1544         * typeck.c (convert_for_assignment): Pass flags.
1545
1546 2009-05-27  Ian Lance Taylor  <iant@google.com>
1547
1548         * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1549         (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1550
1551 2009-05-26  Ian Lance Taylor  <iant@google.com>
1552
1553         * Make-lang.in (g++spec.o): Use $(COMPILER).
1554         (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1555         (cc1plus$(exeext)): Likewise.
1556
1557 2009-05-26  Dodji Seketeli  <dodji@redhat.com>
1558
1559         PR c++/40007
1560         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1561         (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1562         (get_types_needing_access_check): Declare new entry point.
1563         * pt.c (append_type_to_template_for_access_check_1,
1564         get_types_needing_access_check): New functions.
1565         (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1566         RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1567         get_types_needing_access_check, no more
1568         MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1569         (instantiate_class_template): Set input_location to the source
1570         location of the most specialized template definition.
1571         Perform access check using the RECORD_TYPE of the template, not its
1572         associated most generic TEMPLATE_DECL.
1573         (append_type_to_template_for_access_check): Augment function
1574         comments. Use the new get_types_needing_access_check, not
1575         MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1576         append_type_to_template_for_access_check_1 subroutine.
1577
1578 2009-05-22  Jason Merrill  <jason@redhat.com>
1579
1580         PR c++/38064
1581         * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1582         arithmetic comparisons.
1583         (cp_common_type): Handle scoped enums.
1584
1585         * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1586         (add_builtin_candidate, add_builtin_candidates): Likewise.
1587         (convert_like_real): Likewise.
1588         * class.c (check_bitfield_decl): Likewise.
1589         * decl.c (check_static_variable_definition): Likewise.
1590         (compute_array_index_type): Likewise.
1591         * decl2.c (grokbitfield): Likewise.
1592         * init.c (build_new_1): Likewise.
1593         * pt.c (convert_nontype_argument): Likewise.
1594         (current_instantiation): Likewise.
1595         * tree.c (pod_type_p): Likewise.
1596         * typeck.c (build_static_cast_1): Likewise.
1597         (build_reinterpret_cast_1): Likewise.
1598
1599 2009-05-22  Richard Guenther  <rguenther@suse.de>
1600
1601         PR middle-end/38964
1602         * init.c (avoid_placement_new_aliasing): Remove.
1603         (build_new_1): Do not call it.
1604
1605 2009-05-22  Mark Mitchell  <mark@codesourcery.com>
1606
1607         * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1608         * semantics.c (expand_or_defer_fn): Similarly.
1609
1610 2009-05-20  Ian Lance Taylor  <iant@google.com>
1611
1612         * parser.c (cp_parser_postfix_expression): Change args to a vec.
1613         Release it when done.
1614         (tree_vector): Define typedef.  Define VEC functions.
1615         (cp_parser_parenthesized_expression_list): Change return type to
1616         vec.  Change all callers.
1617         (cp_parser_new_expression): Change placement and initializer to
1618         vecs.  Release them when done.
1619         (cp_parser_new_placement): Change return type to vec.  Change all
1620         callers.
1621         (cp_parser_new_initializer): Likewise.
1622         * typeck.c (build_function_call_vec): Just call
1623         cp_build_function_call_vec.
1624         (cp_build_function_call): Just build a vec and call
1625         cp_build_function_call_vec.
1626         (cp_build_function_call_vec): New function based on old
1627         cp_build_function_call.
1628         (convert_arguments): Remove nargs and argarray parameters.  Change
1629         values to a vec.  Change caller.
1630         (build_x_compound_expr_from_vec): New function.
1631         (cp_build_modify_expr): Build vec to pass to
1632         build_special_member_call.
1633         * call.c (struct z_candidate): Add first_arg field.  Change args
1634         field to vec.
1635         (convert_class_to_reference): Handle first argument separately.
1636         (add_candidate): Add first_arg parameter.  Change args parameter
1637         to vec.  Change all callers.
1638         (add_function_candidate, add_conv_candidate): Likewise.
1639         (add_template_candidate_real, add_template_candidate): Likewise.
1640         (add_template_conv_candidate): Likewise.
1641         (build_user_type_conversion_1): Handle first argument separately.
1642         (resolve_args): Change return type and parameter type to vecs.
1643         Change all callers.
1644         (perform_overload_resolution): Change args parameter to vec.
1645         Change all callers.
1646         (build_new_function_call, build_operator_new_call): Likewise.
1647         (add_candidates): Likewise.
1648         (build_op_call): New globally visible function, built from and
1649         replacing static function build_object_call.
1650         (build_new_op): Don't handle CALL_EXPR.  Build vec, not tree_list,
1651         of arguments.
1652         (build_op_delete_call): Build vec to pass to
1653         cp_build_function_call_vec.
1654         (build_temp): Build vec to pass to build_special_member_call.
1655         (convert_like_real): Likewise.
1656         (perform_direct_initialization_if_possible): Likewise.
1657         (build_over_call): Handle first_arg field.  Use build_call_array
1658         rather than build_call_list.
1659         (build_special_member_call): Change args parameter to vec.  Change
1660         all callers.
1661         (build_new_method_call): Likewise.
1662         * init.c (expand_default_init): Change parms to vec.
1663         (build_raw_new_expr): Change placement and init to vecs.  Change
1664         all callers.
1665         (build_new_1, build_new): Likewise.
1666         * class.c (resolve_address_of_overloaded_function): Build array to
1667         pass to fn_type_unification.
1668         * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1669         build_new.  For CALL_EXPR create a vec rather than a tree_list;
1670         expand a pack if necessary.
1671         (fn_type_unification): Change args parameter to const tree *.  Add
1672         nargs parameter.  Change all callers.
1673         (type_unification_real): Likewise.
1674         (unify): Build array to pass to type_unification_real.
1675         (get_bindings): Build array to pass to fn_type_unification.
1676         (any_type_dependent_arguments_p): Change args parameter to a vec.
1677         Change all callers.
1678         (make_args_non_dependent): Renamed from build_non_dependent_args.
1679         Change return type to void.  Change parameter type to vec.  Change
1680         all callers.
1681         (do_auto_deduction): Pass an array to type_unification_real.
1682         * semantics.c (perform_koenig_lookup): Change args to vec.  Change
1683         all callers.
1684         (finish_call_expr): Change args to vec.  Change all callers.  Call
1685         build_op_call instead of passing CALL_EXPR to build_new_op.
1686         (cxx_omp_create_clause_info): Allocate vec to pass to
1687         build_special_member_call.
1688         * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1689         to vec.  Change all callers.
1690         * name-lookup.c (lookup_function_nonclass): Likewise.
1691         (struct arg_lookup): Change args to vec.
1692         (arg_assoc_namespace): Handle args as a vec.
1693         (arg_assoc_args_vec): New static function.
1694         (lookup_arg_dependent): Change args parameter to vec.  Change all
1695         callers.
1696         * method.c (do_build_assign_ref): Allocate vec to pass to
1697         build_special_member_call.
1698         * except.c (build_throw): Likewise.
1699         * typeck2.c (build_functional_cast): Likewise.
1700         * cvt.c (ocp_convert): Likewise.
1701         * tree.c (build_min_non_dep_call_vec): Change last parameter to
1702         vec.  Change all callers.
1703         * cp-tree.h: Update declarations.
1704         * name-lookup.h: Update declarations.
1705
1706 2009-05-20  Sandra Loosemore  <sandra@codesourcery.com>
1707
1708         * typeck.c (default_conversion): Check targetm.promoted_type.
1709         * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1710         (grokparms): Check targetm.invalid_parameter_type.
1711         * cvt.c (ocp_convert): Check targetm.convert_to_type.
1712         (build_expr_type_conversion): Check targetm.promoted_type.
1713
1714 2009-05-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1715
1716         * typeck.c (build_binary_op): Allow % on integal vectors.
1717
1718 2009-05-18  Jason Merrill  <jason@redhat.com>
1719
1720         Implement explicit conversions ops as specified in N2437.
1721         * decl.c (grokdeclarator): Handle explicit conversion ops.
1722         (check_initializer): Pass flags to store_init_value.
1723         * decl2.c (maybe_emit_vtables): Likewise.
1724         * init.c (expand_aggr_init_1): Likewise.
1725         * call.c (convert_class_to_reference): Take flags parm,
1726         check DECL_NONCONVERTING_P.
1727         (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1728         (add_builtin_candidates): Simplify getting type of conversion.
1729         (build_object_call): Likewise.  Check DECL_NONCONVERTING_P.
1730         (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1731         (reference_binding): Take flags parm.  Direct-initialize copy parm.
1732         (add_function_candidate): Direct-initialize the copy parm.
1733         (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1734         (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1735         (conditional_conversion): Likewise.
1736         (convert_like_real): Only complain about DECL_NONCONVERTING_P
1737         constructors.
1738         (perform_implicit_conversion_flags): Add flags parm to
1739         perform_implicit_conversion.  Improve diagnostics.
1740         * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1741         (LOOKUP_COPY_PARM): New bit macro.
1742         * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1743         * typeck.c (convert_for_assignment): Take flags parm, pass it to
1744         perform_implicit_conversion_flags.
1745         (cp_build_modify_expr): Pass flags to convert_for_assignment.
1746         (convert_for_initialization): Likewise.
1747         * typeck2.c (store_init_value): Take flags parm, pass to
1748         digest_init_flags.
1749         (digest_init_flags): Add flags parm to digest_init.
1750         (digest_init_r): Take flags parm, pass to convert_for_initialization.
1751         (process_init_constructor_array): Pass it.
1752         (process_init_constructor_record): Likewise.
1753         (process_init_constructor_union): Likewise.
1754
1755 2009-05-16  Jason Merrill  <jason@redhat.com>
1756
1757         PR c++/40139
1758         * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1759         with a dependent type.  Actually look up the destructor.
1760         * semantics.c (finish_id_expression): Fix logic.
1761         (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1762         a function.
1763         * typeck.c (build_x_unary_op): Diagnose taking the address of a
1764         constructor or destructor.
1765         * tree.c (get_first_fn): Handle OFFSET_REF.
1766
1767 2009-05-17  Joseph Myers  <joseph@codesourcery.com>
1768
1769         * tree.c (cxx_printable_name_internal): Allow consecutive
1770         translated and untranslated cached copies of the name of the
1771         current function.
1772
1773 2009-05-15  Ian Lance Taylor  <iant@google.com>
1774
1775         * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1776         cp_lvalue_kind.  Change all uses.
1777         (enum base_access_flags): Rename from enum base_access.  Change
1778         all uses.
1779         * parser.c (enum cp_parser_flags): Remove enum tag.
1780
1781 2009-05-15  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1782
1783         PR 16302
1784         * call.c (build_new_op): Update calls to warn_logical_operator.
1785
1786 2009-05-14  Ian Lance Taylor  <iant@google.com>
1787
1788         * class.c (layout_class_type): Change itk to unsigned int.
1789         * decl.c (finish_enum): Change itk to unsigned int.
1790         * parser.c (cp_parser_check_decl_spec): Change ds to int.  Remove
1791         casts.
1792
1793 2009-05-13  David Mandelin <dmandelin@mozilla.com>:
1794
1795         * decl.c (duplicate_decls): Preserve parameter attributes.
1796
1797 2009-05-10  Jan Hubicka  <jh@suse.cz>
1798
1799         * decl2.c (cxx_callgraph_analyze_expr): Use
1800         cgraph_mark_address_taken.
1801
1802 2009-05-10  Joseph Myers  <joseph@codesourcery.com>
1803
1804         * call.c (name_as_c_string): Call type_as_string_translate.
1805         Translate identifiers to locale character set.
1806         * cp-tree.h (lang_decl_name): Update prototype.
1807         (type_as_string_translate, decl_as_string_translate,
1808         cxx_printable_name_translate): Declare.
1809         * cxx-pretty-print.c (M_): Define.
1810         (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1811         English fragments for conditional translation with M_.
1812         * decl.c (grokdeclarator): Translate identifiers to locale
1813         character set for diagnostics.
1814         * error.c (M_): Define.
1815         (dump_template_bindings, dump_type, dump_aggr_type,
1816         dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1817         dump_function_decl, dump_template_parms, dump_expr,
1818         dump_binary_op, op_to_string, assop_to_string): Mark English
1819         fragments for conditional translation with M_.
1820         (type_as_string): Disable translation of identifiers.
1821         (type_as_string_translate): New.
1822         (expr_as_string): Disable translation of identifiers.
1823         (decl_as_string): Disable translation of identifiers.
1824         (decl_as_string_translate): New.
1825         (lang_decl_name): Add parameter translate.
1826         (args_to_string): Call type_as_string_translate.
1827         (cp_print_error_function): Call cxx_printable_name_translate.
1828         (print_instantiation_full_context,
1829         print_instantiation_partial_context): Call
1830         decl_as_string_translate.
1831         * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1832         identifier in diagnostic.
1833         * tree.c (cxx_printable_name): Change to
1834         cxx_printable_name_internal.  Add parameter translate.
1835         (cxx_printable_name, cxx_printable_name_translate): New wrappers
1836         round cxx_printable_name_internal.
1837
1838 2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>
1839
1840         PR c/36892
1841         * call.c (build_call_a): Updated warn_deprecated_use call.
1842         (build_over_call): Likewise.
1843         * decl.c (grokdeclarator): Likewise.
1844         (grokparms): Likewise.
1845         * semantics.c (finish_id_expression): Likewise.
1846         * typeck.c (build_class_member_access_expr): Likewise.
1847         (finish_class_member_access_expr): Likewise.
1848
1849 2009-05-06  Dodji Seketeli  <dodji@redhat.com>
1850
1851         PR c++/17395
1852         * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1853         whole list of PARM_DECLs, just the current one.
1854
1855 2009-05-05  Shujing Zhao  <pearly.zhao@oracle.com>
1856
1857         * cp-tree.h:
1858         (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1859         mangle_compound_literal): Remove unused declarations.
1860         (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1861         adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1862         pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1863         check_for_out_of_scope_variable, print_other_binding_stack,
1864         maybe_push_decl, cxx_mark_addressable, force_target_expr,
1865         build_target_expr_with_type, finish_case_label,
1866         cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1867         check_template_keyword, cxx_omp_predetermined_sharing,
1868         cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1869         cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1870         cxx_omp_privatize_by_reference): Rearrange the declarations line to
1871         match the comment that indicates the .c file which the functions are
1872         defined.
1873         (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1874         cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1875
1876 2009-05-05  Nathan Sidwell  <nathan@codesourcery.com>
1877
1878         * typeck.c (cp_build_compound_expr): Require RHS to have a known
1879         type.
1880         * class.c (resolve_address_of_overloaded_function): Use
1881         OVL_CURRENT for error message.
1882         (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1883         with them.  Do not copy the node.
1884
1885 2009-05-05  Jakub Jelinek  <jakub@redhat.com>
1886
1887         PR c++/40013
1888         * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1889         set it from its operand's type after tsubst_expr.
1890
1891 2009-05-04  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1892
1893         PR c++/28152
1894         * parser.c (cp_lexer_get_preprocessor_token):  Do not store the
1895         canonical spelling for keywords.
1896         (cp_parser_attribute_list): Use the canonical spelling for
1897         keywords in attributes.
1898
1899 2009-05-01  Joseph Myers  <joseph@codesourcery.com>
1900
1901         * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1902         pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1903         pp_cxx_new_expression, pp_cxx_delete_expression,
1904         pp_cxx_unary_expression, pp_cxx_assignment_operator,
1905         pp_cxx_assignment_expression, pp_cxx_expression,
1906         pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1907         pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1908         pp_cxx_exception_specification, pp_cxx_direct_declarator,
1909         pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1910         pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1911         pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1912         pp_cxx_declaration, pp_cxx_typeid_expression,
1913         pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1914         pp_cxx_trait_expression): Mostly use pp_string and
1915         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1916         for non-identifiers.  Mark English strings for translation.
1917         * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1918         * error.c (dump_template_parameter, dump_template_bindings,
1919         dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1920         dump_decl, dump_template_decl, dump_function_decl,
1921         dump_parameters, dump_exception_spec, dump_template_parms,
1922         dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1923         assop_to_string, args_to_string, cp_print_error_function,
1924         print_instantiation_full_context,
1925         print_instantiation_partial_context): Mostly use pp_string and
1926         pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1927         for non-identifiers.  Mark English strings for translation.
1928         (dump_global_iord): Mark strings for translation; use longer
1929         strings instead of substituting single words.
1930         (function_category): Return a format string marked for
1931         translation, not a single word or phrase to substitute in a longer
1932         phrase.
1933
1934 2009-04-28  Ben Elliston  <bje@au.ibm.com>
1935
1936         PR c++/35652
1937         Revert:
1938
1939         2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1940
1941         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1942
1943 2009-04-27  Ian Lance Taylor  <iant@google.com>
1944
1945         * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1946         omp_clause_code.
1947
1948 2009-04-27  Jakub Jelinek  <jakub@redhat.com>
1949
1950         PR c++/39875
1951         * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1952         -Wunused-value if implicit.
1953
1954 2009-04-24  Ian Lance Taylor  <iant@google.com>
1955
1956         * call.c (build_temp): Change 0 to enum constant.
1957         * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1958         type.
1959         * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1960         * decl2.c (constrain_visibility): Likewise.
1961         * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1962         (cp_parser_flags): Typedef to int rather than enum type.
1963         (cp_parser_expression_stack_entry): Change prec field to enum
1964         cp_parser_prec.
1965
1966         * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1967         Change all callers.
1968
1969 2009-04-22  Dodji Seketeli  <dodji@redhat.com>
1970
1971         PR c++/39639
1972         * parser.c (cp_parser_template_argument_list): Display an error
1973         when an ellipsis is not preceded by a parameter pack. Also, warn
1974         about variadic templates usage without -std=c++0x.
1975
1976 2009-04-21  Taras Glek <tglek@mozilla.com>
1977
1978         * cp-tree.h: Update GTY annotations to new syntax.
1979         * decl.c: Likewise.
1980         * mangle.c: Likewise.
1981         * name-lookup.c: Likewise.
1982         * name-lookup.h: Likewise.
1983         * parser.c: Likewise.
1984         * pt.c: Likewise.
1985         * rtti.c: Likewise.
1986         * semantics.c: Likewise.
1987         * typeck2.c: Likewise.
1988
1989 2009-04-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1990
1991         PR c++/14875
1992         * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1993
1994 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1995
1996         PR c++/35711
1997         * typeck.c (check_for_casting_away_constness): We diagnose casting
1998         away any qualifiers not just constness.
1999         (casts_away_constness): Mention that it handles more than just
2000         constness.
2001         
2002 2009-04-21  Joseph Myers  <joseph@codesourcery.com>
2003
2004         * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
2005         ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
2006         ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
2007         ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
2008         ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
2009         cfns.gperf: Add copyright and license notices.
2010         * cfns.h: Regenerate.
2011         * ChangeLog, ChangeLog-2004: Correct dates.
2012
2013 2009-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2014
2015         PR 16202
2016         * tree.c (lvalue_p_1): Use const_tree.
2017         Use CONST_CAST_TREE to avoid warning.
2018         (lvalue_p): Returns bool, receives const_tree.
2019
2020 2009-04-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2021
2022         PR c++/13358
2023         * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
2024         * error.c (pedwarn_cxx98): New.
2025         * cp-tree.h (pedwarn_cxx98): Declare.
2026
2027 2009-04-20  Le-Chun Wu  <lcwu@google.com>
2028
2029         PR c++/39803
2030         * init.c (build_vec_init): Set TREE_NO_WARNING on the
2031         compiler-generated INDIRECT_REF expression.
2032
2033 2009-04-20  Ian Lance Taylor  <iant@google.com>
2034
2035         * typeck.c (build_function_call_vec): New function.
2036         (cp_build_function_call): Only pass first parameter to
2037         objc_rewrite_function_call.
2038         (build_modify_expr): Add rhs_origtype parameter.  Change all
2039         callers.
2040         * decl.c (finish_decl): Add origtype parameter.  Change all
2041         callers.
2042         * semantics.c (finish_call_expr): Pass VEC to
2043         resolve_overloaded_builtin.
2044
2045 2009-04-20  Ian Lance Taylor  <iant@google.com>
2046
2047         * cp-tree.h (base_access): Change typedef to int.
2048         * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
2049         (cp_parser_omp_threadprivate): Likewise.
2050         * pt.c (unify_pack_expansion): Add casts to enum type.
2051
2052 2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2053
2054         PR c/32061
2055         PR c++/36954
2056         * call.c (build_new_op): Save the original codes of operands
2057         before folding.
2058
2059 2009-04-18  Kazu Hirata  <kazu@codesourcery.com>
2060
2061         * cp-tree.h: Remove the prototype for insert_block.
2062         * decl.c (insert_block): Remove.
2063
2064 2009-04-16  Ian Lance Taylor  <iant@google.com>
2065
2066         * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
2067         (tsubst_flags_t): Change typedef from enum type to int.
2068
2069 2009-04-16  Paolo Bonzini  <bonzini@gnu.org>
2070
2071         * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
2072         instead of targetm.vector_opaque_p.
2073
2074 2009-04-15  Le-Chun Wu  <lcwu@google.com>
2075
2076         PR c++/39551
2077         * call.c (build_over_call): Set TREE_NO_WARNING on the
2078         compiler-generated INDIRECT_REF expression.
2079         * cvt.c (convert_to_void): Emit warning when stripping off
2080         INDIRECT_REF.
2081
2082 2009-04-14  Diego Novillo  <dnovillo@google.com>
2083
2084         * parser.c (cp_parser_type_specifier_seq): Move call to
2085         invoke_plugin_callbacks ...
2086         (cp_parser_type_specifier_seq): ... here.
2087
2088 2009-04-14  Le-Chun Wu  <lcwu@google.com>
2089
2090         * Make-lang.in: Modify dependencies of files including plugin.h.
2091         * decl.c (finish_function): Call invoke_plugin_callbacks.
2092         * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
2093
2094 2009-04-14  Jason Merrill  <jason@redhat.com>
2095
2096         PR c++/39763
2097         * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
2098         about shadowing by tentative parms.
2099
2100 2009-04-13  Jason Merrill  <jason@redhat.com>
2101
2102         PR c++/39480
2103         * call.c (build_over_call): Don't call memcpy if the target is
2104         the same as the source.
2105
2106 2009-04-13  Jason Merrill  <jason@redhat.com>
2107
2108         PR c++/39750
2109         * pt.c (uses_template_parms): Handle CONSTRUCTOR.
2110
2111 2009-04-12  Jason Merrill  <jason@redhat.com>
2112
2113         PR c++/39742
2114         * call.c (joust): Don't crash on variadic fn.
2115
2116 2009-04-10  Jason Merrill  <jason@redhat.com>
2117
2118         PR c++/28301
2119         * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
2120         if we see a close brace without an open brace.
2121
2122 2009-04-10  H.J. Lu  <hongjiu.lu@intel.com>
2123
2124         * parser.c (cp_parser_class_specifier): Remove the unused
2125         has_trailing_semicolon.
2126
2127 2009-04-10  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2128
2129         PR  c++/20118
2130         * parser.c (cp_parser_check_template_parameters): Take a
2131         cp_declarator parameter.
2132         (cp_parser_elaborated_type_specifier): Update to
2133         cp_parser_check_template_parameters.
2134         (cp_parser_class_head): Likewise.
2135         (cp_parser_check_declarator_template_parameters): Likewise.
2136         (cp_parser_check_template_parameters): Handle first the non-error
2137         conditions. Give more accurate diagnostics if a declarator is
2138         given. 
2139
2140 2009-04-08  Jason Merrill  <jason@redhat.com>
2141
2142         PR c++/25185
2143         * error.c (dump_aggr_type): Chase template typedefs if
2144         -fno-pretty-templates.
2145
2146 2009-04-08  Dodji Seketeli  <dodji@redhat.com>
2147
2148         PR c++/39637
2149         * parser.c (cp_parser_enumerator_definition): Make sure the
2150         initializer of the enumerator doesn't contain any bare parameter pack.
2151
2152 2009-04-07  Jason Merrill  <jason@redhat.com>
2153
2154         PR c++/34691
2155         * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
2156         * call.c (joust): Complain about mismatched default arguments
2157         in extern "C" functions.
2158         * class.c (resolve_address_of_overloaded_function): Handle multiple
2159         extern "C" functions.
2160         * pt.c (resolve_overloaded_unification): Likewise.
2161
2162 2009-04-07  Jason Merrill  <jason@redhat.com>
2163
2164         PR c++/25185
2165         * error.c (dump_function_decl): Don't pretty-print templates
2166         if -fno-pretty-templates.
2167         (count_non_default_template_args): Print all args if
2168         -fno-pretty-templates.
2169
2170 2009-04-06  Jason Merrill  <jason@redhat.com>
2171
2172         PR c++/35146
2173         * pt.c (fn_type_unification): For DEDUCE_EXACT check that
2174         the deduced template arguments give us the parameter types
2175         we're looking for.
2176
2177 2009-04-05  Giovanni Bajo <giovannibajo@libero.it>
2178             Jason Merrill  <jason@redhat.com>
2179
2180         PR c++/14912
2181         * error.c (count_non_default_template_args): New fn.
2182         (dump_template_parms): Call it.
2183         (dump_template_argument_list): Call it.  Add parms parm.
2184         (dump_template_argument): Adjust call to dump_template_argument_list.
2185         (dump_type, dump_decl): Likewise.
2186         (dump_template_bindings): Refactor logic.
2187
2188 2009-04-03  Jason Merrill  <jason@redhat.com>
2189
2190         PR c++/25185
2191         * error.c (dump_template_bindings): Look through typedefs in
2192         typename results.
2193         (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
2194         (find_typenames_r): Also collect typedefs.
2195         * pt.c (unify): Strip typedefs.
2196
2197         PR c++/39608
2198         * semantics.c (finish_id_expression): Don't assume a dependent
2199         member of the current instantiation isn't a valid integral
2200         constant expression.  Check dependent_scope_p.
2201         * pt.c (dependent_scope_p): Check TYPE_P.
2202         (tsubst_copy): If args is null, just return.
2203
2204 2009-04-02  Jason Merrill  <jason@redhat.com>
2205
2206         PR c++/25185
2207         * error.c (find_typenames, find_typenames_r): New fns.
2208         (dump_function_decl): Call find_typenames.
2209         (dump_template_bindings): Print typenames as well.
2210         * pt.c (tsubst): Non-static.
2211         * cp-tree.h: Declare it.
2212
2213 2009-04-02  Dodji Seketeli  <dodji@redhat.com>
2214
2215         PR c++/26693
2216         * decl2.c (grokfield): when a typedef appears in a
2217         class, create the typedef variant type node for it.
2218         (save_template_attributes): Creating typedef variant type node
2219          here is now useless.
2220         * decl.c (grokdeclarator): If the typedef'ed struct/class was
2221         anonymous, set the proper type name to all its type variants.
2222         (xref_basetypes) : Fixup the variant types after setting
2223         TYPE_BINFO on REF.
2224         * name-lookup.c (pushdecl_maybe_friend): Reuse the
2225         set_underlying_type function to install typedef variant types.
2226         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2227         macro.
2228         (append_type_to_template_for_access_check): New entry points.
2229         * semantics.c (check_accessibility_of_qualified_id):
2230         When a typedef that is a member of a class appears in a template,
2231         add it to the template. It will be ...
2232         * class.c (finish_struct_bits): Split type variant fixup into ...
2233         (fixup_type_variants): A new entry point.
2234         * pt.c (instantiate_class_template, instantiate_template ): ... access
2235         checked at template instantiation time.
2236         (resolve_type_name_type): The type name should be the name of the
2237         main type variant.
2238         (retrieve_specialization): Specializations of template typedefs aren't
2239         to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
2240         (append_type_to_template_for_access_check): New entry point.
2241         (tsubst_decl): For typedefs, build the variant type from the correct
2242         original type.
2243         (get_class_bindings): Fix function comment.
2244         (perform_typedefs_access_check): New entry point.
2245
2246 2009-03-31  Jason Merrill  <jason@redhat.com>
2247
2248         PR c++/34691
2249         * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
2250         extern "C" declarations.
2251
2252         C++ DR 613
2253         * semantics.c (finish_non_static_data_member): Allow such references
2254         without an associated object in sizeof/decltype/alignof.
2255
2256         * ptree.c (cxx_print_decl): Pretty-print full name of
2257         function/template.
2258         (cxx_print_type): Pretty-print full name of class.
2259
2260         * decl.c (grokdeclarator): Reject pointer to qualified function
2261         type.
2262
2263         PR c++/37806, core issue 547
2264         * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
2265         to a typedef.
2266         * tree.c (cp_build_qualified_type_real): Don't apply restrict to a 
2267         function type.
2268         * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
2269         * decl.c (groktypename): Add is_template_arg parameter.
2270         (grokdeclarator): Allow function cv-quals on a template type arg.
2271         * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
2272         is_template_arg argument in calls to groktypename.
2273         * cp-tree.h: Adjust prototype.
2274         * error.c (dump_type_prefix, dump_type_suffix): Fix plain 
2275         FUNCTION_TYPE printing.
2276         
2277         * mangle.c (write_expression): Mangle dependent name as
2278         source-name.
2279
2280         PR c++/38030, 38850, 39070
2281         * pt.c (type_dependent_expression_p_push): New fn.
2282         (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
2283         substitution makes the call non-dependent.  Preserve koenig_p.
2284         * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
2285         for non-dependent calls.
2286         * semantics.c (finish_call_expr): Revert earlier changes.
2287         * cp-tree.h: Revert change to finish_call_expr prototype.
2288
2289 2009-03-29  Joseph Myers  <joseph@codesourcery.com>
2290
2291         PR preprocessor/34695
2292         * cp-tree.h (cp_cpp_error): Remove.
2293         * error.c (cp_cpp_error): Remove.
2294         * parser.c (cp_lexer_new_main): Set done_lexing instead of
2295         client_diagnostic and error callback.
2296
2297 2009-03-28  Paolo Bonzini  <bonzini@gnu.org>
2298
2299         * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2300         * cp/cp-objcp-common.c (cxx_staticp): Remove.
2301         * cp/cp-tree.h (cxx_staticp): Remove.
2302
2303 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
2304
2305         PR c++/39554
2306         * parser.c (cp_parser_postfix_expression): Don't call
2307         warning_if_disallowed_function_p.
2308
2309 2009-03-27  Jan Hubicka  <jh@suse.cz>
2310
2311         * except.c (choose_personality_routine): Set terminate_node to abort
2312         for java exceptions.
2313
2314 2009-03-27  Dodji Seketeli  <dodji@redhat.com>
2315             Jakub Jelinek  <jakub@redhat.com>
2316
2317         PR debug/37959
2318         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
2319         (cp_function_decl_explicit_p): New prototype.
2320         * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
2321
2322 2009-03-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2323
2324         PR c++/38638
2325         * parser.c (cp_parser_elaborated_type_specifier): If we have a
2326         typename tag and don't have either a TYPE_DECL or a
2327         TEMPLATE_ID_EXPR, set the type to NULL.
2328
2329 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
2330
2331         PR c++/37647
2332         * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
2333         scope.
2334
2335 2009-03-27  Simon Martin  <simartin@users.sourceforge.net>
2336
2337         PR c++/29727
2338         * decl.c (check_array_designated_initializer): Handle error_mark_node.
2339
2340 2009-03-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2341
2342         PR c++/35652
2343         * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2344
2345 2009-03-26  Andrew Haley  <aph@redhat.com>
2346
2347         PR C++/39380
2348         * decl2.c (possibly_inlined_p): If java exceptions are in use
2349         don't inline a decl unless it is explicitly marked inline.
2350         * lex.c: (pragma_java_exceptions): New variable.
2351         (handle_pragma_java_exceptions): Set pragma_java_exceptions.
2352         * cp-tree.h (pragma_java_exceptions): Declare new variable.
2353
2354 2009-03-24  Jason Merrill  <jason@redhat.com>
2355
2356         PR c++/28274
2357         * name-lookup.c (pushdecl_maybe_friend): Check default args later.
2358
2359 2009-03-23  Jakub Jelinek  <jakub@redhat.com>
2360
2361         PR c/39495
2362         * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
2363         code if iter is the second operand.
2364         * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
2365         argument.  If it is set, don't build the toplevel expression with
2366         build_x_binary_op, but build2.
2367         (cp_parser_assignment_expression,  cp_parser_omp_for_incr): Adjust
2368         callers.
2369         (cp_parser_omp_for_cond): Don't assume the first operand of the
2370         comparison must be decl.
2371
2372 2009-03-23  Jason Merrill  <jason@redhat.com>
2373
2374         PR c++/37729
2375         * pt.c (make_fnparm_pack): Split out from...
2376         (instantiate_decl): ...here.
2377         (tsubst_pack_expansion): Handle being called in a late-specified
2378         return type.
2379
2380         PR c++/39526
2381         * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
2382         a parm with a parm.
2383
2384 2009-03-20  Jason Merrill  <jason@redhat.com>
2385
2386         PR c++/28879
2387         * parser.c (cp_parser_direct_declarator): In a template, wrap 
2388         non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
2389         * pt.c (tsubst): Preserve it in a partial instantiation.
2390         (dependent_type_p_r): Don't check value_dependent_expression_p.
2391         * decl.c (compute_array_index_type): Don't check
2392         value_dependent_expression_p if TREE_SIDE_EFFECTS.
2393
2394         C++ core issue 703
2395         * typeck2.c (check_narrowing): Don't complain about loss of 
2396         precision when converting a floating-point constant.
2397
2398 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
2399
2400         PR c/39495
2401         * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
2402         (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
2403
2404 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
2405
2406         * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
2407         (eof_token): Adjust.
2408
2409 2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
2410
2411         PR c++/39425
2412         * parser.c (cp_parser_explicit_specialization): Don't skip the
2413         rest of the specialization when begin_specialization returns
2414         false.
2415
2416 2009-03-17  Jason Merrill  <jason@redhat.com>
2417
2418         * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
2419         (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
2420         * pt.c (check_explicit_specialization): Likewise.
2421         (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
2422         local specialization.
2423         * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
2424         * decl2.c (parm_index): New fn.
2425         * semantics.c (finish_decltype_type): Don't use describable_type.
2426         * mangle.c (write_expression): Likewise.  Mangle ALIGNOF_EXPR.
2427         Give a sorry for unsupported codes rather than crash.  Mangle
2428         conversions with other than 1 operand.  New mangling for PARM_DECL.
2429         * operators.def (ALIGNOF_EXPR): Mangle as "az".
2430
2431 2009-03-17  Jing Yu  <jingyu@google.com>
2432
2433         PR middle-end/39378
2434         * method.c (use_thunk): Change is_thunk from crtl to cfun.
2435
2436 2009-03-17  Paolo Carlini  <paolo.carlini@oracle.com>
2437
2438         PR c++/39475
2439         * semantics.c (check_trait_type): New.
2440         (finish_trait_expr): Use it.
2441
2442 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
2443
2444         * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
2445         instead of calling imported_module_or_decl debug hook if
2446         building_stmt_tree ().
2447         * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
2448         is a NAMESPACE_DECL.
2449
2450         PR debug/37890
2451         * name-lookup.c (do_namespace_alias): Don't call global_decl debug
2452         hook at function scope.
2453
2454         PR debug/39471
2455         * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
2456         on IMPORTED_DECL.
2457
2458 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
2459
2460         PR c++/39371
2461         * semantics.c (finish_switch_cond): Don't call get_unwidened.
2462         * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
2463         instead of TREE_TYPE (cond).
2464
2465 2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2466
2467         PR c++/39060
2468         * parser.c (cp_parser_late_parsing_default_args): Continue
2469         the loop when cp_parser_assignment_expression returns
2470         error_mark_node.
2471
2472 2009-03-07  Jason Merrill  <jason@redhat.com>
2473
2474         PR c++/39367
2475         * init.c (build_new_1): Don't use a VLA type.
2476         (build_vec_init): Handle getting a pointer for BASE.
2477
2478 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
2479
2480         PR c++/37520
2481         * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
2482         when mangling symbols.
2483
2484 2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
2485
2486         PR c++/33492
2487         * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
2488
2489 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
2490
2491         * decl.c (record_builtin_java_type): Use canonicalized integer
2492         types.
2493
2494 2009-03-04  Jason Merrill  <jason@redhat.com>
2495
2496         PR c++/38908
2497         * class.c (is_really_empty_class): New fn.
2498         * cp-tree.h: Declare it.
2499         * cp-objcp-common.c (cp_expr_size): Use it.
2500
2501         PR c++/13549
2502         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2503         * parser.c (cp_parser_postfix_expression): Call it for 
2504         TEMPLATE_ID_EXPR.
2505         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2506         (get_first_fn): Likewise.
2507
2508         PR c++/9634
2509         PR c++/29469
2510         PR c++/29607
2511         Implement DR 224.
2512         * decl.c (make_typename_type): Do look inside currently open classes.
2513         * parser.c (cp_parser_lookup_name): Likewise.
2514         (cp_parser_template_name): Likewise.
2515         * pt.c (dependent_scope_p): New function.
2516         * cp-tree.h: Declare it.
2517         * class.c (currently_open_class): Return fast if T isn't a class.
2518
2519 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
2520
2521         PR c++/37789
2522         * parser.c (cp_parser_mem_initializer): Return error_mark_node
2523         if cp_parser_mem_initializer_id returns error_mark_node.
2524
2525 2009-02-24  Richard Guenther  <rguenther@suse.de>
2526
2527         PR c++/39242
2528         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2529         declared functions.
2530
2531 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
2532
2533         PR c++/36411
2534         * pt.c (coerce_template_template_parms): Return 0 if parameter
2535         is error_mark_node.
2536
2537 2009-02-23  Jason Merrill  <jason@redhat.com>
2538
2539         * pt.c (unify): Call maybe_adjust_types_for_deduction when
2540         deducing from an initializer list.
2541
2542 2009-02-20  Jason Merrill  <jason@redhat.com>
2543
2544         PR c++/39225
2545         * decl.c (grokdeclarator): Handle ~identifier.
2546
2547 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
2548
2549         PR target/39175
2550         * decl2.c (determine_visibility): If visibility changed and
2551         DECL_RTL has been already set, call make_decl_rtl to update symbol
2552         flags.
2553
2554 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
2555
2556         PR c++/39188
2557         * cp-tree.h (maybe_commonize_var): New.
2558
2559         * decl.c (maybe_commonize_var): Make it extern.
2560
2561         * decl2.c (finish_anon_union): Call maybe_commonize_var.
2562
2563 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
2564
2565         PR c++/39219
2566         * parser.c (cp_parser_enum_specifier): Apply all attributes.
2567
2568 2009-02-18  Jason Merrill  <jason@redhat.com>
2569
2570         * cfns.h: Tweak pathname for cfns.gperf.
2571
2572 2009-02-13  Jason Merrill  <jason@redhat.com>
2573
2574         PR c++/39070
2575         * semantics.c (finish_call_expr): Change koenig_p parm to int.
2576         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2577         * cp-tree.h: Adjust prototype.
2578         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2579
2580 2009-02-12  Jason Merrill  <jason@redhat.com>
2581
2582         PR c++/38950
2583         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2584
2585 2009-02-11  Jason Merrill  <jason@redhat.com>
2586
2587         PR c++/39153
2588         * decl2.c (cp_write_global_declarations): 
2589         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2590
2591         PR c++/30111
2592         * init.c (build_value_init_noctor): Split out from...
2593         (build_value_init): ...here.
2594         (expand_aggr_init_1): Handle value-initialization.
2595         * cp-tree.h: Add declaration.
2596         * class.c (type_has_user_provided_constructor): 
2597         Handle non-class arguments.
2598
2599 2009-02-10  Jason Merrill  <jason@redhat.com>
2600
2601         PR c++/38649
2602         * class.c (defaultable_fn_p): Handle ... properly.
2603
2604         PR c++/36744
2605         * tree.c (lvalue_p_1): Condition rvalue ref handling on
2606         treat_class_rvalues_as_lvalues, too.
2607
2608 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
2609
2610         PR c++/34397
2611         * typeck.c (build_x_array_ref): New.
2612         * cp-tree.h: Declare it.
2613         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2614
2615 2009-02-09  Jason Merrill  <jason@redhat.com>
2616
2617         PR c++/39109
2618         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2619         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2620         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2621         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2622         for build_value_init TARGET_EXPR.
2623         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2624
2625 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
2626
2627         PR c++/35147
2628         PR c++/37737
2629         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2630
2631 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
2632
2633         PR c++/39095
2634         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2635         remove ./dt operator.
2636         * mangle.c (write_expression): Handle COMPONENT_REF after handling
2637         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2638         write_string ("dt") instead of using operators.def.
2639
2640 2009-02-03  Jason Merrill  <jason@redhat.com>
2641
2642         * typeck.c (cp_build_unary_op): Only complain about taking address
2643         of main if pedantic.
2644
2645 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
2646
2647         PR inline-asm/39059
2648         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2649
2650         PR c++/39056
2651         * typeck2.c (digest_init_r): Don't call process_init_constructor
2652         for COMPLEX_TYPE.
2653
2654 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
2655
2656         PR c++/36897
2657         * pt.c (convert_nontype_argument_function): Expect expr to be an
2658         ADDR_EXPR.
2659
2660         PR c++/37314
2661         * typeck.c (merge_types): Call resolve_typename_type if only
2662         one type is a typename.
2663
2664 2009-02-02  Jason Merrill  <jason@redhat.com>
2665
2666         PR c++/39054
2667         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
2668         in BIT_NOT_EXPR.
2669
2670 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
2671
2672         PR c++/39053
2673         * parser.c (cp_parser_pure_specifier): If there are no tokens left
2674         do not call cp_lexer_consume_token.
2675
2676 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
2677
2678         PR c++/39028
2679         * parser.c (cp_parser_already_scoped_statement): Handle __label__
2680         declarations.
2681
2682 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
2683
2684         PR c++/33465
2685         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2686
2687 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
2688
2689         PR c++/38655
2690         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2691
2692 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
2693
2694         * typeck.c (invalid_nonstatic_memfn_p): Use
2695         DECL_NONSTATIC_MEMBER_FUNCTION_P.
2696
2697 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
2698
2699         PR c++/37554
2700         * call.c (build_over_call): If convert_for_arg_passing returns
2701         error_mark_node unconditionally return it.
2702
2703 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
2704
2705         * class.c (check_field_decls): Also inherit packed for bitfields
2706         regardless of their type.
2707
2708 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
2709
2710         PR c++/38930
2711         * decl2.c (grokfield): Reverting changes of PR c++/26693
2712         (save_template_attributes): Likewise.
2713         * decl.c (grokdeclarator): Likewise.
2714         * name-lookup.c (pushdecl_maybe_friend): Likewise.
2715         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2716         (append_type_to_template_for_access_check): Likewise.
2717         * semantics.c (check_accessibility_of_qualified_id): Likewise.
2718         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2719         (tsubst): Likewise.
2720         (resolve_type_name_type): Likewise.
2721         (append_type_to_template_for_access_check): Likewise.
2722
2723 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
2724
2725         PR c++/26693
2726         * decl2.c (grokfield): when a typedef appears in a
2727         class, create the typedef variant type node for it.
2728         (save_template_attributes): Creating typedef variant type node
2729          here is now useless.
2730         * decl.c (grokdeclarator): If the typedef'ed struct/class was
2731         anonymous, set the proper type name to all its type variants.
2732         * name-lookup.c (pushdecl_maybe_friend): Reuse the
2733         set_underlying_type function to install typedef variant types.
2734         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2735         macro.
2736         (append_type_to_template_for_access_check): New entry points.
2737         * semantics.c (check_accessibility_of_qualified_id):
2738         When a typedef that is a member of a class appears in a template,
2739         add it to the template. It will be ...
2740         * pt.c (instantiate_class_template, instantiate_template ): ... access
2741         checked at template instantiation time.
2742         (tsubst): Handle the case of being called with NULL args.
2743         (resolve_type_name_type): The type name should be the name of the
2744         main type variant.
2745         (append_type_to_template_for_access_check): New entry point.
2746
2747 2009-01-19  Jason Merrill  <jason@redhat.com>
2748
2749         PR c++/23287
2750         * parser.c (cp_parser_unqualified_id): In a template,
2751         accept ~identifier.
2752         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2753
2754 2009-01-16  Jason Merrill  <jason@redhat.com>
2755
2756         PR c++/38877
2757         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2758         * init.c (build_new): Don't call describable_type unless we
2759         have an auto.
2760
2761         PR c++/29470
2762         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2763
2764         PR c++/38579
2765         * search.c (protected_accessible_p): N doesn't vary.
2766
2767 2009-01-15  Jason Merrill  <jason@redhat.com>
2768
2769         PR c++/38850
2770         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2771         accept hidden friends.
2772
2773 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2774
2775         PR C++/29388
2776         * decl.c (grokdeclarator): Check for a non namespace/class context.
2777
2778 2009-01-15  Jason Merrill  <jason@redhat.com>
2779
2780         PR c++/36334
2781         PR c++/37646
2782         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
2783         a function isn't necessarily an lvalue. Take tree, not const_tree.
2784         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2785         * typeck.c (lvalue_or_else): Likewise.
2786         * cp-tree.h: Adjust prototypes.
2787
2788 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
2789
2790         PR c++/38357
2791         * pt.c (tsubst): Check for NULL args.
2792
2793 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
2794
2795         PR c++/38636
2796         * name-lookup.c (pushtag): Don't create members to types that are not
2797         being created.
2798
2799 2009-01-14  Nick Clifton  <nickc@redhat.com>
2800
2801         PR c++/37862
2802         * parser.c: Pass cp_id_kind computed in
2803         cp_parser_postfix_dot_deref_expression to
2804         cp_parser_primary_expression.
2805
2806 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
2807
2808         PR c++/38795
2809         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2810         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2811         as CAST_EXPR.
2812
2813 2009-01-12  Jason Merrill  <jason@redhat.com>
2814             Steve Ellcey  <sje@cup.hp.com>
2815
2816         PR c++/35109
2817         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
2818         binding.
2819
2820 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
2821
2822         PR c++/36019
2823         * pt.c (parameter_of_template_p): New function.
2824         * cp-tree.h: Declare it.
2825         * name-lookup.c (binding_to_template_parms_of_scope_p): New
2826         function.
2827         (outer_binding): Take template parameters in account when looking for
2828         a name binding.
2829
2830 2009-01-12  Jason Merrill  <jason@redhat.com>
2831
2832         PR c++/31488
2833         * tree.c (pod_type_p): Return 1 for structs created by the back end.
2834
2835 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
2836
2837         PR c/32041
2838         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2839         offsetof member-designator, handle it as `[0].'.
2840
2841         PR c++/38794
2842         * decl.c (start_function): If grokdeclarator hasn't returned
2843         FUNCTION_DECL nor error_mark_node, issue diagnostics.
2844
2845 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
2846
2847         PR c++/36254
2848         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2849         (gimplify_if_stmt): ... this.
2850         (cp_gimplify_expr): Don't handle IF_STMT here.
2851         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2852
2853 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
2854
2855         PR c++/38648
2856         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2857
2858         PR c++/36695
2859         * typeck2.c (build_functional_cast): Check for reference type and NULL
2860         PARMS.
2861
2862 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
2863
2864         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2865
2866 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
2867
2868         PR c++/35335
2869         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2870
2871 2009-01-09  John F. Carr  <jfc@mit.edu>
2872
2873         PR c++/37877
2874         * parser.c (cp_parser_class_specifier): Clear
2875         parser->in_unbraced_linkage_specification_p while parsing class
2876         specifiers.
2877
2878 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
2879
2880         PR c++/38725
2881         * semantics.c (finish_goto_stmt): Convert destination to
2882         void *.
2883
2884 2009-01-06  Jason Merrill  <jason@redhat.com>
2885
2886         PR c++/35297
2887         PR c++/35477
2888         PR c++/35784
2889         PR c++/36846
2890         PR c++/38276
2891         * pt.c (check_default_tmpl_args): Don't complain about
2892         out-of-order parameter packs in the enclosing class
2893         or parameter packs after default args.
2894         (coerce_template_parms): If we have more than one
2895         parameter pack, don't flatten argument packs.
2896         (template_args_equal): Handle argument packs.
2897         (comp_template_args): Don't flatten argument packs.
2898         (check_instantiated_arg): Split out from...
2899         (check_instantiated_args): Here.  Handle arg packs.
2900         (convert_template_argument): Just check that nontype argument
2901         packs have the right type.
2902
2903 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
2904
2905         PR c++/38472
2906         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2907
2908 2009-01-05  Jason Merrill  <jason@redhat.com>
2909
2910         PR c++/38698
2911         * typeck2.c (process_init_constructor_union): Handle union with
2912         no fields.
2913
2914         * mangle.c (write_expression): Remove mangling for zero-operand
2915         casts.
2916
2917         PR c++/38701
2918         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2919         defaulting.
2920
2921         PR c++/38702
2922         * class.c (defaultable_fn_p): Only operator== can be a copy
2923         assignment operator.
2924
2925 2009-01-02  Jason Merrill  <jason@redhat.com>
2926
2927         PR c++/38698
2928         * typeck2.c (process_init_constructor_union): Handle excess
2929         initializers.
2930         (process_init_constructor_record): Likewise.
2931
2932         PR c++/38684
2933         * typeck2.c (digest_init_r): Don't use process_init_constructor
2934         for non-aggregate classes.
2935
2936 \f
2937 Copyright (C) 2009 Free Software Foundation, Inc.
2938
2939 Copying and distribution of this file, with or without modification,
2940 are permitted in any medium without royalty provided the copyright
2941 notice and this notice are preserved.