1 2013-08-23 Jan Hubicka <jh@suse.cz>
3 * cp-tree.h (struct lang_type_class): Free is_final bit.
4 (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
5 (DECL_FINAL_P): Remove.
6 * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
7 is called on CLASS_TYPE_P.
9 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
11 * cxx-pretty-print.c (M_): Remove.
12 (pp_cxx_unqualified_id): Use translate_string instead of M_.
13 (pp_cxx_canonical_template_parameter): Likewise.
15 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
17 * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
18 * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
19 from pp_cxx_id_expression. Adjust.
20 (pp_cxx_userdef_literal): Use pp_id_expression.
21 (pp_cxx_primary_expression): Likewise.
22 (pp_cxx_direct_declarator): Likewise.
23 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
26 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
28 * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
29 function, overriding c_pretty_printer::constant.
30 * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
31 pp_cxx_constant. Adjust.
32 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
34 2013-08-23 Gabriel Dos Reis <gdr@integrable-solutiobs.net>
36 * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
37 destructor for the early printer.
38 * error.c (type_to_string): Use pp_buffer.
40 2013-08-22 Paolo Carlini <paolo.carlini@oracle.com>
43 * class.c (check_field_decls): Check for const mutable and const
44 reference data members.
46 2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
48 * error.c (init_error): Remove calls to pp_construct and
49 pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
50 * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
51 (cxx_pretty_printer_init): Remove.
52 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
53 Rename from cxx_pretty_printer_init. Adjust.
54 * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
55 initialization of C++ diagnostics pretty printer.
57 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
59 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
60 * cp-tree.h (REFERENCE_REF_P): Likewise.
61 * semantics.c (finish_offsetof): Likewise.
63 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
66 * semantics.c (finish_id_expression): Handle deprecated references.
68 2013-08-20 Jason Merrill <jason@redhat.com>
71 * cvt.c (build_expr_type_conversion): Don't complain about a
72 template that can't match the desired type category.
74 2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
76 * error.c (pp_ggc_formatted_text): New.
77 (type_as_string): Use it in lieu of pp_formatted_text.
78 (type_as_string_translate): Likewise.
79 (expr_as_string): Likewise.
80 (decl_as_string): Likewise.
81 (decl_as_string_translate): Likewise.
82 (lang_decl_name): Likewise.
83 (decl_to_string): Likewise.
84 (expr_to_string): Likewise.
85 (fndecl_to_string): Likewise.
86 (parm_to_string): Likewise.
87 (type_to_string): Likewise.
88 (args_to_string): Likewise.
89 (subst_to_string): Likewise.
91 2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
94 * cp-array-notation.c (cp_expand_cond_array_notations): Added a
95 check for truth values.
96 (expand_array_notation_exprs): Added truth values case. Removed an
97 unwanted else. Added for-loop to walk through subtrees in default
99 * call.c (build_cxx_call): Inherited the type of the array notation for
100 certain built-in array notation functions.
102 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
104 * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
105 Use cp_parser_lookup_name_simple.
107 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
109 * name-lookup.h (pop_bindings_and_leave_scope): Declare.
110 * name-lookup.c (pop_bindings_and_leave_scope): Define.
111 * parser.c (cp_parser_lambda_declarator_opt,
112 cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
114 2013-08-17 Jason Merrill <jason@redhat.com>
117 * name-lookup.c (push_class_level_binding_1): It's OK to push a
118 lambda type after the enclosing type is complete.
120 2013-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
122 * error.c (dump_scope): Add a cxx_pretty_printer parameter.
124 (dump_template_argument): Likewise.
125 (dump_template_argument_list): Likewise.
126 (dump_template_parameter): Likewise.
127 (dump_template_bindings): Likewise.
128 (dump_alias_template_specialization): Likewise.
129 (dump_type): Likewise.
130 (dump_typename): Likewise.
131 (dump_aggr_type): Likewise.
132 (dump_type_prefix): Likewise.
133 (dump_type_suffix): Likewise.
134 (dump_global_iord): Likewise.
135 (dump_simple_decl): Likewise.
136 (dump_decl): Likewise.
137 (dump_template_decl): Likewise.
138 (dump_function_decl): Likewise.
139 (dump_parameters): Likewise.
140 (dump_ref_qualifier): Likewise.
141 (dump_exception_spec): Likewise.
142 (dump_function_name): Likewise.
143 (dump_template_parms): Likewise.
144 (dump_call_expr_args): Likewise.
145 (dump_aggr_init_expr_args): Likewise.
146 (dump_expr_list): Likewise.
147 (dump_expr_init_vec): Likewise.
148 (dump_expr): Likewise.
149 (dump_binary_op): Likewise.
150 (dump_unary_op): Likewise.
152 2013-08-14 Paolo Carlini <paolo.carlini@oracle.com>
155 * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
156 * decl.c (case_conversion): Use it.
157 * call.c (standard_conversion): Likewise.
158 (implicit_conversion): Adjust.
160 2013-08-13 Adam Butcher <adam@jessamine.co.uk>
162 * pt.c: Grammar fix in comments ("it's" to "its").
164 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
166 * decl.c (warn_extern_redeclared_static, duplicate_decls,
167 check_elaborated_type_specifier): Use error + inform.
168 * friend.c (make_friend_class): Likewise.
169 * semantics.c (finish_id_expression): Likewise.
171 2013-08-09 Paolo Carlini <paolo.carlini@oracle.com>
174 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
177 * name-lookup.c (lookup_name_real_1): Handle iter->type before
180 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
183 * name-lookup.c (lookup_name_real_1): Handle iter->type before
186 2013-08-06 Caroline Tice <cmtice@google.com>
188 * Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
190 (vtable-class-hierarchy.o): Add build rule.
191 * cp-tree.h (vtv_start_verification_constructor_init_function): New
192 extern function decl.
193 (vtv_finish_verification_constructor_init_function): New extern
195 (build_vtbl_address): New extern function decl.
196 (get_mangled_vtable_map_var_name): New extern function decl.
197 (vtv_compute_class_hierarchy_transitive_closure): New extern function
199 (vtv_generate_init_routine): New extern function decl.
200 (vtv_save_class_info): New extern function decl.
201 (vtv_recover_class_info): New extern function decl.
202 (vtv_build_vtable_verify_fndecl): New extern function decl.
203 * class.c (finish_struct_1): Add call to vtv_save_class_info if
204 flag_vtable_verify is true.
205 * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
206 * vtable-class-hierarchy.c: New file.
207 * mangle.c (get_mangled_vtable_map_var_name): New function.
208 * decl2.c (start_objects): Update function comment.
209 (cp_write_global_declarations): Call vtv_recover_class_info,
210 vtv_compute_class_hierarchy_transitive_closure and
211 vtv_build_vtable_verify_fndecl, before calling
212 finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
213 flag_vtable_verify is true.
214 (vtv_start_verification_constructor_init_function): New function.
215 (vtv_finish_verification_constructor_init_function): New function.
216 * init.c (build_vtbl_address): Remove static qualifier from function.
218 2013-08-06 Jason Merrill <jason@redhat.com>
221 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
223 2013-08-05 Paolo Carlini <paolo.carlini@oracle.com>
226 * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
227 (cp_build_binary_op): Adjust.
229 2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
231 * cxx-pretty-print.h (pp_c_base): Remove.
232 (cxx_pretty_printer): Derive from c_pretty_printer.
233 Adjust macros using pp_c_base.
234 * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
235 * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
236 (pp_cxx_colon_colon): Likewise.
237 (pp_cxx_separate_with): Likewise.
238 (pp_cxx_storage_class_specifier): Do not call pp_c_base.
239 (pp_cxx_expression_list): Likewise.
240 (pp_cxx_space_for_pointer_operator): Likewise.
241 (pp_cxx_init_declarator): Likewise.
242 (pp_cxx_call_argument_list): Likewise.
243 (pp_cxx_constant): Likewise.
244 (pp_cxx_postfix_expression): Likewise.
245 (pp_cxx_new_expression): Likewise.
246 (pp_cxx_unary_expression): Likewise.
247 (pp_cxx_cast_expression): Likewise.
248 (pp_cxx_conditional_expression): Likewise.
249 (pp_cxx_assignment_expression): Likewise.
250 (pp_cxx_expression): Likewise.
251 (pp_cxx_function_specifier): Likewise.
252 (pp_cxx_decl_specifier_seq): Likewise.
253 (pp_cxx_simple_type_specifier): Likewise.
254 (pp_cxx_type_specifier_seq): Likewise.
255 (pp_cxx_ptr_operator): Likewise.
256 (pp_cxx_parameter_declaration_clause): Likewise.
257 (pp_cxx_direct_declarator): Likewise.
258 (pp_cxx_direct_abstract_declarator): Likewise.
259 (pp_cxx_type_id): Likewise.
260 (pp_cxx_statement): Likewise.
261 (pp_cxx_pretty_printer_init): Tidy.
262 * error.c (init_error): Do not use pp_base.
263 (dump_aggr_type): Likewise.
264 (dump_type_prefix): Likewise.
265 (dump_type_suffix): Likewise.
266 (dump_global_iord): Likewise.
267 (dump_decl): Likewise.
268 (dump_function_decl): Likewise.
269 (dump_ref_qualifier): Likewise.
270 (reinit_cxx_pp): Likewise.
271 (decl_as_dwarf_string): Likewise.
272 (lang_decl_dwarf_name): Likewise.
273 (type_to_string): Likewise.
274 (cv_to_string): Likewise.
275 (cxx_print_error_function): Likewise.
276 (cp_diagnostic_starter): Likewise.
277 (cp_diagnostic_finalizer): Likewise.
278 (cp_print_error_function): Likewise.
279 (print_instantiation_context): Likewise.
280 (cp_printer): Likewise.
282 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
284 * error.c (dump_type_prefix): Use specialized pretty printer
285 functions instead of pp_string or operators and punctuators.
286 (dump_decl): Likewise.
287 (dump_expr): Likewise.
289 2013-08-03 Jason Merrill <jason@redhat.com>
292 * pt.c (get_underlying_template): New.
293 (convert_template_argument, lookup_template_class_1): Use it.
297 * pt.c (pack_expansion_args_count): Rename from
298 any_pack_expanson_args_p.
299 (coerce_template_parms): Reject pack expansion to
300 non-pack template parameter of alias template.
302 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
304 * error.c (dump_aggr_type): Use specialized pretty printer
305 functions instead of pp_character.
306 (dump_type_prefix): Likewise.
307 (dump_simple_decl): Likewise.
308 (type_to_string): Likewise.
310 2013-08-02 Paolo Carlini <paolo.carlini@oracle.com>
312 * cp-tree.h (finish_stmt): Do not declare.
313 * decl.c (finish_stmt): Do not define.
314 * parser.c (cp_parser_expression_statement,
315 cp_parser_declaration_statement,
316 cp_parser_transaction_cancel): Don't call finish_stmt.
317 * semantics.c (finish_expr_stmt, finish_if_stmt,
318 finish_while_stmt, finish_do_stmt, finish_return_stmt,
319 finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
320 finish_transaction_stmt): Likewise.
322 2013-08-01 Fabien Chêne <fabien@gcc.gnu.org>
325 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
326 * name-lookup.c (do_nonmember_using_decl): Make sure we have an
327 OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
328 instead of issuing an error without mentioning the conflicting
331 2013-07-31 Paolo Carlini <paolo.carlini@oracle.com>
333 * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
334 return value for error_mark_node.
336 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
339 * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
340 token->type == CPP_ELLIPSIS.
342 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
345 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
347 2013-07-29 Jason Merrill <jason@redhat.com>
350 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
351 Use break_out_target_exprs instead of unshare_expr.
353 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
356 * call.c (initialize_reference): Don't crash when reference_binding
357 returns a conv with conv->kind == ck_ambig.
359 2013-07-29 Jason Merrill <jason@redhat.com>
361 * mangle.c (write_name): Check for null context.
362 (write_unscoped_name): Allow PARM_DECL context.
364 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
367 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
369 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
370 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
371 a tsubst_flags_t parameter.
372 (tsubst_decl): Adjust.
373 * call.c (convert_default_arg): Likewise.
374 * cp-tree.h (check_default_argument, tsubst_default_argument):
377 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
380 * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
381 CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
382 CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
383 Fix string_len management, tidy.
385 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
388 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
389 target type is incomplete; return a bool, not an int.
390 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
392 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
394 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
397 2013-07-21 Ondřej BÃÂlka <neleai@seznam.cz>
399 * class.c: Fix typos.
400 * cp-array-notation.c: Likewise.
401 * cp-objcp-common.c: Likewise.
404 * mangle.c: Likewise.
405 * parser.c: Likewise.
407 * semantics.c: Likewise.
409 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
411 * semantics.c (build_lambda_expr),
412 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
413 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
414 (is_normal_capture_proxy), (insert_capture_proxy),
415 (insert_pending_capture_proxies), (lambda_proxy_type),
416 (build_capture_proxy), (vla_capture_type),
417 (register_capture_members), (add_default_capture),
418 (lambda_expr_this_capture), (maybe_resolve_dummy),
419 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
420 (is_lambda_ignored_entity): Moved definitions into ...
421 * lambda.c: ... this new file.
423 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
425 * call.c (build_conditional_expr_1): Handle the case with 1 vector
426 and 2 scalars. Call save_expr before building a vector.
427 * typeck.c (cp_build_binary_op): Check complain before complaining.
429 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
432 * init.c (build_aggr_init): Check for warn_unused attribute.
433 * decl.c (poplevel): Likewise.
435 2013-07-13 Jason Merrill <jason@redhat.com>
438 * init.c (build_vec_init): Use {} for arrays of class type.
439 (build_vec_delete): Don't take the address of the array.
442 * class.c (layout_class_type): Check for too-large class.
444 * call.c (can_convert): Allow user-defined conversions.
445 (can_convert_standard): New.
446 * cp-tree.h: Declare it.
447 * cvt.c (convert_to_reference): Use it.
448 * pt.c (convert_nontype_argument): Likewise.
449 * search.c (check_final_overrider): Likewise.
450 Don't worry about user-defined conversions.
452 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
455 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
456 warn about casting between pointer-to-function and pointer-to-object.
458 2013-07-09 Jason Merrill <jason@redhat.com>
461 * init.c (build_vec_init): Don't take shortcuts when initializing
465 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
468 * semantics.c (finish_id_expression): Return the id for an
469 unevaluated outer variable.
472 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
473 if the variable type uses 'auto'.
476 * typeck.c (check_return_expr): Lambda proxies aren't eligible
477 for nrv or return by move.
480 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
481 a ref-qualifier in C++98 mode.
484 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
485 argument to have the exact type of the parameter.
488 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
489 a POINTER_PLUS_EXPR for type punning diagnostic.
492 * pt.c (tsubst_copy): Handle USING_DECL.
494 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
497 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
499 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
502 * call.c (build_conditional_expr_1): Preserve xvalues.
504 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
507 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
508 also check declares_class_or_enum.
510 2013-07-08 Jason Merrill <jason@redhat.com>
513 * pt.c (fn_type_unification): Only defer during substitution.
514 (type_unification_real): Defer during defarg substitution,
515 add checks parm to pass back deferred checks.
516 (unify, do_auto_deduction): Adjust.
517 * semantics.c (reopen_deferring_access_checks): New.
518 * cp-tree.h: Declare it.
520 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
523 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
524 set parser->default_arg_ok_p to false before cp_parser_declarator.
526 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
529 * class.c (build_base_path): Improve diagnostic.
531 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
534 * decl.c (start_preparsed_function): Return a bool, false if
535 push_template_decl fails.
536 (start_function): Adjust.
539 2013-07-03 Jakub Jelinek <jakub@redhat.com>
542 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
543 Temporarily set parser->greater_than_is_operator_p for
544 cp_parser_expression and restore from saved value afterwards.
546 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
548 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
549 * parser.c (cp_parser_operator()): Parse user-defined string
550 literal as literal operator.
552 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
555 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
556 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
559 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
561 * parser.c (cp_parser_array_notation): Removed rejection array notation
562 of type function pointers. Added handling of array expressions when
563 Cilk Plus is enabled. Took out type-checking.
564 (cp_parser_postfix_open_square_expression): Moved normal array expr.
565 parsing into cp_parser_array_notation when cilkplus is enabled.
566 (cp_parser_compound_statement): Removed expansion of array notations.
567 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
568 (cp_parser_function_definition_after_declarator): Likewise.
569 (cp_parser_selection_statement): Removed error reporting.
570 (cp_parser_iteration_statement): Likewise.
571 (cp_parser_direct_declarator): Removed error checking/reporting if
572 array notations are used in the declarator.
573 * pt.c (instantiate_decl): Likewise.
574 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
575 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
576 (potential_constant_expression_1): Returned false for
577 ARRAY_NOTATION_REF case.
578 * cp-gimplify.c (cp_genericize): Added expansion of array notation
580 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
581 parameters. Replaced build_decls with get_temp_regvar with type as
583 (create_array_refs): Made the type-casting to ptrdiff_type.
584 (replace_invariant_var): Added a check for void return type before
585 creating new var. Replaced build_decl and build_min_nt_loc with
587 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
588 with gcc_unreachable. Removed few unwanted checks. Made induction
589 variable type as ptrdiff_type. Removed loc and complain arguments
590 passed into make_triplet_val_inv. Replaced all modify expression's
591 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
592 into stmt. list with the non-forceful one. Replaced some integer
593 conversion and equality-checking to using tree_int_cst_equal.
594 (expand_sec_reduce_builtin): All changes mentioned in above function
595 expand_an_in_modify_expr. Made the new variable type of
596 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
597 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
598 the error reporting from parser to this function. Removed unwanted
599 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
600 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
601 in function pointers.
602 (cp_expand_cond_array_notations): Added a new if statements to check
603 if condition has a zero rank. If so, then just return.
604 (expand_return_expr): Added a check for return expressions with a rank.
605 Replaced get_tmp_regvar with a create_temporary_var.
606 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
607 Moved common code outside if-statements. Moved type-checking from
609 * semantics.c (finish_return_stmt): Removed a check for return exprs.
611 * call.c (convert_like_real): Removed a check for array notation
612 expression in a function.
613 (build_over_call): Likewise.
614 (magic_varargs_p): Added a check for builtin array notation function.
615 Made this function non-static and removed its prototype.
616 * cp-tree.h (magic_varargs_p): New prototype.
617 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
618 nargs to the param->length when builtin reduction function is used.
619 (convert_arguments): Replaced check for a constant_p function with
620 margic_varargs_p function call.
621 (cp_build_binary_op): Removed calling of the function
622 find_correct_array_notation_type.
623 (cp_build_addr_expr_1): Removed an unwanted if-statement.
624 (convert_for_assignment): Removed automatic return of rhs when array
625 notation builtin function is used.
627 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
630 * parser.c (cp_parser_save_member_function_body): Handle correctly
631 curly braces in function-try-block mem-initializers.
633 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
636 * typeck.c (cp_build_vec_perm_expr): New function.
637 * cp-tree.h: Declare it.
638 * parser.c (cp_parser_postfix_expression): Call it.
639 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
640 (tsubst_copy_and_build): Likewise.
642 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
645 * pt.c (more_specialized_fn): If both arguments are references,
646 give priority to an lvalue.
648 2013-06-26 Jason Merrill <jason@redhat.com>
650 * typeck2.c (store_init_value): Diagnose a non-constant
651 initializer for in-class static.
654 * semantics.c (add_capture): Set type to error_mark_node after
657 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
660 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
661 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
663 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
665 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
666 * class.c (add_implicitly_declared_members): Likewise.
667 (check_field_decl): Likewise.
668 (finalize_literal_type_property): Likewise.
669 (check_bases_and_members): Likewise.
670 * decl.c (poplevel): Likewise.
671 (case_conversion): Likewise.
672 (check_initializer): Likewise.
673 (grokfndecl): Likewise.
674 (check_static_variable_definition): Likewise.
675 (compute_array_index_type): Likewise.
676 (grokdeclarator): Likewise.
677 (build_enumerator): Likewise.
678 * friend.c (make_friend_class): Likewise.
679 * lex.c (init_reswords): Likewise.
680 * method.c (synthesized_method_walk): Likewise.
681 (implicitly_declare_fn): Likewise.
682 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
683 (cp_parser_constant_expression): Likewise.
684 (cp_parser_for_init_statement): Likewise.
685 (cp_parser_block_declaration): Likewise.
686 (cp_parser_type_name): Likewise.
687 (cp_parser_enum_specifier): Likewise.
688 (cp_parser_enumerator_list): Likewise.
689 (cp_parser_member_declaration): Likewise.
690 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
691 (cp_parser_template_declaration_after_export): Likewise.
692 * pt.c (convert_nontype_argument_function): Likewise.
693 (convert_nontype_argument): Likewise.
694 (convert_template_argument): Likewise.
695 (tsubst_copy_and_build): Likewise.
696 (build_non_dependent_expr): Likewise.
697 * semantics.c (non_const_var_error): Likewise.
698 (potential_constant_expression_1): Likewise.
699 * tree.c (lvalue_kind): Likewise.
700 (build_vec_init_expr): Likewise.
701 (cast_valid_in_integral_constant_expression_p): Likewise.
702 * typeck.c (build_x_conditional_expr): Likewise.
703 * typeck2.c (check_narrowing): Likewise.
705 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
707 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
708 (expand_an_in_modify_expr): Changed a function call from the above
709 removed function to length_mismatch_in_expr_p.
711 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
713 * call.c (convert_like_real): Added a check if array notation is present
714 in expression. If so, then no conversion of arguments is necessary.
715 (build_over_call): Likewise.
716 * typeck.c (cp_build_function_call_vec): Likewise.
717 (convert_for_assignment): Likewise.
718 (cp_build_array_ref): Reject array notations with a rank greater than 1
720 (cp_build_binary_op): If array notations are preent in op, then call
721 find_correct_array_notation_type.
722 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
723 * cp-array-notation.c: New file.
724 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
726 * cp-tree.h (fix_array_notation_exprs): New prototype.
727 * semantics.c (finish_return_stmt): Reject array notations as
729 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
730 (potential_constant_expression_1): Likewise.
731 * tree.c (lvalue_kind): Likewise.
732 * error.c (dump_decl): Likewise.
733 (dump_expr): Likewise.
734 * pt.c (ARRAY_NOTATION_REF): Likewise.
735 (type_unification_real): Do not unify any arguments if array notations
737 (instantiate_decl): Added a check for array notaitons inside the
738 function body. If so, then expand them.
739 * parser.c (cp_parser_array_notation): New function.
740 (cp_parser_postfix_open_square_expression): Added a check for colons
741 inside square braces. If found, then handle the array access as an
742 array notation access. Also, disable auto-correction from a single
743 colon to scope when Cilk Plus is enabled.
744 (cp_parser_compound_statement): Added a check for array notations
745 inside the statement. If found, then expand them.
746 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
747 (cp_parser_function_definition_after_declarator): Likewise.
748 (cp_parser_selection_statement): Searched for array notations inside
749 condition. If so, then emit an error.
750 (cp_parser_iteration_statement): Likewise.
751 (cp_parser_direct_declarator): Reject array notations inside a
752 variable or array declaration.
753 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
755 2013-06-20 Jason Merrill <jason@redhat.com>
758 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
759 context if we're in C++14 mode.
760 * tree.c (array_of_runtime_bound_p): Return true for a dependent
761 bound that is not potentually constant.
762 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
763 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
764 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
765 (build_capture_proxy): Set REFERENCE_VLA_OK.
766 (vla_capture_type): Make it a proper C++ class.
767 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
770 * decl.c (compute_array_index_type): Use size_one_node.
772 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
773 a partial specialization.
774 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
776 (most_specialized_class): Adjust.
778 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
779 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
782 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
785 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
786 TREE_TYPE (arg), not arg itself.
788 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
791 * pt.c (type_dependent_expression_p): Handle an array of unknown
792 bound depending on a variadic parameter.
793 * parser.c (cp_parser_range_for): Revert PR56794 changes.
795 2013-06-17 Richard Biener <rguenther@suse.de>
797 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
799 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
802 * parser.c (cp_parser_expression_statement): Check whether
803 cp_parser_expression returns error_mark_node.
805 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
808 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
810 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
813 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
814 accessible base simply forward to build_static_cast.
816 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
819 * decl.c (poplevel): For the benefit of -Wunused-variable see
822 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
824 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
826 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
829 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
830 again diagnostic already emitted by cp_parser_lookup_name.
832 2013-06-11 Jan Hubicka <jh@suse.cz>
835 * cp/pt.c (mark_decl_instantiated): Do not export explicit
836 instantiations of anonymous namespace templates.
838 2013-06-10 Jason Merrill <jason@redhat.com>
840 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
841 namespace to static_decls.
843 2013-06-07 Sriraman Tallam <tmsriram@google.com>
846 * call.c (build_over_call): Check if current_function_decl is
849 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
852 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
853 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
855 2013-06-06 Jason Merrill <jason@redhat.com>
858 * semantics.c (add_capture): Diagnose capture of variable-size
859 type that is not a C++1y array of runtime bound.
861 * decl.c (grokdeclarator): Keep a decl with error type.
862 (grokfield, grokbitfield): Likewise.
863 * pt.c (instantiate_class_template_1): Likewise.
864 (tsubst_decl): Drop redundant error.
865 * class.c (walk_subobject_offsets): Handle erroneous fields.
866 * typeck2.c (process_init_constructor_record): Likewise.
868 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
871 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
872 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
874 2013-06-03 Jan Hubicka <jh@suse.cz>
876 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
877 mark_decl_referenced.
878 (mark_needed): Likewise.
880 2013-06-03 Jason Merrill <jason@redhat.com>
882 * class.c (mark_type_abi_tags): New.
883 (check_abi_tags): Use it.
885 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
888 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
889 * semantics.c (finish_qualified_id_expr): Use it.
892 2013-06-01 Jan Hubicka <jh@suse.cz>
894 * decl2.c (cp_write_global_declarations): Replace same_body_alias
895 by symbol.cpp_implicit_alias.
897 2013-05-30 Jason Merrill <jason@redhat.com>
900 * cp-lang.c (cp_classify_record): Handle structs without
904 * class.c (common_enclosing_class): New.
905 * cp-tree.h: Declare it.
906 * init.c (sort_mem_initializers): Don't splice out a union member
909 2013-05-29 Jan Hubicka <jh@suse.cz>
911 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
912 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
914 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
917 * decl2.c (check_classfn): Check for destructors declared as member
920 2013-05-24 Jason Merrill <jason@redhat.com>
923 * pt.c (any_template_arguments_need_structural_equality_p): A
924 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
926 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
929 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
930 with width exceeding the type.
932 2013-05-24 Jason Merrill <jason@redhat.com>
935 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
936 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
938 2013-05-23 Jason Merrill <jason@redhat.com>
941 * tree.c (build_ref_qualified_type): Clear
942 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
944 2013-05-22 Jason Merrill <jason@redhat.com>
947 * call.c (convert_like_real): Use cp_convert_and_check.
948 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
949 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
950 (potential_constant_expression_1): Handle OMP_ATOMIC*.
953 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
956 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
959 * parser.c (cp_parser_conversion_type_id): Set up
960 parser->type_definition_forbidden_message before calling
961 cp_parser_type_specifier_seq.
963 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
966 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
967 warnings about defaulted functions.
969 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
971 * call.c (build_conditional_expr_1): Add location_t parameter.
972 (build_conditional_expr): Likewise.
973 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
974 get_member_function_from_ptrfunc, build_x_conditional_expr,
975 cp_build_modify_expr): Update.
976 * init.c (build_new_1): Likewise.
977 * cp-tree.h: Update declaration.
979 2013-05-20 Jason Merrill <jason@redhat.com>
982 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
986 * decl.c (fndecl_declared_return_type): Also look in
987 DECL_SAVED_FUNCTION_DATA.
989 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
992 * parser.c (cp_parser_parameter_declaration): Check return value
993 of cp_parser_parse_and_diagnose_invalid_type_name.
995 2013-05-20 Jason Merrill <jason@redhat.com>
998 * class.c (vbase_has_user_provided_move_assign): New.
999 * method.c (synthesized_method_walk): Check it.
1000 * cp-tree.h: Declare it.
1003 * tree.c (build_cplus_array_type): Copy layout info if element
1006 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1009 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
1011 2013-05-20 Jason Merrill <jason@redhat.com>
1014 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
1015 whether a template has its own args.
1017 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1020 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
1022 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1025 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
1026 instead of cp_parser_initializer_list for compound-literals.
1028 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
1031 * typeck.c (check_return_expr): Reverse the alignment comparison.
1033 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1036 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
1037 correctly sizeof compound-literal; update comments.
1039 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
1041 * call.c (build_conditional_expr_1): Use cp_build_binary_op
1042 instead of directly calling fold_build2.
1044 2013-05-16 Jason Merrill <jason@redhat.com>
1046 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
1049 * decl.c (grokdeclarator): Allow member function qualifiers in
1050 TYPENAME context in C++11 mode.
1052 2013-05-16 Dodji Seketeli <dodji@redhat.com>
1054 PR c++/56782 - Regression with empty pack expansions
1055 * pt.c (use_pack_expansion_extra_args_p): When at least a
1056 parameter pack has an empty argument pack, and another parameter
1057 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
1060 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1062 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
1063 warning_at and permerror with warning_at/inform and permerror/
1064 inform, respectively.
1066 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1069 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
1072 2013-05-14 Jason Merrill <jason@redhat.com>
1075 * parser.c (cp_parser_range_for): Call complete_type.
1078 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
1080 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
1083 * method.c (defaulted_late_check): Check for compatible exception
1084 specification out of class explicitly defaulted functions too.
1086 2013-05-14 Jason Merrill <jason@redhat.com>
1089 * semantics.c (potential_constant_expression_1): Make sure the
1090 called function is potentially constant.
1091 * call.c (null_ptr_cst_p): Revert earlier change.
1093 2013-05-13 Jason Merrill <jason@redhat.com>
1096 * call.c (null_ptr_cst_p): An expression with side-effects can't
1097 be a C++03 null pointer constant.
1100 * decl.c (reshape_init_class): Handle error_mark_node.
1103 * typeck.c (merge_types): Propagate ref-qualifier
1104 in METHOD_TYPE case.
1107 * decl.c (grokdeclarator): Apply ref-qualifier
1108 in the TYPENAME case.
1111 * decl.c (decls_match): Compare ref-qualifiers.
1113 2013-05-10 Jason Merrill <jason@redhat.com>
1116 * pt.c (convert_template_argument): Use dependent_template_arg_p,
1117 not uses_template_parms.
1120 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
1123 * semantics.c (add_capture): Error rather than abort on copy
1125 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
1126 warn about capture proxy.
1128 2013-05-09 Jason Merrill <jason@redhat.com>
1130 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
1133 * pt.c (lookup_template_class_1): Handle getting a template
1134 template parameter as D1.
1136 N3639 C++1y VLA diagnostics
1137 * decl.c (grokdeclarator): Complain about reference, pointer, or
1139 (create_array_type_for_decl): Complain about array of VLA.
1140 * pt.c (tsubst): Likewise.
1141 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
1142 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
1143 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
1144 (cxx_sizeof_or_alignof_type): Likewise.
1146 N3639 C++1y VLA support
1147 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
1148 (check_array_initializer): Allow VLA init.
1149 (reshape_init_array_1): Adjust.
1150 (cp_finish_decl): Check for invalid VLA length.
1151 * typeck2.c (process_init_constructor_array): Adjust.
1152 (store_init_value): Use build_vec_init for VLAs.
1153 * semantics.c (add_capture): Capture VLA as ptr+len.
1154 (vla_capture_type): New.
1155 (build_capture_proxy): Rebuild the VLA.
1156 * typeck.c (build_simple_component_ref): Split out from...
1157 (build_ptrmemfunc_access_expr): ...here.
1158 * tree.c (array_of_runtime_bound_p): New.
1159 * init.c (throw_bad_array_length): New.
1160 (build_vec_init): Use it.
1161 * parser.c (cp_convert_range_for): When iterating over a VLA,
1162 use it directly rather than bind a reference.
1163 * cp-tree.h: Declare new functions.
1165 2013-05-08 Jason Merrill <jason@redhat.com>
1167 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
1168 variably_modified_type_p.
1169 (expand_start_catch_block): Mark the typeinfo used here.
1170 * semantics.c (finish_handler_parms): Not here.
1172 * error.c (dump_type_suffix): Try harder on VLA length.
1175 * init.c (throw_bad_array_new_length): New.
1176 (build_new_1): Use it. Don't warn about braced-init-list.
1177 (build_vec_init): Use it.
1178 * call.c (build_operator_new_call): Use it.
1181 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
1182 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
1183 * error.c (maybe_warn_cpp0x): s/0x/11/.
1185 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
1188 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
1191 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
1193 * typeck.c (cp_build_binary_op): Call save_expr before
1194 build_vector_from_val.
1196 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1199 * decl.c (cp_finish_decl): After do_auto_deduction copy the
1200 qualifers with cp_apply_type_quals_to_decl.
1202 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1204 * pt.c (convert_nontype_argument): Add missing whitespace in
1207 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1210 * decl.c (build_enumerator): Improve error message.
1212 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1215 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
1216 messages for template types and fix column numbers.
1218 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
1221 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
1222 c_inhibit_evaluation_warnings around build_x_modify_expr call.
1224 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
1227 * semantics.c (finish_decltype_type): Handle instantiated template
1230 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
1233 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
1235 2013-04-26 Jakub Jelinek <jakub@redhat.com>
1237 * error.c (cp_print_error_function): Adjust file_name_as_prefix
1240 2013-04-25 Jason Merrill <jason@redhat.com>
1243 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
1246 * init.c (perform_member_init): Call reshape_init.
1248 2013-04-24 Jason Merrill <jason@redhat.com>
1251 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
1253 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1255 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
1256 pedwarn to simply use OPT_Wpointer_arith.
1257 (cp_build_unary_op): Likewise.
1259 2013-04-24 Jason Merrill <jason@redhat.com>
1261 N3648: init-captures are named.
1262 * semantics.c (add_capture): Don't prepend "__" to init-captures.
1263 (build_capture_proxy): Adjust.
1264 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
1266 N3648: Allow braced and parenthesized initializers.
1267 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
1268 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
1269 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
1270 (add_capture): Collapse a parenthesized initializer into a single
1272 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
1274 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1277 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
1278 * semantics.c (finish_qualified_id_expr): Likewise.
1279 (finish_id_expression): Update.
1280 * typeck.c (cp_build_addr_expr_1): Likewise.
1281 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
1282 * cp-tree.h: Update declarations.
1284 2013-04-22 Jason Merrill <jason@redhat.com>
1287 * parser.c (cp_parser_unqualified_id): Handle ~auto.
1288 (cp_parser_pseudo_destructor_name): Likewise.
1289 (cp_parser_postfix_dot_deref_expression): Adjust.
1290 (cp_lexer_nth_token_is_keyword): New.
1291 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
1292 * typeck.c (lookup_destructor): Handle ~auto.
1294 * pt.c (fn_type_unification): Push tinst level around
1295 type_unification_real if we aren't explaining.
1296 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
1297 * error.c (dump_function_decl): Respect it.
1298 (subst_to_string): Pass it.
1301 * rtti.c (get_typeid): Diagnose qualified function type.
1302 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
1304 * error.c (dump_aggr_type): Fix lambda detection.
1305 (dump_simple_decl): Pretty-print capture field.
1308 * cvt.c (build_expr_type_conversion): Two conversions that return
1309 the same type aren't necessarily ambiguous.
1312 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
1313 pedwarn unconditional except in C++1y mode.
1315 * semantics.c (potential_constant_expression_1): Don't crash on
1319 * semantics.c (finish_id_expression): Reject capture of anonymous
1323 * decl2.c (check_default_args): Check for pack expansion.
1325 * mangle.c (write_type): Mangle decltype(auto).
1327 2013-04-19 Jason Merrill <jason@redhat.com>
1329 N3638 changes to return type deduction
1330 * decl.c (undeduced_auto_decl): New.
1331 (require_deduced_type): New.
1332 (fndecl_declared_return_type): New.
1333 (decls_match): Use it.
1334 (duplicate_decls): Don't check for auto return.
1335 (grokdeclarator): Reject virtual auto.
1336 * class.c (resolve_address_of_overloaded_function): Handle
1337 auto function templates.
1338 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
1339 * cp-tree.h: Declare new fns.
1340 * error.c (dump_function_decl): Use fndecl_declared_return_type.
1341 * search.c (check_final_overrider): Likewise.
1342 * pt.c (make_decltype_auto): New.
1343 (do_auto_deduction): Require plain decltype(auto).
1347 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
1348 template specializations.
1350 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
1352 Implement n3599 - Literal operator templates for strings.
1353 * parser.c (make_string_pack (tree value)): New function.
1354 (cp_parser_userdef_string_literal (cp_token *)): Use it
1355 to construct calls to character string literal operator templates.
1356 (cp_parser_template_declaration_after_export): Check for new string
1357 literal operator template parameter form.
1359 2013-04-15 Jason Merrill <jason@redhat.com>
1361 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
1364 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
1365 rather than a destructor name, it isn't an unqualified-name.
1366 (tsubst_copy_and_build): Pass down decltype_flag to operator
1370 * semantics.c (insert_capture_proxy): Just use index 1 in the
1373 2013-04-12 Jakub Jelinek <jakub@redhat.com>
1375 * error.c (cp_print_error_function,
1376 print_instantiation_partial_context_line,
1377 maybe_print_constexpr_context): Colorize locus strings.
1379 2013-04-11 Jason Merrill <jason@redhat.com>
1382 * parser.c (complain_flags): New.
1383 (cp_parser_postfix_expression): Use it.
1384 (cp_parser_unary_expression): Likewise.
1385 (cp_parser_binary_expression): Likewise.
1386 (cp_parser_assignment_expression): Likewise.
1387 (cp_parser_expression): Likewise.
1388 (cp_parser_postfix_open_square_expression): Take decltype_p.
1389 (cp_parser_builtin_offsetof): Adjust.
1390 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
1391 * decl2.c (grok_array_decl): Add decltype_p parm.
1392 * cp-tree.h: Adjust prototype.
1393 * semantics.c (finish_unary_op_expr): Add complain parm.
1395 2013-04-11 Jakub Jelinek <jakub@redhat.com>
1398 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
1399 calling maybe_constant_value for C++98.
1401 2013-04-11 Jason Merrill <jason@redhat.com>
1404 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
1405 Strip references before checking WILDCARD_TYPE_P.
1407 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1409 * call.c (build_conditional_expr_1, build_over_call): Protect
1410 error calls with complain & tf_error.
1411 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
1412 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
1413 build_ptrmemfunc): Likewise.
1414 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
1416 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
1417 (convert_to_reference): Adjust.
1419 2013-04-11 Jason Merrill <jason@redhat.com>
1421 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
1422 local variables, look them up instead.
1423 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
1424 proxies and substitution in unevaluated context.
1425 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
1426 before the iterators.
1429 * pt.c (uses_deducible_template_parms): New.
1430 (deducible_array_bound, deducible_expression): New.
1431 (deducible_template_args): New.
1432 (unify_one_argument): Call uses_deducible_template_parms.
1434 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1437 * typeck2.c (build_m_component_ref): Protect error calls with
1438 (complain & tf_error).
1440 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1443 * parser.c (cp_parser_enum_specifier): Check for empty
1444 anonymous enums and anonymous scoped enums.
1446 2013-04-10 Jakub Jelinek <jakub@redhat.com>
1449 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
1450 first before calling maybe_constant_value for warn_for_div_by_zero
1451 or invalid shift count warning purposes.
1453 2013-04-09 Jason Merrill <jason@redhat.com>
1456 * rtti.c (build_typeid): Check the address of the argument
1457 rather than looking for an INDIRECT_REF.
1459 2013-04-04 Jason Merrill <jason@redhat.com>
1463 * typeck2.c (abstract_virtuals_error_sfinae): Disable
1464 complete_type again.
1466 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1469 * decl.c (validate_constexpr_redeclaration): Allow an explicit
1470 specialization to be different wrt the constexpr specifier.
1472 2013-04-06 Jason Merrill <jason@redhat.com>
1474 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
1477 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
1479 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
1480 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
1482 2013-04-03 Jason Merrill <jason@redhat.com>
1484 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
1485 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
1486 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
1488 * mangle.c (write_type): When writing a function type with
1489 function-cv-quals, don't add the unqualified type as a
1490 substitution candidate.
1492 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
1495 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
1498 2013-04-03 Jakub Jelinek <jakub@redhat.com>
1501 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
1502 from args to new_args.
1503 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
1504 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
1506 2013-04-02 Jason Merrill <jason@redhat.com>
1509 * mangle.c (write_function_type): Mangle ref-qualifier.
1510 (write_nested_name): Likewise.
1511 (canonicalize_for_substitution): Preserve ref-qualifier.
1512 (write_type): Likewise.
1515 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
1517 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
1519 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
1520 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
1521 (for_each_template_parm_r): Use TYPE_TI_ARGS.
1523 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
1525 * cp-tree.h (TAGGED_TYPE_P): Remove.
1526 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
1527 (TYPE_ANONYMOUS_P): Adjust.
1528 * call.c (build_new_op_1): Likewise.
1529 * class.c (find_abi_tags_r): Likewise.
1530 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
1531 type_is_deprecated): Likewise.
1532 * decl2.c (grokfield, min_vis_r): Likewise.
1533 * pt.c (get_template_info): Likewise.
1534 * tree.c (handle_abi_tag_attribute): Likewise.
1536 2013-04-01 Jason Merrill <jason@redhat.com>
1538 * semantics.c (maybe_constant_value): Check
1539 instantiation_dependent_expression_p.
1540 * pt.c (build_non_dependent_expr): Don't check it here.
1543 * init.c (build_new): Don't try to process an array initializer
1544 at template definition time.
1547 * typeck.c (finish_class_member_access_expr): Handle enum scope.
1550 * parser.c (cp_parser_range_for): Don't try to do auto deduction
1551 in a template if the type of the range is incomplete.
1553 * call.c (add_function_candidate): Take the address of 'this' here.
1554 (build_over_call): And here.
1555 (build_new_method_call_1, build_op_call_1): Not here.
1556 (build_user_type_conversion_1): Or here.
1557 (add_candidates): Adjust.
1559 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
1560 * class.c (same_signature_p): Use type_memfn_quals.
1561 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
1562 FUNCTION_OR_METHOD_TYPE_CHECK.
1563 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
1564 * pt.c (unify): Use static_fn_type.
1566 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
1567 Jason Merrill <jason@redhat.com>
1569 Implement N2439 (ref-qualifiers for 'this')
1570 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
1571 (FUNCTION_RVALUE_QUALIFIED): New.
1572 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
1573 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
1574 (cp_ref_qualifier): New enum.
1575 (cp_declarator): Add ref_qualifier.
1576 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
1577 (cp_parser_direct_declarator): Use it.
1578 (make_call_declarator): Adjust.
1579 (cp_parser_lambda_declarator_opt): Adjust.
1580 * call.c (add_function_candidate): Handle ref-qualifier overload
1581 resolution semantics.
1582 (standard_conversion): Adjust.
1583 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
1584 * decl.c (grokdeclarator): Handle ref-qualifiers.
1585 (grokfndecl): Check for invalid ref-qualifiers.
1586 (static_fn_type, revert_static_member_fn): Adjust.
1587 * decl2.c (build_memfn_type): Handle ref-qualifiers.
1588 (check_classfn): Check them.
1589 (cp_reconstruct_complex_type): Retain them.
1590 * error.c (dump_ref_qualifier): New.
1591 (dump_type_suffix, dump_function_decl): Use it.
1592 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
1593 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
1594 (unify): Retain them.
1595 * tree.c (cp_check_qualified_type): New.
1596 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
1597 (build_ref_qualified_type): New.
1598 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
1599 (cp_build_type_attribute_variant): Keep ref-qualifier.
1600 * typeck.c (merge_types): Keep ref-qualifier.
1601 (structural_comptypes): Compare ref-qualifier.
1602 (type_memfn_rqual): New.
1603 (apply_memfn_quals): Take ref-qual argument.
1604 * typeck2.c (build_m_component_ref): Check ref-qualifier.
1606 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1608 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
1609 (DECL_FUNCTION_TEMPLATE_P): Adjust.
1611 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
1612 pp_cxx_qualified_id): Use get_containing_scope.
1613 * parser.c (cp_parser_class_head): Likewise.
1614 * pt.c (push_template_decl_real): Likewise.
1616 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
1617 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
1619 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
1621 * decl2.c (collect_candidates_for_java_method_aliases): Use
1623 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
1624 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
1625 * decl.c (duplicate_decls): Likewise.
1626 * parser.c (cp_parser_template_declaration_after_export): Likewise,
1627 also DECL_DECLARES_TYPE_P.
1628 * pt.c (instantiate_class_template_1): Likewise.
1629 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
1630 (lookup_field_r): Likewise.
1631 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
1632 (lookup_fnfields_slot_nolazy): Likewise.
1633 * semantics.c (finish_member_declaration): Likewise.
1634 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
1636 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
1638 * pt.c (template_parms_to_args): Fix typo in comment.
1640 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
1642 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
1644 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
1646 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
1647 (build_op_call_1): Likewise.
1648 (build_over_call): Likewise.
1649 (compare_ics): Likewise.
1650 * class.c (build_base_path): Likewise.
1651 (resolve_address_of_overloaded_function): Likewise.
1652 * cp-tree.h: Likewise.
1653 * cvt.c (cp_convert_to_pointer): Likewise.
1654 (convert_to_reference): Likewise.
1655 (ocp_convert): Likewise.
1656 (convert_force): Likewise, tidy.
1657 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
1658 (pp_cxx_ptr_operator): Likewise.
1659 * decl.c (duplicate_decls): Likewise.
1660 (start_decl): Likewise.
1661 (grok_op_properties): Likewise.
1662 (start_preparsed_function): Likewise.
1663 (store_parm_decls): Likewise.
1664 (finish_function): Likewise.
1665 * decl2.c (delete_sanity): Likewise.
1666 (acceptable_java_type): Likewise.
1667 (grokbitfield): Likewise.
1668 (cp_reconstruct_complex_type): Likewise.
1669 * error.c (dump_type_prefix): Likewise.
1670 (dump_expr): Likewise.
1671 * except.c (push_eh_cleanup): Likewise.
1672 (complete_ptr_ref_or_void_ptr_p): Likewise.
1673 (can_convert_eh): Likewise.
1674 * init.c (build_new_1): Likewise.
1675 (build_delete): Likewise.
1676 (build_vec_delete): Likewise.
1677 * mangle.c (write_type): Likewise.
1678 * parser.c (lookup_literal_operator): Likewise.
1679 * pt.c (convert_nontype_argument_function): Likewise.
1680 (convert_nontype_argument): Likewise.
1683 (dependent_type_p_r): Likewise.
1684 * rtti.c (build_headof): Likewise.
1685 (build_typeid): Likewise.
1686 (build_dynamic_cast_1): Likewise.
1687 (target_incomplete_p): Likewise.
1688 (typeinfo_in_lib_p): Likewise.
1689 * semantics.c (finish_omp_for): Likewise.
1690 (cxx_eval_call_expression): Likewise.
1691 (maybe_resolve_dummy): Likewise.
1692 * tree.c (build_target_expr): Likewise.
1693 (cp_build_qualified_type_real): Likewise.
1694 * typeck.c (composite_pointer_type_r): Likewise.
1695 (composite_pointer_type): Likewise.
1696 (comp_except_types): Likewise.
1697 (cxx_sizeof_nowarn): Likewise.
1698 (string_conv_p): Likewise.
1699 (cp_build_array_ref): Likewise.
1700 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
1701 (pointer_diff): Likewise.
1702 (cp_build_addr_expr_1): Likewise.
1703 (cp_build_unary_op): Likewise.
1704 (build_static_cast_1): Likewise.
1705 (cp_build_c_cast): Likewise.
1706 (comp_ptr_ttypes_real): Likewise.
1707 (ptr_reasonably_similar): Likewise.
1708 (comp_ptr_ttypes_const): Likewise.
1709 (casts_away_constness): Likewise.
1710 (check_literal_operator_args): Likewise.
1711 * typeck2.c (build_x_arrow): Likewise.
1712 (add_exception_specifier): Likewise.
1714 2013-03-29 Jason Merrill <jason@redhat.com>
1717 * cp-tree.h (AUTO_IS_DECLTYPE): New.
1718 * parser.c (cp_parser_decltype): Handle decltype(auto).
1719 (cp_parser_type_id_1): Allow auto without a late-specified
1721 (cp_parser_primary_expression): Use the return value of
1722 finish_parenthesized_expr.
1723 (cp_parser_transaction_expression): Likewise.
1724 * semantics.c (force_paren_expr): New.
1725 (finish_parenthesized_expr): Use it.
1726 * call.c (build_conditional_expr_1): Likewise.
1727 * pt.c (do_auto_deduction): Handle decltype(auto).
1728 (tsubst_copy): Handle PAREN_EXPR.
1729 (tsubst_copy_and_build): Likewise.
1730 * error.c (dump_expr): Handle PAREN_EXPR.
1731 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
1732 * mangle.c (write_expression): Ignore PAREN_EXPR.
1734 * parser.c (cp_parser_decltype_expr): Split out...
1735 (cp_parser_decltype): ...from here.
1739 * pt.c (unify_pack_expansion): Fix indexing.
1741 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
1743 * call.c (build_java_interface_fn_ref): Likewise.
1744 (make_temporary_var_for_ref_to_temp): Likewise.
1745 * class.c (check_field_decls): Likewise.
1746 (layout_class_type): Likewise.
1747 (finish_struct_1): Likewise.
1748 (fixed_type_or_null): Likewise.
1749 (get_vtbl_decl_for_binfo): Likewise.
1750 * cp-gimplify.c (omp_var_to_track): Likewise.
1751 (cp_genericize_r): Likewise.
1752 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
1753 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
1754 (DECL_DISCRIMINATOR_P): Likewise.
1755 * decl.c (poplevel): Likewise.
1756 (decls_match): Likewise.
1757 (duplicate_decls): Likewise.
1758 (decl_jump_unsafe): Likewise.
1759 (start_decl): Likewise.
1760 (check_for_uninitialized_const_var): Likewise.
1761 (make_rtl_for_nonlocal_decl): Likewise.
1762 (cp_finish_decl): Likewise.
1763 (expand_static_init): Likewise.
1764 (local_variable_p): Likewise.
1765 (maybe_register_incomplete_var): Likewise.
1766 * decl2.c (grokfield): Likewise.
1767 (comdat_linkage): Likewise.
1768 (determine_visibility): Likewise.
1769 (import_export_decl): Likewise.
1770 (prune_vars_needing_no_initialization): Likewise.
1771 (decl_maybe_constant_var_p): Likewise.
1772 * error.c (dump_simple_decl): Likewise.
1773 (dump_template_decl): Likewise.
1774 (cp_printer): Likewise.
1775 * except.c (build_throw): Likewise.
1776 * init.c (build_vtbl_address): Likewise.
1777 (member_init_ok_or_else): Likewise.
1778 (build_aggr_init): Likewise.
1779 (expand_aggr_init_1): Likewise.
1780 (build_offset_ref): Likewise.
1781 (constant_value_1): Likewise.
1782 * mangle.c (write_mangled_name): Likewise.
1783 (write_prefix): Likewise.
1784 * name-lookup.c (supplement_binding_1): Likewise.
1785 (add_decl_to_level): Likewise.
1786 (pushdecl_maybe_friend_1): Likewise.
1787 (check_for_out_of_scope_variable): Likewise.
1788 (validate_nonmember_using_decl): Likewise.
1789 (lookup_name_innermost_nonclass_level_1): Likewise.
1790 (lookup_arg_dependent_1): Likewise.
1791 * parser.c (cp_parser_lambda_introducer): Likewise.
1792 (cp_parser_template_argument): Likewise.
1793 (cp_parser_single_declaration): Likewise.
1794 * pt.c (convert_nontype_argument): Likewise.
1795 (instantiate_class_template_1): Likewise.
1796 (tsubst_decl): Likewise.
1797 (tsubst_expr): Likewise.
1798 (do_decl_instantiation): Likewise.
1799 (do_type_instantiation): Likewise.
1800 (regenerate_decl_from_template): Likewise.
1801 (always_instantiate_p): Likewise.
1802 (instantiate_decl): Likewise.
1803 (type_dependent_expression_p): Likewise.
1804 (build_non_dependent_expr): Likewise.
1805 * repo.c (repo_emit_p): Likewise.
1806 * rtti.c (build_dynamic_cast_1): Likewise.
1807 * search.c (shared_member_p): Likewise.
1808 * semantics.c (outer_var_p): Likewise.
1809 (finish_id_expression): Likewise.
1810 (finish_omp_clauses): Likewise.
1811 (finish_decltype_type): Likewise.
1812 (ensure_literal_type_for_constexpr_object): Likewise.
1813 * tree.c (lvalue_kind): Likewise.
1814 (bot_replace): Likewise.
1815 (cp_tree_equal): Likewise.
1816 (handle_init_priority_attribute): Likewise.
1817 (decl_storage_duration): Likewise.
1818 * typeck.c (cxx_sizeof_expr): Likewise.
1819 (cxx_alignof_expr): Likewise.
1820 (decay_conversion): Likewise.
1821 (build_class_member_access_expr): Likewise.
1822 (cp_build_array_ref): Likewise.
1823 (cxx_mark_addressable): Likewise.
1824 (maybe_warn_about_returning_address_of_local): Likewise.
1825 (check_return_expr): Likewise.
1826 * typeck2.c (cxx_readonly_error): Likewise.
1827 (abstract_virtuals_error_sfinae): Likewise.
1828 (cxx_incomplete_type_diagnostic): Likewise.
1830 2013-03-28 Lawrence Crowl <crowl@google.com>
1833 (CXX_PARSER_H): Add header dependence.
1835 (extern debug (cp_binding_level &)): New.
1836 (extern debug (cp_binding_level *)): New.
1838 (debug (cp_binding_level &)): New.
1839 (debug (cp_binding_level *)): New.
1841 (debug (cp_parser &)): New.
1842 (debug (cp_parser *)): New.
1843 (debug (cp_token &)): New.
1844 (debug (cp_token *)): New.
1845 (debug (vec<cp_token, va_gc> &)): New.
1846 (debug (vec<cp_token, va_gc> *)): New.
1847 * parser.c: Add header dependence.
1848 (extern debug (cp_parser &)): New.
1849 (extern debug (cp_parser *)): New.
1850 (extern debug (cp_token &)): New.
1851 (extern debug (cp_token *)): New.
1852 (extern debug (vec<cp_token, va_gc> &)): New.
1853 (extern debug (vec<cp_token, va_gc> *)): New.
1855 2013-03-28 Jason Merrill <jason@redhat.com>
1859 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
1860 the type if tf_decltype is set.
1861 * pt.c (fn_type_unification): Add decltype_p parm.
1862 (get_bindings): Adjust.
1863 * cp-tree.h: Adjust.
1864 * class.c (resolve_address_of_overloaded_function): Adjust.
1865 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
1868 * parser.c (cp_parser_sizeof_pack): Split out from...
1869 (cp_parser_sizeof_operand): ...here. Require (id).
1872 * semantics.c (finish_this_expr): 'this' is an rvalue.
1873 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
1876 * semantics.c (finish_member_declaration): Don't push closure
1879 * name-lookup.c (pushdecl_maybe_friend_1): Use
1880 nonlambda_method_basetype and current_nonlambda_class_type.
1883 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
1884 conversion from integer to pointer.
1885 (cxx_eval_constant_expression): Likewise.
1886 (cxx_eval_indirect_ref): Use the folded operand if we still think
1887 this might be constant.
1889 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1890 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1893 * call.c (convert_like_real): Change series of two permerrors
1894 to permerror + inform (and likewise for two errors).
1895 (build_new_method_call_1): Likewise.
1896 * typeck.c (convert_for_initialization): Change additional
1897 warning or error to inform.
1899 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1901 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
1902 (first_aggr_init_expr): Likewise.
1903 (more_aggr_init_expr_args_p): Likewise.
1904 (type_of_this_parm): Likewise.
1905 (class_of_this_parm): Likewise.
1906 * name-lookup.h (get_global_value_if_present): Likewise.
1907 (is_typename_at_global_scope): Likewise.
1909 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1911 * call.c (joust): Don't call inform for a permerror returning false.
1912 * parser.c (cp_parser_check_class_key): Likewise.
1913 * pt.c (tsubst_copy_and_build): Likewise.
1915 2013-03-27 Jason Merrill <jason@redhat.com>
1918 * semantics.c (finish_qualified_id_expr): Return early
1921 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1923 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1924 * cvt.c (convert_to_void): Likewise.
1925 * error.c (dump_expr): Likewise.
1926 * mangle.c (write_expression): Likewise.
1927 * parser.c (cp_parser_template_argument): Likewise.
1928 * pt.c (convert_nontype_argument): Likewise.
1929 (tsubst_copy_and_build): Likewise.
1930 * rtti.c (build_typeid): Likewise.
1931 * semantics.c (finish_call_expr): Likewise.
1932 (finish_decltype_type): Likewise.
1933 (build_data_member_initialization): Likewise.
1934 * tree.c (is_dummy_object): Likewise.
1935 * typeck.c (decay_conversion): Likewise.
1936 (build_class_member_access_expr): Likewise.
1937 (cp_build_addr_expr_1): Likewise.
1938 (unary_complex_lvalue): Likewise.
1939 (check_return_expr): Likewise.
1940 * typeck2.c (cxx_readonly_error): Likewise.
1942 2013-03-26 Jason Merrill <jason@redhat.com>
1945 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
1946 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
1947 * cp-tree.h: Adjust prototype.
1950 * typeck2.c (build_m_component_ref): Handle prvalue object.
1952 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1954 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
1955 * decl.c (duplicate_decls): Likewise.
1956 (cp_finish_decl): Likewise.
1957 (check_class_member_definition_namespace): Likewise.
1958 * decl2.c (grokfield): Likewise.
1959 (decl_needed_p): Likewise.
1960 (import_export_decl): Likewise.
1961 (mark_used): Likewise.
1962 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1963 * pt.c (push_access_scope): Likewise.
1964 (instantiate_decl): Likewise.
1965 * ptree.c (cxx_print_decl): Likewise.
1966 * repo.c (repo_emit_p): Likewise.
1967 * semantics.c (note_decl_for_pch): Likewise.
1968 * tree.c (decl_linkage): Likewise.
1970 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1973 * decl.c (check_array_designated_initializer): Handle CONST_DECL
1976 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1978 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1981 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1983 2013-03-25 Jason Merrill <jason@redhat.com>
1986 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1987 class is derived from the type of the object.
1990 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1991 unevaluated context.
1993 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
1996 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1997 DECL_TEMPLATE_INSTANTIATION.
1999 2013-03-22 Jason Merrill <jason@redhat.com>
2002 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
2005 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
2007 * cp-tree.h (identifier_p): New.
2008 * call.c: Throughout, call identifier_p insstead of direct
2009 comparaison of TREE_CODE against IDENTIFIER_NODE.
2010 * decl.c: Likewisse.
2011 * decl2.c: Likewise.
2013 * mangle.c: Likewise.
2014 * name-lookup.c: Likewise.
2015 * parser.c: Likewise.
2017 * search.c: Likewise.
2018 * semantics.c: Likewise.
2020 * typeck.c: Likewise.
2021 * typeck2.c: Likewise.
2023 2013-03-21 Jakub Jelinek <jakub@redhat.com>
2026 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
2027 * call.c (build_temp): Likewise.
2028 * method.c (synthesize_method): Likewise.
2029 * typeck.c (convert_for_initialization): Likewise.
2031 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
2033 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
2035 2013-03-21 Richard Biener <rguenther@suse.de>
2037 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
2038 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
2040 2013-03-20 Jason Merrill <jason@redhat.com>
2043 * parser.c (cp_parser_late_return_type_opt): Save and restore
2044 current_class_ptr/ref.
2047 * expr.c (cplus_expand_constant): Do nothing if the class is
2049 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
2050 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
2051 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
2052 (complete_vars): Likewise.
2054 * name-lookup.c (get_anonymous_namespace_name): Never use
2055 get_file_function_name.
2057 * pt.c (retrieve_specialization): Handle null tmpl argument.
2061 * pt.c (tsubst_decl): Check return value of register_specialization.
2062 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
2065 2013-03-17 Jason Merrill <jason@redhat.com>
2069 * parser.c (cp_parser_direct_declarator): Bail if we see a
2070 qualified-id not at namespace scope.
2074 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
2077 2013-03-16 Jason Merrill <jason@redhat.com>
2079 * decl.c (grokdeclarator): Assert that we won't see a pointer to
2083 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
2084 (MAYBE_CLASS_TYPE_P): ...here.
2085 * semantics.c (lambda_capture_field_type): Only build a
2086 magic decltype for wildcard types.
2087 (lambda_proxy_type): Likewise.
2088 (finish_non_static_data_member): Get the quals from
2092 * parser.c (cp_parser_template_argument): Don't
2093 fold_non_dependent_expr.
2095 * parser.c (cp_parser_lambda_declarator_opt): Use
2096 cp_parser_trailing_type_id.
2099 * parser.c (cp_parser_template_id): Don't forget access checks.
2102 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
2106 * name-lookup.h (tag_scope): Add ts_lambda.
2107 * semantics.c (begin_lambda_type): Use it.
2108 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
2109 * pt.c (check_default_tmpl_args): Ignore lambdas.
2110 (push_template_decl_real): Handle lambdas.
2111 * tree.c (no_linkage_check): Adjust lambda check.
2114 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
2117 * parser.c (cp_parser_direct_declarator): Fix late return
2118 for out-of-class defn of member function.
2121 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
2122 parms to avoid duplicate -Wshadow warnings.
2124 * search.c (lookup_base): Handle NULL_TREE.
2127 * semantics.c (potential_constant_expression_1): Use of 'this' in
2128 a non-constexpr function makes the expression not potentially
2133 * cp-tree.h (tsubst_flags): Add tf_decltype.
2134 * call.c (build_cxx_call): Don't build a temporary if it's set.
2135 (build_over_call): Make sure it's only passed to build_cxx_call.
2136 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
2137 (cp_parser_unary_expression): Likewise.
2138 (cp_parser_cast_expression): Likewise.
2139 (cp_parser_binary_expression): Likewise.
2140 (cp_parser_assignment_expression): Likewise.
2141 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
2142 (cp_parser_expression): Add decltype_p. Force a
2143 temporary for a call on the LHS of a comma.
2144 (cp_parser_decltype): Pass true to decltype_p parms.
2145 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
2146 (tsubst_copy_and_build): Pass tf_decltype down only for
2147 CALL_EXPR and the RHS of COMPOUND_EXPR.
2148 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
2150 * cp-tree.h (abstract_class_use): New enum.
2151 * typeck2.c (pending_abstract_type): Add use field.
2152 (abstract_virtuals_error_sfinae): Add overloads taking
2153 abstract_class_use instead of tree.
2154 * typeck.c (build_static_cast_1): Call it.
2155 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
2156 * pt.c: Adjust calls.
2157 * decl.c (cp_finish_decl): Don't handle functions specially.
2158 (grokdeclarator): Always check return type.
2159 * init.c (build_new_1): Adjust call.
2163 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
2164 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
2167 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
2168 (tsubst_arg_types): Likewise.
2172 * call.c (convert_like_real): Check for explicit constructors
2173 even for value-initialization.
2176 * pt.c (convert_nontype_argument): Handle invalid pointer.
2178 * parser.c (cp_parser_lambda_expression): Use nreverse.
2182 * pt.c (instantiate_class_template_1): Instantiate lambda capture
2184 (tsubst_copy_and_build): Not here.
2187 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
2190 * parser.c (parsing_nsdmi): New.
2191 * semantics.c (outer_automatic_var_p): Check it.
2192 (finish_id_expression): Likewise.
2193 * cp-tree.h: Declare it.
2196 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
2198 * parser.c (lookup_literal_operator): Correct parm/arg naming
2202 * pt.c (fold_non_dependent_expr_sfinae): Check
2203 instantiation_dependent_expression_p.
2206 * class.c (resolve_address_of_overloaded_function): Accept a
2207 reference to function for target_type.
2208 (instantiate_type): Likewise.
2209 * pt.c (convert_nontype_argument): Pass it to
2210 convert_nontype_argument_function.
2212 2013-03-16 Jakub Jelinek <jakub@redhat.com>
2214 * tree.c (cp_tree_equal): Fix a pasto.
2217 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
2218 pass op1 through maybe_constant_value first.
2220 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
2223 * semantics.c (cxx_eval_array_reference): Check for negative index.
2225 2013-03-14 Jason Merrill <jason@redhat.com>
2228 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
2231 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
2232 dso_handle parm on targets without __cxa_atexit.
2234 2013-03-11 Jason Merrill <jason@redhat.com>
2237 * typeck.c (check_return_expr): Disallow returning init list here.
2238 * semantics.c (apply_deduced_return_type): Not here.
2240 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
2243 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
2244 * error.c (dump_expr): Likewise.
2246 2013-03-08 Jason Merrill <jason@redhat.com>
2249 * class.c (modify_all_vtables): Mangle the vtable name before
2252 * semantics.c (lambda_expr_this_capture): In unevaluated context,
2253 just return the nearest 'this'.
2258 * tree.c (maybe_dummy_object): Don't capture 'this'.
2259 * semantics.c (maybe_resolve_dummy): New.
2260 (finish_non_static_data_member): Use it.
2261 (finish_qualified_id_expr): Don't test is_dummy_object.
2262 * cp-tree.h: Declare maybe_resolve_dummy.
2263 * call.c (build_new_method_call_1): Use it.
2266 * semantics.c (apply_deduced_return_type): Don't allow returning
2267 std::initializer_list.
2269 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2272 * parser.c (cp_parser_elaborated_type_specifier): Don't call
2273 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
2274 * decl.c (check_elaborated_type_specifier): Tidy.
2276 2013-03-06 Jakub Jelinek <jakub@redhat.com>
2279 * tree.c (strip_typedefs): Don't copy args if they are NULL.
2281 2013-03-05 Jakub Jelinek <jakub@redhat.com>
2283 * parser.c (cp_parser_braced_list): For {} initialize
2284 *non_constant_p to false.
2286 2013-03-04 Jason Merrill <jason@redhat.com>
2290 * semantics.c (lambda_expr_this_capture): Handle NSDMI
2291 and non-class scopes.
2293 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
2295 * decl.c (grokdeclarator): Remove dead code.
2297 2013-02-28 Jason Merrill <jason@redhat.com>
2300 * semantics.c (potential_constant_expression_1): Use
2301 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
2304 * call.c (build_over_call): Avoid virtual lookup in a template.
2306 2013-02-27 Jason Merrill <jason@redhat.com>
2310 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
2311 of the base name for inheriting ctors.
2312 (push_class_level_binding_1): Remove inheriting ctor handling.
2313 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2314 * class.c (add_implicitly_declared_members): Adjust.
2316 2013-02-26 David Binderman <dcb314@hotmail.com>
2319 * decl.c (grokdeclarator): Tidy publicp assignment.
2321 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
2324 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
2325 (build_transaction_expr): Same.
2327 2013-02-25 Jason Merrill <jason@redhat.com>
2330 * pt.c (fn_type_unification): Wait to call push_tinst_level until
2331 we know what args we're looking at.
2334 * semantics.c (potential_constant_expression_1): In C++98, a cast
2335 to non-integral type can't be a constant expression.
2337 2013-02-24 Jakub Jelinek <jakub@redhat.com>
2340 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
2343 2013-02-22 Jason Merrill <jason@redhat.com>
2346 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
2347 if we got the wrong number of template parms.
2350 * pt.c (fn_type_unification): Use explicit args in template
2351 instantiation context.
2354 * call.c (can_convert_arg): Discard access checks.
2357 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
2360 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
2363 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
2364 * cvt.c (ocp_convert): Use the latter.
2365 (cp_convert_to_pointer): Likewise.
2366 * decl.c (check_default_argument): Likewise.
2367 * typeck.c (cp_build_binary_op): Likewise.
2368 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
2370 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
2371 Paolo Carlini <paolo.carlini@oracle.com>
2374 * decl2.c (grokbitfield): Allow scoped enumeration types.
2376 2013-02-15 Jason Merrill <jason@redhat.com>
2379 * semantics.c (finish_id_expression): Also return the identifier
2380 for an outer local static.
2383 * class.c (check_bases_and_members): Deduce noexcept after
2387 * semantics.c (finish_id_expression): In a template, return
2388 the identifier for a constant variable.
2390 2013-02-14 Jason Merrill <jason@redhat.com>
2393 * semantics.c (build_anon_member_initialization): New.
2394 (build_data_member_initialization): Use it.
2397 * decl.c (cp_finish_decl): Force instantiation of an
2398 auto static data member.
2401 * pt.c (unify): A pack expansion that is not the last template
2402 argument makes the entire template argument list non-deduced.
2405 * name-lookup.c (do_class_using_decl): Handle typedefs with
2406 inheriting constructors.
2407 (push_class_level_binding_1): Allow inheriting from template
2408 template parameter, too.
2409 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2412 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
2413 default argument scope.
2414 * mangle.c (write_name): Likewise.
2417 * error.c (find_typenames_r): Don't walk into a pack expansion.
2419 2013-02-13 Jason Merrill <jason@redhat.com>
2422 * parser.c (cp_parser_member_declaration): Check the declarator
2423 form when detecting a function declaration via typedef.
2426 * pt.c (maybe_process_partial_specialization): A lambda
2427 isn't what's being specialized.
2430 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
2434 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
2437 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
2438 non-zero offsets, too.
2441 * decl.c (build_enumerator): Always convert the value to a
2442 fixed underlying type.
2445 * pt.c (tsubst_copy_and_build): Don't forget any new
2446 captures that arose from use of dependent names.
2448 2013-02-13 Jakub Jelinek <jakub@redhat.com>
2451 * semantics.c (finish_asm_stmt): If input constraints allow
2452 neither register nor memory, try maybe_constant_value to get
2453 a constant if possible.
2455 2013-02-12 Jason Merrill <jason@redhat.com>
2458 * method.c (add_one_base_init): Handle base constructor
2459 taking rvalue reference parm.
2462 * semantics.c (sort_constexpr_mem_initializers): Handle
2465 2013-02-09 Jason Merrill <jason@redhat.com>
2468 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
2469 maybe_instantiate_noexcept.
2472 * pt.c (eq_specializations): Set comparing_specializations.
2473 * tree.c (cp_tree_equal): Check it.
2474 * cp-tree.h: Declare it.
2476 * decl.c (decls_match): Check versions later.
2479 * pt.c (build_non_dependent_expr): Don't try to fold
2480 instantiation-dependent expressions.
2481 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
2482 [BIND_EXPR]: Treat as dependent.
2484 2013-02-07 Jakub Jelinek <jakub@redhat.com>
2487 * init.c (build_vec_init): Don't append NULL values into new_vec.
2488 (build_zero_init_1): Don't push anything into v if recursive call
2490 (build_value_init_noctor): Don't push anything into v if
2491 build_value_init call returned NULL_TREE.
2494 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
2495 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
2496 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
2497 return true only if 2nd token isn't CPP_CLOSE_PAREN.
2498 (cp_parser_cast_expression): Adjust caller.
2501 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
2502 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
2503 DECL_LANG_SPECIFIC (t).
2505 2013-02-07 Jason Merrill <jason@redhat.com>
2508 * method.c (do_build_copy_constructor): Don't bother turning
2509 scalars from lvalues to xvalues.
2510 (do_build_copy_assign): Likewise.
2512 2013-02-06 Jason Merrill <jason@redhat.com>
2514 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
2516 2013-02-05 Jason Merrill <jason@redhat.com>
2519 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
2523 * decl.c (start_preparsed_function): Update restype if we change
2527 * pt.c (fn_type_unification): Discard any access checks from
2528 substituting explicit args.
2530 2013-01-31 Jason Merrill <jason@redhat.com>
2534 * typeck.c (get_member_function_from_ptrfunc): Fix
2535 ptrmemfunc_vbit_in_delta case.
2537 2013-01-29 Jason Merrill <jason@redhat.com>
2540 * class.c (build_ctor_vtbl_group): Give construction vtables
2543 2013-01-25 Jason Merrill <jason@redhat.com>
2546 * pt.c (convert_nontype_argument_function): Handle invalid input.
2547 (convert_nontype_argument): Likewise.
2550 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
2551 dynamic type has no virtual functions.
2553 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
2556 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
2557 on TARGET_EXPR nodes.
2559 2013-01-22 Jason Merrill <jason@redhat.com>
2562 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
2564 2013-01-22 Dodji Seketeli <dodji@redhat.com>
2567 * pt.c (argument_pack_element_is_expansion_p)
2568 (make_argument_pack_select, use_pack_expansion_extra_args_p)
2569 (gen_elem_of_pack_expansion_instantiation): New static functions.
2570 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
2571 look through the possibly resulting pack expansion as well.
2572 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
2573 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
2574 Use gen_elem_of_pack_expansion_instantiation to build the
2575 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
2576 as gen_elem_of_pack_expansion_instantiation and the change in
2577 tsubst above generalize this particular case.
2578 (arg_from_parm_pack_p): Remove this for it's not used by
2579 tsubst_pack_expansion anymore.
2581 2013-01-21 Jason Merrill <jason@redhat.com>
2584 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
2585 template args count.
2587 2013-01-18 Jason Merrill <jason@redhat.com>
2590 * decl2.c (get_local_tls_init_fn): New.
2591 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
2592 with aliases for internal variables. Don't use weakrefs if
2593 the variable needs destruction.
2594 (generate_tls_wrapper): Mark the wrapper as const if no
2595 initialization is needed.
2596 (handle_tls_init): Don't require aliases.
2598 2013-01-15 Dodji Seketeli <dodji@redhat.com>
2601 * pt.c (coerce_innermost_template_parms): New static function.
2602 (instantiate_alias_template): Use it here.
2604 2013-01-09 Jason Merrill <jason@redhat.com>
2607 * rtti.c (build_typeid, get_typeid): Add complain parm.
2608 (get_tinfo_decl_dynamic): Likewise.
2609 * cp-tree.h, parser.c, pt.c: Adjust.
2612 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
2615 2013-01-09 Jakub Jelinek <jakub@redhat.com>
2618 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
2619 call maybe_constant_value for the negative or too big shift
2622 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
2625 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
2626 of the argument is true.
2628 2013-01-08 Joel Brobecker <brobecker@adacore.com>
2630 * parser.c (cp_parser_initializer_list): Move declaration
2631 of variable non_const to start of lexical block.
2633 2013-01-07 Jason Merrill <jason@redhat.com>
2636 * tree.c (build_aggr_init_expr): Do nothing in a template.
2637 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
2638 a FUNCTION_DECL before tsubsting.
2640 2013-01-04 Dodji Seketeli <dodji@redhat.com>
2643 * pt.c (check_instantiated_arg): Allow type template arguments.
2645 2013-01-04 Jason Merrill <jason@redhat.com>
2648 * decl.c (reset_type_linkage, bt_reset_linkage): New.
2649 (grokdeclarator): Use reset_type_linkage.
2650 * name-lookup.c (binding_table_foreach): Handle null table.
2651 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
2653 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2655 PR c++/54526 (again)
2656 * parser.c (cp_parser_template_id): Revert core of previous change
2657 (keep adjusted inform message).
2659 2013-01-03 Jason Merrill <jason@redhat.com>
2663 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
2667 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
2670 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
2673 * call.c (type_has_extended_temps): New.
2674 * cp-tree.h: Declare it.
2675 * decl.c (check_initializer): Use build_aggr_init for arrays
2677 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
2679 2013-01-02 Jason Merrill <jason@redhat.com>
2682 * call.c (build_new_method_call_1): Don't use build_value_init for
2683 user-provided default constructors.
2685 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
2689 * tree.c (build_cplus_array_type): Copy layout information
2690 to main variant if necessary.
2692 Copyright (C) 2013 Free Software Foundation, Inc.
2694 Copying and distribution of this file, with or without modification,
2695 are permitted in any medium without royalty provided the copyright
2696 notice and this notice are preserved.