1 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
4 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if one of
5 the target types is incomplete; return a bool, not an int.
6 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
8 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
10 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
13 2013-07-21 OndÅej BÃlka <neleai@seznam.cz>
16 * cp-array-notation.c: Likewise.
17 * cp-objcp-common.c: Likewise.
23 * semantics.c: Likewise.
25 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
27 * semantics.c (build_lambda_expr),
28 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
29 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
30 (is_normal_capture_proxy), (insert_capture_proxy),
31 (insert_pending_capture_proxies), (lambda_proxy_type),
32 (build_capture_proxy), (vla_capture_type),
33 (register_capture_members), (add_default_capture),
34 (lambda_expr_this_capture), (maybe_resolve_dummy),
35 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
36 (is_lambda_ignored_entity): Moved definitions into ...
37 * lambda.c: ... this new file.
39 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
41 * call.c (build_conditional_expr_1): Handle the case with 1 vector
42 and 2 scalars. Call save_expr before building a vector.
43 * typeck.c (cp_build_binary_op): Check complain before complaining.
45 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
48 * init.c (build_aggr_init): Check for warn_unused attribute.
49 * decl.c (poplevel): Likewise.
51 2013-07-13 Jason Merrill <jason@redhat.com>
54 * init.c (build_vec_init): Use {} for arrays of class type.
55 (build_vec_delete): Don't take the address of the array.
58 * class.c (layout_class_type): Check for too-large class.
60 * call.c (can_convert): Allow user-defined conversions.
61 (can_convert_standard): New.
62 * cp-tree.h: Declare it.
63 * cvt.c (convert_to_reference): Use it.
64 * pt.c (convert_nontype_argument): Likewise.
65 * search.c (check_final_overrider): Likewise.
66 Don't worry about user-defined conversions.
68 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
71 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
72 warn about casting between pointer-to-function and pointer-to-object.
74 2013-07-09 Jason Merrill <jason@redhat.com>
77 * init.c (build_vec_init): Don't take shortcuts when initializing
81 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
84 * semantics.c (finish_id_expression): Return the id for an
85 unevaluated outer variable.
88 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
89 if the variable type uses 'auto'.
92 * typeck.c (check_return_expr): Lambda proxies aren't eligible
93 for nrv or return by move.
96 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
97 a ref-qualifier in C++98 mode.
100 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
101 argument to have the exact type of the parameter.
104 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
105 a POINTER_PLUS_EXPR for type punning diagnostic.
108 * pt.c (tsubst_copy): Handle USING_DECL.
110 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
113 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
115 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
118 * call.c (build_conditional_expr_1): Preserve xvalues.
120 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
123 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
124 also check declares_class_or_enum.
126 2013-07-08 Jason Merrill <jason@redhat.com>
129 * pt.c (fn_type_unification): Only defer during substitution.
130 (type_unification_real): Defer during defarg substitution,
131 add checks parm to pass back deferred checks.
132 (unify, do_auto_deduction): Adjust.
133 * semantics.c (reopen_deferring_access_checks): New.
134 * cp-tree.h: Declare it.
136 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
139 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
140 set parser->default_arg_ok_p to false before cp_parser_declarator.
142 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
145 * class.c (build_base_path): Improve diagnostic.
147 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
150 * decl.c (start_preparsed_function): Return a bool, false if
151 push_template_decl fails.
152 (start_function): Adjust.
155 2013-07-03 Jakub Jelinek <jakub@redhat.com>
158 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
159 Temporarily set parser->greater_than_is_operator_p for
160 cp_parser_expression and restore from saved value afterwards.
162 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
164 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
165 * parser.c (cp_parser_operator()): Parse user-defined string
166 literal as literal operator.
168 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
171 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
172 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
175 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
177 * parser.c (cp_parser_array_notation): Removed rejection array notation
178 of type function pointers. Added handling of array expressions when
179 Cilk Plus is enabled. Took out type-checking.
180 (cp_parser_postfix_open_square_expression): Moved normal array expr.
181 parsing into cp_parser_array_notation when cilkplus is enabled.
182 (cp_parser_compound_statement): Removed expansion of array notations.
183 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
184 (cp_parser_function_definition_after_declarator): Likewise.
185 (cp_parser_selection_statement): Removed error reporting.
186 (cp_parser_iteration_statement): Likewise.
187 (cp_parser_direct_declarator): Removed error checking/reporting if
188 array notations are used in the declarator.
189 * pt.c (instantiate_decl): Likewise.
190 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
191 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
192 (potential_constant_expression_1): Returned false for
193 ARRAY_NOTATION_REF case.
194 * cp-gimplify.c (cp_genericize): Added expansion of array notation
196 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
197 parameters. Replaced build_decls with get_temp_regvar with type as
199 (create_array_refs): Made the type-casting to ptrdiff_type.
200 (replace_invariant_var): Added a check for void return type before
201 creating new var. Replaced build_decl and build_min_nt_loc with
203 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
204 with gcc_unreachable. Removed few unwanted checks. Made induction
205 variable type as ptrdiff_type. Removed loc and complain arguments
206 passed into make_triplet_val_inv. Replaced all modify expression's
207 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
208 into stmt. list with the non-forceful one. Replaced some integer
209 conversion and equality-checking to using tree_int_cst_equal.
210 (expand_sec_reduce_builtin): All changes mentioned in above function
211 expand_an_in_modify_expr. Made the new variable type of
212 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
213 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
214 the error reporting from parser to this function. Removed unwanted
215 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
216 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
217 in function pointers.
218 (cp_expand_cond_array_notations): Added a new if statements to check
219 if condition has a zero rank. If so, then just return.
220 (expand_return_expr): Added a check for return expressions with a rank.
221 Replaced get_tmp_regvar with a create_temporary_var.
222 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
223 Moved common code outside if-statements. Moved type-checking from
225 * semantics.c (finish_return_stmt): Removed a check for return exprs.
227 * call.c (convert_like_real): Removed a check for array notation
228 expression in a function.
229 (build_over_call): Likewise.
230 (magic_varargs_p): Added a check for builtin array notation function.
231 Made this function non-static and removed its prototype.
232 * cp-tree.h (magic_varargs_p): New prototype.
233 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
234 nargs to the param->length when builtin reduction function is used.
235 (convert_arguments): Replaced check for a constant_p function with
236 margic_varargs_p function call.
237 (cp_build_binary_op): Removed calling of the function
238 find_correct_array_notation_type.
239 (cp_build_addr_expr_1): Removed an unwanted if-statement.
240 (convert_for_assignment): Removed automatic return of rhs when array
241 notation builtin function is used.
243 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
246 * parser.c (cp_parser_save_member_function_body): Handle correctly
247 curly braces in function-try-block mem-initializers.
249 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
252 * typeck.c (cp_build_vec_perm_expr): New function.
253 * cp-tree.h: Declare it.
254 * parser.c (cp_parser_postfix_expression): Call it.
255 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
256 (tsubst_copy_and_build): Likewise.
258 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
261 * pt.c (more_specialized_fn): If both arguments are references,
262 give priority to an lvalue.
264 2013-06-26 Jason Merrill <jason@redhat.com>
266 * typeck2.c (store_init_value): Diagnose a non-constant
267 initializer for in-class static.
270 * semantics.c (add_capture): Set type to error_mark_node after
273 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
276 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
277 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
279 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
281 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
282 * class.c (add_implicitly_declared_members): Likewise.
283 (check_field_decl): Likewise.
284 (finalize_literal_type_property): Likewise.
285 (check_bases_and_members): Likewise.
286 * decl.c (poplevel): Likewise.
287 (case_conversion): Likewise.
288 (check_initializer): Likewise.
289 (grokfndecl): Likewise.
290 (check_static_variable_definition): Likewise.
291 (compute_array_index_type): Likewise.
292 (grokdeclarator): Likewise.
293 (build_enumerator): Likewise.
294 * friend.c (make_friend_class): Likewise.
295 * lex.c (init_reswords): Likewise.
296 * method.c (synthesized_method_walk): Likewise.
297 (implicitly_declare_fn): Likewise.
298 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
299 (cp_parser_constant_expression): Likewise.
300 (cp_parser_for_init_statement): Likewise.
301 (cp_parser_block_declaration): Likewise.
302 (cp_parser_type_name): Likewise.
303 (cp_parser_enum_specifier): Likewise.
304 (cp_parser_enumerator_list): Likewise.
305 (cp_parser_member_declaration): Likewise.
306 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
307 (cp_parser_template_declaration_after_export): Likewise.
308 * pt.c (convert_nontype_argument_function): Likewise.
309 (convert_nontype_argument): Likewise.
310 (convert_template_argument): Likewise.
311 (tsubst_copy_and_build): Likewise.
312 (build_non_dependent_expr): Likewise.
313 * semantics.c (non_const_var_error): Likewise.
314 (potential_constant_expression_1): Likewise.
315 * tree.c (lvalue_kind): Likewise.
316 (build_vec_init_expr): Likewise.
317 (cast_valid_in_integral_constant_expression_p): Likewise.
318 * typeck.c (build_x_conditional_expr): Likewise.
319 * typeck2.c (check_narrowing): Likewise.
321 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
323 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
324 (expand_an_in_modify_expr): Changed a function call from the above
325 removed function to length_mismatch_in_expr_p.
327 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
329 * call.c (convert_like_real): Added a check if array notation is present
330 in expression. If so, then no conversion of arguments is necessary.
331 (build_over_call): Likewise.
332 * typeck.c (cp_build_function_call_vec): Likewise.
333 (convert_for_assignment): Likewise.
334 (cp_build_array_ref): Reject array notations with a rank greater than 1
336 (cp_build_binary_op): If array notations are preent in op, then call
337 find_correct_array_notation_type.
338 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
339 * cp-array-notation.c: New file.
340 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
342 * cp-tree.h (fix_array_notation_exprs): New prototype.
343 * semantics.c (finish_return_stmt): Reject array notations as
345 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
346 (potential_constant_expression_1): Likewise.
347 * tree.c (lvalue_kind): Likewise.
348 * error.c (dump_decl): Likewise.
349 (dump_expr): Likewise.
350 * pt.c (ARRAY_NOTATION_REF): Likewise.
351 (type_unification_real): Do not unify any arguments if array notations
353 (instantiate_decl): Added a check for array notaitons inside the
354 function body. If so, then expand them.
355 * parser.c (cp_parser_array_notation): New function.
356 (cp_parser_postfix_open_square_expression): Added a check for colons
357 inside square braces. If found, then handle the array access as an
358 array notation access. Also, disable auto-correction from a single
359 colon to scope when Cilk Plus is enabled.
360 (cp_parser_compound_statement): Added a check for array notations
361 inside the statement. If found, then expand them.
362 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
363 (cp_parser_function_definition_after_declarator): Likewise.
364 (cp_parser_selection_statement): Searched for array notations inside
365 condition. If so, then emit an error.
366 (cp_parser_iteration_statement): Likewise.
367 (cp_parser_direct_declarator): Reject array notations inside a
368 variable or array declaration.
369 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
371 2013-06-20 Jason Merrill <jason@redhat.com>
374 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
375 context if we're in C++14 mode.
376 * tree.c (array_of_runtime_bound_p): Return true for a dependent
377 bound that is not potentually constant.
378 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
379 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
380 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
381 (build_capture_proxy): Set REFERENCE_VLA_OK.
382 (vla_capture_type): Make it a proper C++ class.
383 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
386 * decl.c (compute_array_index_type): Use size_one_node.
388 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
389 a partial specialization.
390 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
392 (most_specialized_class): Adjust.
394 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
395 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
398 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
401 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
402 TREE_TYPE (arg), not arg itself.
404 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
407 * pt.c (type_dependent_expression_p): Handle an array of unknown
408 bound depending on a variadic parameter.
409 * parser.c (cp_parser_range_for): Revert PR56794 changes.
411 2013-06-17 Richard Biener <rguenther@suse.de>
413 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
415 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
418 * parser.c (cp_parser_expression_statement): Check whether
419 cp_parser_expression returns error_mark_node.
421 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
424 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
426 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
429 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
430 accessible base simply forward to build_static_cast.
432 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
435 * decl.c (poplevel): For the benefit of -Wunused-variable see
438 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
440 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
442 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
445 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
446 again diagnostic already emitted by cp_parser_lookup_name.
448 2013-06-11 Jan Hubicka <jh@suse.cz>
451 * cp/pt.c (mark_decl_instantiated): Do not export explicit
452 instantiations of anonymous namespace templates.
454 2013-06-10 Jason Merrill <jason@redhat.com>
456 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
457 namespace to static_decls.
459 2013-06-07 Sriraman Tallam <tmsriram@google.com>
462 * call.c (build_over_call): Check if current_function_decl is
465 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
468 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
469 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
471 2013-06-06 Jason Merrill <jason@redhat.com>
474 * semantics.c (add_capture): Diagnose capture of variable-size
475 type that is not a C++1y array of runtime bound.
477 * decl.c (grokdeclarator): Keep a decl with error type.
478 (grokfield, grokbitfield): Likewise.
479 * pt.c (instantiate_class_template_1): Likewise.
480 (tsubst_decl): Drop redundant error.
481 * class.c (walk_subobject_offsets): Handle erroneous fields.
482 * typeck2.c (process_init_constructor_record): Likewise.
484 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
487 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
488 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
490 2013-06-03 Jan Hubicka <jh@suse.cz>
492 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
493 mark_decl_referenced.
494 (mark_needed): Likewise.
496 2013-06-03 Jason Merrill <jason@redhat.com>
498 * class.c (mark_type_abi_tags): New.
499 (check_abi_tags): Use it.
501 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
504 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
505 * semantics.c (finish_qualified_id_expr): Use it.
508 2013-06-01 Jan Hubicka <jh@suse.cz>
510 * decl2.c (cp_write_global_declarations): Replace same_body_alias
511 by symbol.cpp_implicit_alias.
513 2013-05-30 Jason Merrill <jason@redhat.com>
516 * cp-lang.c (cp_classify_record): Handle structs without
520 * class.c (common_enclosing_class): New.
521 * cp-tree.h: Declare it.
522 * init.c (sort_mem_initializers): Don't splice out a union member
525 2013-05-29 Jan Hubicka <jh@suse.cz>
527 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
528 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
530 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
533 * decl2.c (check_classfn): Check for destructors declared as member
536 2013-05-24 Jason Merrill <jason@redhat.com>
539 * pt.c (any_template_arguments_need_structural_equality_p): A
540 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
542 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
545 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
546 with width exceeding the type.
548 2013-05-24 Jason Merrill <jason@redhat.com>
551 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
552 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
554 2013-05-23 Jason Merrill <jason@redhat.com>
557 * tree.c (build_ref_qualified_type): Clear
558 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
560 2013-05-22 Jason Merrill <jason@redhat.com>
563 * call.c (convert_like_real): Use cp_convert_and_check.
564 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
565 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
566 (potential_constant_expression_1): Handle OMP_ATOMIC*.
569 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
572 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
575 * parser.c (cp_parser_conversion_type_id): Set up
576 parser->type_definition_forbidden_message before calling
577 cp_parser_type_specifier_seq.
579 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
582 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
583 warnings about defaulted functions.
585 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
587 * call.c (build_conditional_expr_1): Add location_t parameter.
588 (build_conditional_expr): Likewise.
589 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
590 get_member_function_from_ptrfunc, build_x_conditional_expr,
591 cp_build_modify_expr): Update.
592 * init.c (build_new_1): Likewise.
593 * cp-tree.h: Update declaration.
595 2013-05-20 Jason Merrill <jason@redhat.com>
598 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
602 * decl.c (fndecl_declared_return_type): Also look in
603 DECL_SAVED_FUNCTION_DATA.
605 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
608 * parser.c (cp_parser_parameter_declaration): Check return value
609 of cp_parser_parse_and_diagnose_invalid_type_name.
611 2013-05-20 Jason Merrill <jason@redhat.com>
614 * class.c (vbase_has_user_provided_move_assign): New.
615 * method.c (synthesized_method_walk): Check it.
616 * cp-tree.h: Declare it.
619 * tree.c (build_cplus_array_type): Copy layout info if element
622 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
625 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
627 2013-05-20 Jason Merrill <jason@redhat.com>
630 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
631 whether a template has its own args.
633 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
636 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
638 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
641 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
642 instead of cp_parser_initializer_list for compound-literals.
644 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
647 * typeck.c (check_return_expr): Reverse the alignment comparison.
649 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
652 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
653 correctly sizeof compound-literal; update comments.
655 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
657 * call.c (build_conditional_expr_1): Use cp_build_binary_op
658 instead of directly calling fold_build2.
660 2013-05-16 Jason Merrill <jason@redhat.com>
662 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
665 * decl.c (grokdeclarator): Allow member function qualifiers in
666 TYPENAME context in C++11 mode.
668 2013-05-16 Dodji Seketeli <dodji@redhat.com>
670 PR c++/56782 - Regression with empty pack expansions
671 * pt.c (use_pack_expansion_extra_args_p): When at least a
672 parameter pack has an empty argument pack, and another parameter
673 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
676 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
678 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
679 warning_at and permerror with warning_at/inform and permerror/
680 inform, respectively.
682 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
685 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
688 2013-05-14 Jason Merrill <jason@redhat.com>
691 * parser.c (cp_parser_range_for): Call complete_type.
694 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
696 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
699 * method.c (defaulted_late_check): Check for compatible exception
700 specification out of class explicitly defaulted functions too.
702 2013-05-14 Jason Merrill <jason@redhat.com>
705 * semantics.c (potential_constant_expression_1): Make sure the
706 called function is potentially constant.
707 * call.c (null_ptr_cst_p): Revert earlier change.
709 2013-05-13 Jason Merrill <jason@redhat.com>
712 * call.c (null_ptr_cst_p): An expression with side-effects can't
713 be a C++03 null pointer constant.
716 * decl.c (reshape_init_class): Handle error_mark_node.
719 * typeck.c (merge_types): Propagate ref-qualifier
723 * decl.c (grokdeclarator): Apply ref-qualifier
724 in the TYPENAME case.
727 * decl.c (decls_match): Compare ref-qualifiers.
729 2013-05-10 Jason Merrill <jason@redhat.com>
732 * pt.c (convert_template_argument): Use dependent_template_arg_p,
733 not uses_template_parms.
736 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
739 * semantics.c (add_capture): Error rather than abort on copy
741 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
742 warn about capture proxy.
744 2013-05-09 Jason Merrill <jason@redhat.com>
746 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
749 * pt.c (lookup_template_class_1): Handle getting a template
750 template parameter as D1.
752 N3639 C++1y VLA diagnostics
753 * decl.c (grokdeclarator): Complain about reference, pointer, or
755 (create_array_type_for_decl): Complain about array of VLA.
756 * pt.c (tsubst): Likewise.
757 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
758 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
759 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
760 (cxx_sizeof_or_alignof_type): Likewise.
762 N3639 C++1y VLA support
763 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
764 (check_array_initializer): Allow VLA init.
765 (reshape_init_array_1): Adjust.
766 (cp_finish_decl): Check for invalid VLA length.
767 * typeck2.c (process_init_constructor_array): Adjust.
768 (store_init_value): Use build_vec_init for VLAs.
769 * semantics.c (add_capture): Capture VLA as ptr+len.
770 (vla_capture_type): New.
771 (build_capture_proxy): Rebuild the VLA.
772 * typeck.c (build_simple_component_ref): Split out from...
773 (build_ptrmemfunc_access_expr): ...here.
774 * tree.c (array_of_runtime_bound_p): New.
775 * init.c (throw_bad_array_length): New.
776 (build_vec_init): Use it.
777 * parser.c (cp_convert_range_for): When iterating over a VLA,
778 use it directly rather than bind a reference.
779 * cp-tree.h: Declare new functions.
781 2013-05-08 Jason Merrill <jason@redhat.com>
783 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
784 variably_modified_type_p.
785 (expand_start_catch_block): Mark the typeinfo used here.
786 * semantics.c (finish_handler_parms): Not here.
788 * error.c (dump_type_suffix): Try harder on VLA length.
791 * init.c (throw_bad_array_new_length): New.
792 (build_new_1): Use it. Don't warn about braced-init-list.
793 (build_vec_init): Use it.
794 * call.c (build_operator_new_call): Use it.
797 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
798 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
799 * error.c (maybe_warn_cpp0x): s/0x/11/.
801 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
804 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
807 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
809 * typeck.c (cp_build_binary_op): Call save_expr before
810 build_vector_from_val.
812 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
815 * decl.c (cp_finish_decl): After do_auto_deduction copy the
816 qualifers with cp_apply_type_quals_to_decl.
818 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
820 * pt.c (convert_nontype_argument): Add missing whitespace in
823 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
826 * decl.c (build_enumerator): Improve error message.
828 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
831 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
832 messages for template types and fix column numbers.
834 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
837 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
838 c_inhibit_evaluation_warnings around build_x_modify_expr call.
840 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
843 * semantics.c (finish_decltype_type): Handle instantiated template
846 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
849 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
851 2013-04-26 Jakub Jelinek <jakub@redhat.com>
853 * error.c (cp_print_error_function): Adjust file_name_as_prefix
856 2013-04-25 Jason Merrill <jason@redhat.com>
859 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
862 * init.c (perform_member_init): Call reshape_init.
864 2013-04-24 Jason Merrill <jason@redhat.com>
867 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
869 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
871 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
872 pedwarn to simply use OPT_Wpointer_arith.
873 (cp_build_unary_op): Likewise.
875 2013-04-24 Jason Merrill <jason@redhat.com>
877 N3648: init-captures are named.
878 * semantics.c (add_capture): Don't prepend "__" to init-captures.
879 (build_capture_proxy): Adjust.
880 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
882 N3648: Allow braced and parenthesized initializers.
883 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
884 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
885 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
886 (add_capture): Collapse a parenthesized initializer into a single
888 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
890 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
893 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
894 * semantics.c (finish_qualified_id_expr): Likewise.
895 (finish_id_expression): Update.
896 * typeck.c (cp_build_addr_expr_1): Likewise.
897 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
898 * cp-tree.h: Update declarations.
900 2013-04-22 Jason Merrill <jason@redhat.com>
903 * parser.c (cp_parser_unqualified_id): Handle ~auto.
904 (cp_parser_pseudo_destructor_name): Likewise.
905 (cp_parser_postfix_dot_deref_expression): Adjust.
906 (cp_lexer_nth_token_is_keyword): New.
907 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
908 * typeck.c (lookup_destructor): Handle ~auto.
910 * pt.c (fn_type_unification): Push tinst level around
911 type_unification_real if we aren't explaining.
912 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
913 * error.c (dump_function_decl): Respect it.
914 (subst_to_string): Pass it.
917 * rtti.c (get_typeid): Diagnose qualified function type.
918 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
920 * error.c (dump_aggr_type): Fix lambda detection.
921 (dump_simple_decl): Pretty-print capture field.
924 * cvt.c (build_expr_type_conversion): Two conversions that return
925 the same type aren't necessarily ambiguous.
928 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
929 pedwarn unconditional except in C++1y mode.
931 * semantics.c (potential_constant_expression_1): Don't crash on
935 * semantics.c (finish_id_expression): Reject capture of anonymous
939 * decl2.c (check_default_args): Check for pack expansion.
941 * mangle.c (write_type): Mangle decltype(auto).
943 2013-04-19 Jason Merrill <jason@redhat.com>
945 N3638 changes to return type deduction
946 * decl.c (undeduced_auto_decl): New.
947 (require_deduced_type): New.
948 (fndecl_declared_return_type): New.
949 (decls_match): Use it.
950 (duplicate_decls): Don't check for auto return.
951 (grokdeclarator): Reject virtual auto.
952 * class.c (resolve_address_of_overloaded_function): Handle
953 auto function templates.
954 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
955 * cp-tree.h: Declare new fns.
956 * error.c (dump_function_decl): Use fndecl_declared_return_type.
957 * search.c (check_final_overrider): Likewise.
958 * pt.c (make_decltype_auto): New.
959 (do_auto_deduction): Require plain decltype(auto).
963 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
964 template specializations.
966 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
968 Implement n3599 - Literal operator templates for strings.
969 * parser.c (make_string_pack (tree value)): New function.
970 (cp_parser_userdef_string_literal (cp_token *)): Use it
971 to construct calls to character string literal operator templates.
972 (cp_parser_template_declaration_after_export): Check for new string
973 literal operator template parameter form.
975 2013-04-15 Jason Merrill <jason@redhat.com>
977 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
980 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
981 rather than a destructor name, it isn't an unqualified-name.
982 (tsubst_copy_and_build): Pass down decltype_flag to operator
986 * semantics.c (insert_capture_proxy): Just use index 1 in the
989 2013-04-12 Jakub Jelinek <jakub@redhat.com>
991 * error.c (cp_print_error_function,
992 print_instantiation_partial_context_line,
993 maybe_print_constexpr_context): Colorize locus strings.
995 2013-04-11 Jason Merrill <jason@redhat.com>
998 * parser.c (complain_flags): New.
999 (cp_parser_postfix_expression): Use it.
1000 (cp_parser_unary_expression): Likewise.
1001 (cp_parser_binary_expression): Likewise.
1002 (cp_parser_assignment_expression): Likewise.
1003 (cp_parser_expression): Likewise.
1004 (cp_parser_postfix_open_square_expression): Take decltype_p.
1005 (cp_parser_builtin_offsetof): Adjust.
1006 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
1007 * decl2.c (grok_array_decl): Add decltype_p parm.
1008 * cp-tree.h: Adjust prototype.
1009 * semantics.c (finish_unary_op_expr): Add complain parm.
1011 2013-04-11 Jakub Jelinek <jakub@redhat.com>
1014 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
1015 calling maybe_constant_value for C++98.
1017 2013-04-11 Jason Merrill <jason@redhat.com>
1020 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
1021 Strip references before checking WILDCARD_TYPE_P.
1023 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1025 * call.c (build_conditional_expr_1, build_over_call): Protect
1026 error calls with complain & tf_error.
1027 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
1028 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
1029 build_ptrmemfunc): Likewise.
1030 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
1032 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
1033 (convert_to_reference): Adjust.
1035 2013-04-11 Jason Merrill <jason@redhat.com>
1037 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
1038 local variables, look them up instead.
1039 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
1040 proxies and substitution in unevaluated context.
1041 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
1042 before the iterators.
1045 * pt.c (uses_deducible_template_parms): New.
1046 (deducible_array_bound, deducible_expression): New.
1047 (deducible_template_args): New.
1048 (unify_one_argument): Call uses_deducible_template_parms.
1050 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1053 * typeck2.c (build_m_component_ref): Protect error calls with
1054 (complain & tf_error).
1056 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1059 * parser.c (cp_parser_enum_specifier): Check for empty
1060 anonymous enums and anonymous scoped enums.
1062 2013-04-10 Jakub Jelinek <jakub@redhat.com>
1065 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
1066 first before calling maybe_constant_value for warn_for_div_by_zero
1067 or invalid shift count warning purposes.
1069 2013-04-09 Jason Merrill <jason@redhat.com>
1072 * rtti.c (build_typeid): Check the address of the argument
1073 rather than looking for an INDIRECT_REF.
1075 2013-04-04 Jason Merrill <jason@redhat.com>
1079 * typeck2.c (abstract_virtuals_error_sfinae): Disable
1080 complete_type again.
1082 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1085 * decl.c (validate_constexpr_redeclaration): Allow an explicit
1086 specialization to be different wrt the constexpr specifier.
1088 2013-04-06 Jason Merrill <jason@redhat.com>
1090 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
1093 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
1095 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
1096 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
1098 2013-04-03 Jason Merrill <jason@redhat.com>
1100 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
1101 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
1102 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
1104 * mangle.c (write_type): When writing a function type with
1105 function-cv-quals, don't add the unqualified type as a
1106 substitution candidate.
1108 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
1111 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
1114 2013-04-03 Jakub Jelinek <jakub@redhat.com>
1117 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
1118 from args to new_args.
1119 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
1120 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
1122 2013-04-02 Jason Merrill <jason@redhat.com>
1125 * mangle.c (write_function_type): Mangle ref-qualifier.
1126 (write_nested_name): Likewise.
1127 (canonicalize_for_substitution): Preserve ref-qualifier.
1128 (write_type): Likewise.
1131 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
1133 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
1135 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
1136 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
1137 (for_each_template_parm_r): Use TYPE_TI_ARGS.
1139 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
1141 * cp-tree.h (TAGGED_TYPE_P): Remove.
1142 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
1143 (TYPE_ANONYMOUS_P): Adjust.
1144 * call.c (build_new_op_1): Likewise.
1145 * class.c (find_abi_tags_r): Likewise.
1146 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
1147 type_is_deprecated): Likewise.
1148 * decl2.c (grokfield, min_vis_r): Likewise.
1149 * pt.c (get_template_info): Likewise.
1150 * tree.c (handle_abi_tag_attribute): Likewise.
1152 2013-04-01 Jason Merrill <jason@redhat.com>
1154 * semantics.c (maybe_constant_value): Check
1155 instantiation_dependent_expression_p.
1156 * pt.c (build_non_dependent_expr): Don't check it here.
1159 * init.c (build_new): Don't try to process an array initializer
1160 at template definition time.
1163 * typeck.c (finish_class_member_access_expr): Handle enum scope.
1166 * parser.c (cp_parser_range_for): Don't try to do auto deduction
1167 in a template if the type of the range is incomplete.
1169 * call.c (add_function_candidate): Take the address of 'this' here.
1170 (build_over_call): And here.
1171 (build_new_method_call_1, build_op_call_1): Not here.
1172 (build_user_type_conversion_1): Or here.
1173 (add_candidates): Adjust.
1175 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
1176 * class.c (same_signature_p): Use type_memfn_quals.
1177 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
1178 FUNCTION_OR_METHOD_TYPE_CHECK.
1179 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
1180 * pt.c (unify): Use static_fn_type.
1182 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
1183 Jason Merrill <jason@redhat.com>
1185 Implement N2439 (ref-qualifiers for 'this')
1186 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
1187 (FUNCTION_RVALUE_QUALIFIED): New.
1188 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
1189 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
1190 (cp_ref_qualifier): New enum.
1191 (cp_declarator): Add ref_qualifier.
1192 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
1193 (cp_parser_direct_declarator): Use it.
1194 (make_call_declarator): Adjust.
1195 (cp_parser_lambda_declarator_opt): Adjust.
1196 * call.c (add_function_candidate): Handle ref-qualifier overload
1197 resolution semantics.
1198 (standard_conversion): Adjust.
1199 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
1200 * decl.c (grokdeclarator): Handle ref-qualifiers.
1201 (grokfndecl): Check for invalid ref-qualifiers.
1202 (static_fn_type, revert_static_member_fn): Adjust.
1203 * decl2.c (build_memfn_type): Handle ref-qualifiers.
1204 (check_classfn): Check them.
1205 (cp_reconstruct_complex_type): Retain them.
1206 * error.c (dump_ref_qualifier): New.
1207 (dump_type_suffix, dump_function_decl): Use it.
1208 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
1209 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
1210 (unify): Retain them.
1211 * tree.c (cp_check_qualified_type): New.
1212 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
1213 (build_ref_qualified_type): New.
1214 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
1215 (cp_build_type_attribute_variant): Keep ref-qualifier.
1216 * typeck.c (merge_types): Keep ref-qualifier.
1217 (structural_comptypes): Compare ref-qualifier.
1218 (type_memfn_rqual): New.
1219 (apply_memfn_quals): Take ref-qual argument.
1220 * typeck2.c (build_m_component_ref): Check ref-qualifier.
1222 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1224 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
1225 (DECL_FUNCTION_TEMPLATE_P): Adjust.
1227 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
1228 pp_cxx_qualified_id): Use get_containing_scope.
1229 * parser.c (cp_parser_class_head): Likewise.
1230 * pt.c (push_template_decl_real): Likewise.
1232 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
1233 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
1235 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
1237 * decl2.c (collect_candidates_for_java_method_aliases): Use
1239 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
1240 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
1241 * decl.c (duplicate_decls): Likewise.
1242 * parser.c (cp_parser_template_declaration_after_export): Likewise,
1243 also DECL_DECLARES_TYPE_P.
1244 * pt.c (instantiate_class_template_1): Likewise.
1245 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
1246 (lookup_field_r): Likewise.
1247 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
1248 (lookup_fnfields_slot_nolazy): Likewise.
1249 * semantics.c (finish_member_declaration): Likewise.
1250 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
1252 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
1254 * pt.c (template_parms_to_args): Fix typo in comment.
1256 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
1258 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
1260 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
1262 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
1263 (build_op_call_1): Likewise.
1264 (build_over_call): Likewise.
1265 (compare_ics): Likewise.
1266 * class.c (build_base_path): Likewise.
1267 (resolve_address_of_overloaded_function): Likewise.
1268 * cp-tree.h: Likewise.
1269 * cvt.c (cp_convert_to_pointer): Likewise.
1270 (convert_to_reference): Likewise.
1271 (ocp_convert): Likewise.
1272 (convert_force): Likewise, tidy.
1273 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
1274 (pp_cxx_ptr_operator): Likewise.
1275 * decl.c (duplicate_decls): Likewise.
1276 (start_decl): Likewise.
1277 (grok_op_properties): Likewise.
1278 (start_preparsed_function): Likewise.
1279 (store_parm_decls): Likewise.
1280 (finish_function): Likewise.
1281 * decl2.c (delete_sanity): Likewise.
1282 (acceptable_java_type): Likewise.
1283 (grokbitfield): Likewise.
1284 (cp_reconstruct_complex_type): Likewise.
1285 * error.c (dump_type_prefix): Likewise.
1286 (dump_expr): Likewise.
1287 * except.c (push_eh_cleanup): Likewise.
1288 (complete_ptr_ref_or_void_ptr_p): Likewise.
1289 (can_convert_eh): Likewise.
1290 * init.c (build_new_1): Likewise.
1291 (build_delete): Likewise.
1292 (build_vec_delete): Likewise.
1293 * mangle.c (write_type): Likewise.
1294 * parser.c (lookup_literal_operator): Likewise.
1295 * pt.c (convert_nontype_argument_function): Likewise.
1296 (convert_nontype_argument): Likewise.
1299 (dependent_type_p_r): Likewise.
1300 * rtti.c (build_headof): Likewise.
1301 (build_typeid): Likewise.
1302 (build_dynamic_cast_1): Likewise.
1303 (target_incomplete_p): Likewise.
1304 (typeinfo_in_lib_p): Likewise.
1305 * semantics.c (finish_omp_for): Likewise.
1306 (cxx_eval_call_expression): Likewise.
1307 (maybe_resolve_dummy): Likewise.
1308 * tree.c (build_target_expr): Likewise.
1309 (cp_build_qualified_type_real): Likewise.
1310 * typeck.c (composite_pointer_type_r): Likewise.
1311 (composite_pointer_type): Likewise.
1312 (comp_except_types): Likewise.
1313 (cxx_sizeof_nowarn): Likewise.
1314 (string_conv_p): Likewise.
1315 (cp_build_array_ref): Likewise.
1316 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
1317 (pointer_diff): Likewise.
1318 (cp_build_addr_expr_1): Likewise.
1319 (cp_build_unary_op): Likewise.
1320 (build_static_cast_1): Likewise.
1321 (cp_build_c_cast): Likewise.
1322 (comp_ptr_ttypes_real): Likewise.
1323 (ptr_reasonably_similar): Likewise.
1324 (comp_ptr_ttypes_const): Likewise.
1325 (casts_away_constness): Likewise.
1326 (check_literal_operator_args): Likewise.
1327 * typeck2.c (build_x_arrow): Likewise.
1328 (add_exception_specifier): Likewise.
1330 2013-03-29 Jason Merrill <jason@redhat.com>
1333 * cp-tree.h (AUTO_IS_DECLTYPE): New.
1334 * parser.c (cp_parser_decltype): Handle decltype(auto).
1335 (cp_parser_type_id_1): Allow auto without a late-specified
1337 (cp_parser_primary_expression): Use the return value of
1338 finish_parenthesized_expr.
1339 (cp_parser_transaction_expression): Likewise.
1340 * semantics.c (force_paren_expr): New.
1341 (finish_parenthesized_expr): Use it.
1342 * call.c (build_conditional_expr_1): Likewise.
1343 * pt.c (do_auto_deduction): Handle decltype(auto).
1344 (tsubst_copy): Handle PAREN_EXPR.
1345 (tsubst_copy_and_build): Likewise.
1346 * error.c (dump_expr): Handle PAREN_EXPR.
1347 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
1348 * mangle.c (write_expression): Ignore PAREN_EXPR.
1350 * parser.c (cp_parser_decltype_expr): Split out...
1351 (cp_parser_decltype): ...from here.
1355 * pt.c (unify_pack_expansion): Fix indexing.
1357 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
1359 * call.c (build_java_interface_fn_ref): Likewise.
1360 (make_temporary_var_for_ref_to_temp): Likewise.
1361 * class.c (check_field_decls): Likewise.
1362 (layout_class_type): Likewise.
1363 (finish_struct_1): Likewise.
1364 (fixed_type_or_null): Likewise.
1365 (get_vtbl_decl_for_binfo): Likewise.
1366 * cp-gimplify.c (omp_var_to_track): Likewise.
1367 (cp_genericize_r): Likewise.
1368 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
1369 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
1370 (DECL_DISCRIMINATOR_P): Likewise.
1371 * decl.c (poplevel): Likewise.
1372 (decls_match): Likewise.
1373 (duplicate_decls): Likewise.
1374 (decl_jump_unsafe): Likewise.
1375 (start_decl): Likewise.
1376 (check_for_uninitialized_const_var): Likewise.
1377 (make_rtl_for_nonlocal_decl): Likewise.
1378 (cp_finish_decl): Likewise.
1379 (expand_static_init): Likewise.
1380 (local_variable_p): Likewise.
1381 (maybe_register_incomplete_var): Likewise.
1382 * decl2.c (grokfield): Likewise.
1383 (comdat_linkage): Likewise.
1384 (determine_visibility): Likewise.
1385 (import_export_decl): Likewise.
1386 (prune_vars_needing_no_initialization): Likewise.
1387 (decl_maybe_constant_var_p): Likewise.
1388 * error.c (dump_simple_decl): Likewise.
1389 (dump_template_decl): Likewise.
1390 (cp_printer): Likewise.
1391 * except.c (build_throw): Likewise.
1392 * init.c (build_vtbl_address): Likewise.
1393 (member_init_ok_or_else): Likewise.
1394 (build_aggr_init): Likewise.
1395 (expand_aggr_init_1): Likewise.
1396 (build_offset_ref): Likewise.
1397 (constant_value_1): Likewise.
1398 * mangle.c (write_mangled_name): Likewise.
1399 (write_prefix): Likewise.
1400 * name-lookup.c (supplement_binding_1): Likewise.
1401 (add_decl_to_level): Likewise.
1402 (pushdecl_maybe_friend_1): Likewise.
1403 (check_for_out_of_scope_variable): Likewise.
1404 (validate_nonmember_using_decl): Likewise.
1405 (lookup_name_innermost_nonclass_level_1): Likewise.
1406 (lookup_arg_dependent_1): Likewise.
1407 * parser.c (cp_parser_lambda_introducer): Likewise.
1408 (cp_parser_template_argument): Likewise.
1409 (cp_parser_single_declaration): Likewise.
1410 * pt.c (convert_nontype_argument): Likewise.
1411 (instantiate_class_template_1): Likewise.
1412 (tsubst_decl): Likewise.
1413 (tsubst_expr): Likewise.
1414 (do_decl_instantiation): Likewise.
1415 (do_type_instantiation): Likewise.
1416 (regenerate_decl_from_template): Likewise.
1417 (always_instantiate_p): Likewise.
1418 (instantiate_decl): Likewise.
1419 (type_dependent_expression_p): Likewise.
1420 (build_non_dependent_expr): Likewise.
1421 * repo.c (repo_emit_p): Likewise.
1422 * rtti.c (build_dynamic_cast_1): Likewise.
1423 * search.c (shared_member_p): Likewise.
1424 * semantics.c (outer_var_p): Likewise.
1425 (finish_id_expression): Likewise.
1426 (finish_omp_clauses): Likewise.
1427 (finish_decltype_type): Likewise.
1428 (ensure_literal_type_for_constexpr_object): Likewise.
1429 * tree.c (lvalue_kind): Likewise.
1430 (bot_replace): Likewise.
1431 (cp_tree_equal): Likewise.
1432 (handle_init_priority_attribute): Likewise.
1433 (decl_storage_duration): Likewise.
1434 * typeck.c (cxx_sizeof_expr): Likewise.
1435 (cxx_alignof_expr): Likewise.
1436 (decay_conversion): Likewise.
1437 (build_class_member_access_expr): Likewise.
1438 (cp_build_array_ref): Likewise.
1439 (cxx_mark_addressable): Likewise.
1440 (maybe_warn_about_returning_address_of_local): Likewise.
1441 (check_return_expr): Likewise.
1442 * typeck2.c (cxx_readonly_error): Likewise.
1443 (abstract_virtuals_error_sfinae): Likewise.
1444 (cxx_incomplete_type_diagnostic): Likewise.
1446 2013-03-28 Lawrence Crowl <crowl@google.com>
1449 (CXX_PARSER_H): Add header dependence.
1451 (extern debug (cp_binding_level &)): New.
1452 (extern debug (cp_binding_level *)): New.
1454 (debug (cp_binding_level &)): New.
1455 (debug (cp_binding_level *)): New.
1457 (debug (cp_parser &)): New.
1458 (debug (cp_parser *)): New.
1459 (debug (cp_token &)): New.
1460 (debug (cp_token *)): New.
1461 (debug (vec<cp_token, va_gc> &)): New.
1462 (debug (vec<cp_token, va_gc> *)): New.
1463 * parser.c: Add header dependence.
1464 (extern debug (cp_parser &)): New.
1465 (extern debug (cp_parser *)): New.
1466 (extern debug (cp_token &)): New.
1467 (extern debug (cp_token *)): New.
1468 (extern debug (vec<cp_token, va_gc> &)): New.
1469 (extern debug (vec<cp_token, va_gc> *)): New.
1471 2013-03-28 Jason Merrill <jason@redhat.com>
1475 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
1476 the type if tf_decltype is set.
1477 * pt.c (fn_type_unification): Add decltype_p parm.
1478 (get_bindings): Adjust.
1479 * cp-tree.h: Adjust.
1480 * class.c (resolve_address_of_overloaded_function): Adjust.
1481 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
1484 * parser.c (cp_parser_sizeof_pack): Split out from...
1485 (cp_parser_sizeof_operand): ...here. Require (id).
1488 * semantics.c (finish_this_expr): 'this' is an rvalue.
1489 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
1492 * semantics.c (finish_member_declaration): Don't push closure
1495 * name-lookup.c (pushdecl_maybe_friend_1): Use
1496 nonlambda_method_basetype and current_nonlambda_class_type.
1499 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
1500 conversion from integer to pointer.
1501 (cxx_eval_constant_expression): Likewise.
1502 (cxx_eval_indirect_ref): Use the folded operand if we still think
1503 this might be constant.
1505 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1506 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1509 * call.c (convert_like_real): Change series of two permerrors
1510 to permerror + inform (and likewise for two errors).
1511 (build_new_method_call_1): Likewise.
1512 * typeck.c (convert_for_initialization): Change additional
1513 warning or error to inform.
1515 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1517 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
1518 (first_aggr_init_expr): Likewise.
1519 (more_aggr_init_expr_args_p): Likewise.
1520 (type_of_this_parm): Likewise.
1521 (class_of_this_parm): Likewise.
1522 * name-lookup.h (get_global_value_if_present): Likewise.
1523 (is_typename_at_global_scope): Likewise.
1525 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1527 * call.c (joust): Don't call inform for a permerror returning false.
1528 * parser.c (cp_parser_check_class_key): Likewise.
1529 * pt.c (tsubst_copy_and_build): Likewise.
1531 2013-03-27 Jason Merrill <jason@redhat.com>
1534 * semantics.c (finish_qualified_id_expr): Return early
1537 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1539 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1540 * cvt.c (convert_to_void): Likewise.
1541 * error.c (dump_expr): Likewise.
1542 * mangle.c (write_expression): Likewise.
1543 * parser.c (cp_parser_template_argument): Likewise.
1544 * pt.c (convert_nontype_argument): Likewise.
1545 (tsubst_copy_and_build): Likewise.
1546 * rtti.c (build_typeid): Likewise.
1547 * semantics.c (finish_call_expr): Likewise.
1548 (finish_decltype_type): Likewise.
1549 (build_data_member_initialization): Likewise.
1550 * tree.c (is_dummy_object): Likewise.
1551 * typeck.c (decay_conversion): Likewise.
1552 (build_class_member_access_expr): Likewise.
1553 (cp_build_addr_expr_1): Likewise.
1554 (unary_complex_lvalue): Likewise.
1555 (check_return_expr): Likewise.
1556 * typeck2.c (cxx_readonly_error): Likewise.
1558 2013-03-26 Jason Merrill <jason@redhat.com>
1561 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
1562 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
1563 * cp-tree.h: Adjust prototype.
1566 * typeck2.c (build_m_component_ref): Handle prvalue object.
1568 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1570 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
1571 * decl.c (duplicate_decls): Likewise.
1572 (cp_finish_decl): Likewise.
1573 (check_class_member_definition_namespace): Likewise.
1574 * decl2.c (grokfield): Likewise.
1575 (decl_needed_p): Likewise.
1576 (import_export_decl): Likewise.
1577 (mark_used): Likewise.
1578 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1579 * pt.c (push_access_scope): Likewise.
1580 (instantiate_decl): Likewise.
1581 * ptree.c (cxx_print_decl): Likewise.
1582 * repo.c (repo_emit_p): Likewise.
1583 * semantics.c (note_decl_for_pch): Likewise.
1584 * tree.c (decl_linkage): Likewise.
1586 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1589 * decl.c (check_array_designated_initializer): Handle CONST_DECL
1592 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1594 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1597 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1599 2013-03-25 Jason Merrill <jason@redhat.com>
1602 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1603 class is derived from the type of the object.
1606 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1607 unevaluated context.
1609 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
1612 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1613 DECL_TEMPLATE_INSTANTIATION.
1615 2013-03-22 Jason Merrill <jason@redhat.com>
1618 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1621 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
1623 * cp-tree.h (identifier_p): New.
1624 * call.c: Throughout, call identifier_p insstead of direct
1625 comparaison of TREE_CODE against IDENTIFIER_NODE.
1626 * decl.c: Likewisse.
1627 * decl2.c: Likewise.
1629 * mangle.c: Likewise.
1630 * name-lookup.c: Likewise.
1631 * parser.c: Likewise.
1633 * search.c: Likewise.
1634 * semantics.c: Likewise.
1636 * typeck.c: Likewise.
1637 * typeck2.c: Likewise.
1639 2013-03-21 Jakub Jelinek <jakub@redhat.com>
1642 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1643 * call.c (build_temp): Likewise.
1644 * method.c (synthesize_method): Likewise.
1645 * typeck.c (convert_for_initialization): Likewise.
1647 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
1649 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
1651 2013-03-21 Richard Biener <rguenther@suse.de>
1653 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
1654 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
1656 2013-03-20 Jason Merrill <jason@redhat.com>
1659 * parser.c (cp_parser_late_return_type_opt): Save and restore
1660 current_class_ptr/ref.
1663 * expr.c (cplus_expand_constant): Do nothing if the class is
1665 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1666 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1667 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1668 (complete_vars): Likewise.
1670 * name-lookup.c (get_anonymous_namespace_name): Never use
1671 get_file_function_name.
1673 * pt.c (retrieve_specialization): Handle null tmpl argument.
1677 * pt.c (tsubst_decl): Check return value of register_specialization.
1678 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1681 2013-03-17 Jason Merrill <jason@redhat.com>
1685 * parser.c (cp_parser_direct_declarator): Bail if we see a
1686 qualified-id not at namespace scope.
1690 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1693 2013-03-16 Jason Merrill <jason@redhat.com>
1695 * decl.c (grokdeclarator): Assert that we won't see a pointer to
1699 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1700 (MAYBE_CLASS_TYPE_P): ...here.
1701 * semantics.c (lambda_capture_field_type): Only build a
1702 magic decltype for wildcard types.
1703 (lambda_proxy_type): Likewise.
1704 (finish_non_static_data_member): Get the quals from
1708 * parser.c (cp_parser_template_argument): Don't
1709 fold_non_dependent_expr.
1711 * parser.c (cp_parser_lambda_declarator_opt): Use
1712 cp_parser_trailing_type_id.
1715 * parser.c (cp_parser_template_id): Don't forget access checks.
1718 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1722 * name-lookup.h (tag_scope): Add ts_lambda.
1723 * semantics.c (begin_lambda_type): Use it.
1724 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1725 * pt.c (check_default_tmpl_args): Ignore lambdas.
1726 (push_template_decl_real): Handle lambdas.
1727 * tree.c (no_linkage_check): Adjust lambda check.
1730 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1733 * parser.c (cp_parser_direct_declarator): Fix late return
1734 for out-of-class defn of member function.
1737 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1738 parms to avoid duplicate -Wshadow warnings.
1740 * search.c (lookup_base): Handle NULL_TREE.
1743 * semantics.c (potential_constant_expression_1): Use of 'this' in
1744 a non-constexpr function makes the expression not potentially
1749 * cp-tree.h (tsubst_flags): Add tf_decltype.
1750 * call.c (build_cxx_call): Don't build a temporary if it's set.
1751 (build_over_call): Make sure it's only passed to build_cxx_call.
1752 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1753 (cp_parser_unary_expression): Likewise.
1754 (cp_parser_cast_expression): Likewise.
1755 (cp_parser_binary_expression): Likewise.
1756 (cp_parser_assignment_expression): Likewise.
1757 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
1758 (cp_parser_expression): Add decltype_p. Force a
1759 temporary for a call on the LHS of a comma.
1760 (cp_parser_decltype): Pass true to decltype_p parms.
1761 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1762 (tsubst_copy_and_build): Pass tf_decltype down only for
1763 CALL_EXPR and the RHS of COMPOUND_EXPR.
1764 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1766 * cp-tree.h (abstract_class_use): New enum.
1767 * typeck2.c (pending_abstract_type): Add use field.
1768 (abstract_virtuals_error_sfinae): Add overloads taking
1769 abstract_class_use instead of tree.
1770 * typeck.c (build_static_cast_1): Call it.
1771 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1772 * pt.c: Adjust calls.
1773 * decl.c (cp_finish_decl): Don't handle functions specially.
1774 (grokdeclarator): Always check return type.
1775 * init.c (build_new_1): Adjust call.
1779 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1780 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1783 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1784 (tsubst_arg_types): Likewise.
1788 * call.c (convert_like_real): Check for explicit constructors
1789 even for value-initialization.
1792 * pt.c (convert_nontype_argument): Handle invalid pointer.
1794 * parser.c (cp_parser_lambda_expression): Use nreverse.
1798 * pt.c (instantiate_class_template_1): Instantiate lambda capture
1800 (tsubst_copy_and_build): Not here.
1803 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1806 * parser.c (parsing_nsdmi): New.
1807 * semantics.c (outer_automatic_var_p): Check it.
1808 (finish_id_expression): Likewise.
1809 * cp-tree.h: Declare it.
1812 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1814 * parser.c (lookup_literal_operator): Correct parm/arg naming
1818 * pt.c (fold_non_dependent_expr_sfinae): Check
1819 instantiation_dependent_expression_p.
1822 * class.c (resolve_address_of_overloaded_function): Accept a
1823 reference to function for target_type.
1824 (instantiate_type): Likewise.
1825 * pt.c (convert_nontype_argument): Pass it to
1826 convert_nontype_argument_function.
1828 2013-03-16 Jakub Jelinek <jakub@redhat.com>
1830 * tree.c (cp_tree_equal): Fix a pasto.
1833 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1834 pass op1 through maybe_constant_value first.
1836 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
1839 * semantics.c (cxx_eval_array_reference): Check for negative index.
1841 2013-03-14 Jason Merrill <jason@redhat.com>
1844 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1847 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1848 dso_handle parm on targets without __cxa_atexit.
1850 2013-03-11 Jason Merrill <jason@redhat.com>
1853 * typeck.c (check_return_expr): Disallow returning init list here.
1854 * semantics.c (apply_deduced_return_type): Not here.
1856 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1859 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1860 * error.c (dump_expr): Likewise.
1862 2013-03-08 Jason Merrill <jason@redhat.com>
1865 * class.c (modify_all_vtables): Mangle the vtable name before
1868 * semantics.c (lambda_expr_this_capture): In unevaluated context,
1869 just return the nearest 'this'.
1874 * tree.c (maybe_dummy_object): Don't capture 'this'.
1875 * semantics.c (maybe_resolve_dummy): New.
1876 (finish_non_static_data_member): Use it.
1877 (finish_qualified_id_expr): Don't test is_dummy_object.
1878 * cp-tree.h: Declare maybe_resolve_dummy.
1879 * call.c (build_new_method_call_1): Use it.
1882 * semantics.c (apply_deduced_return_type): Don't allow returning
1883 std::initializer_list.
1885 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1888 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1889 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1890 * decl.c (check_elaborated_type_specifier): Tidy.
1892 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1895 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1897 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1899 * parser.c (cp_parser_braced_list): For {} initialize
1900 *non_constant_p to false.
1902 2013-03-04 Jason Merrill <jason@redhat.com>
1906 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1907 and non-class scopes.
1909 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1911 * decl.c (grokdeclarator): Remove dead code.
1913 2013-02-28 Jason Merrill <jason@redhat.com>
1916 * semantics.c (potential_constant_expression_1): Use
1917 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1920 * call.c (build_over_call): Avoid virtual lookup in a template.
1922 2013-02-27 Jason Merrill <jason@redhat.com>
1926 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1927 of the base name for inheriting ctors.
1928 (push_class_level_binding_1): Remove inheriting ctor handling.
1929 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1930 * class.c (add_implicitly_declared_members): Adjust.
1932 2013-02-26 David Binderman <dcb314@hotmail.com>
1935 * decl.c (grokdeclarator): Tidy publicp assignment.
1937 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1940 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1941 (build_transaction_expr): Same.
1943 2013-02-25 Jason Merrill <jason@redhat.com>
1946 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1947 we know what args we're looking at.
1950 * semantics.c (potential_constant_expression_1): In C++98, a cast
1951 to non-integral type can't be a constant expression.
1953 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1956 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1959 2013-02-22 Jason Merrill <jason@redhat.com>
1962 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1963 if we got the wrong number of template parms.
1966 * pt.c (fn_type_unification): Use explicit args in template
1967 instantiation context.
1970 * call.c (can_convert_arg): Discard access checks.
1973 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1976 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1979 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1980 * cvt.c (ocp_convert): Use the latter.
1981 (cp_convert_to_pointer): Likewise.
1982 * decl.c (check_default_argument): Likewise.
1983 * typeck.c (cp_build_binary_op): Likewise.
1984 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1986 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1987 Paolo Carlini <paolo.carlini@oracle.com>
1990 * decl2.c (grokbitfield): Allow scoped enumeration types.
1992 2013-02-15 Jason Merrill <jason@redhat.com>
1995 * semantics.c (finish_id_expression): Also return the identifier
1996 for an outer local static.
1999 * class.c (check_bases_and_members): Deduce noexcept after
2003 * semantics.c (finish_id_expression): In a template, return
2004 the identifier for a constant variable.
2006 2013-02-14 Jason Merrill <jason@redhat.com>
2009 * semantics.c (build_anon_member_initialization): New.
2010 (build_data_member_initialization): Use it.
2013 * decl.c (cp_finish_decl): Force instantiation of an
2014 auto static data member.
2017 * pt.c (unify): A pack expansion that is not the last template
2018 argument makes the entire template argument list non-deduced.
2021 * name-lookup.c (do_class_using_decl): Handle typedefs with
2022 inheriting constructors.
2023 (push_class_level_binding_1): Allow inheriting from template
2024 template parameter, too.
2025 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2028 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
2029 default argument scope.
2030 * mangle.c (write_name): Likewise.
2033 * error.c (find_typenames_r): Don't walk into a pack expansion.
2035 2013-02-13 Jason Merrill <jason@redhat.com>
2038 * parser.c (cp_parser_member_declaration): Check the declarator
2039 form when detecting a function declaration via typedef.
2042 * pt.c (maybe_process_partial_specialization): A lambda
2043 isn't what's being specialized.
2046 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
2050 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
2053 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
2054 non-zero offsets, too.
2057 * decl.c (build_enumerator): Always convert the value to a
2058 fixed underlying type.
2061 * pt.c (tsubst_copy_and_build): Don't forget any new
2062 captures that arose from use of dependent names.
2064 2013-02-13 Jakub Jelinek <jakub@redhat.com>
2067 * semantics.c (finish_asm_stmt): If input constraints allow
2068 neither register nor memory, try maybe_constant_value to get
2069 a constant if possible.
2071 2013-02-12 Jason Merrill <jason@redhat.com>
2074 * method.c (add_one_base_init): Handle base constructor
2075 taking rvalue reference parm.
2078 * semantics.c (sort_constexpr_mem_initializers): Handle
2081 2013-02-09 Jason Merrill <jason@redhat.com>
2084 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
2085 maybe_instantiate_noexcept.
2088 * pt.c (eq_specializations): Set comparing_specializations.
2089 * tree.c (cp_tree_equal): Check it.
2090 * cp-tree.h: Declare it.
2092 * decl.c (decls_match): Check versions later.
2095 * pt.c (build_non_dependent_expr): Don't try to fold
2096 instantiation-dependent expressions.
2097 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
2098 [BIND_EXPR]: Treat as dependent.
2100 2013-02-07 Jakub Jelinek <jakub@redhat.com>
2103 * init.c (build_vec_init): Don't append NULL values into new_vec.
2104 (build_zero_init_1): Don't push anything into v if recursive call
2106 (build_value_init_noctor): Don't push anything into v if
2107 build_value_init call returned NULL_TREE.
2110 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
2111 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
2112 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
2113 return true only if 2nd token isn't CPP_CLOSE_PAREN.
2114 (cp_parser_cast_expression): Adjust caller.
2117 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
2118 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
2119 DECL_LANG_SPECIFIC (t).
2121 2013-02-07 Jason Merrill <jason@redhat.com>
2124 * method.c (do_build_copy_constructor): Don't bother turning
2125 scalars from lvalues to xvalues.
2126 (do_build_copy_assign): Likewise.
2128 2013-02-06 Jason Merrill <jason@redhat.com>
2130 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
2132 2013-02-05 Jason Merrill <jason@redhat.com>
2135 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
2139 * decl.c (start_preparsed_function): Update restype if we change
2143 * pt.c (fn_type_unification): Discard any access checks from
2144 substituting explicit args.
2146 2013-01-31 Jason Merrill <jason@redhat.com>
2150 * typeck.c (get_member_function_from_ptrfunc): Fix
2151 ptrmemfunc_vbit_in_delta case.
2153 2013-01-29 Jason Merrill <jason@redhat.com>
2156 * class.c (build_ctor_vtbl_group): Give construction vtables
2159 2013-01-25 Jason Merrill <jason@redhat.com>
2162 * pt.c (convert_nontype_argument_function): Handle invalid input.
2163 (convert_nontype_argument): Likewise.
2166 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
2167 dynamic type has no virtual functions.
2169 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
2172 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
2173 on TARGET_EXPR nodes.
2175 2013-01-22 Jason Merrill <jason@redhat.com>
2178 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
2180 2013-01-22 Dodji Seketeli <dodji@redhat.com>
2183 * pt.c (argument_pack_element_is_expansion_p)
2184 (make_argument_pack_select, use_pack_expansion_extra_args_p)
2185 (gen_elem_of_pack_expansion_instantiation): New static functions.
2186 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
2187 look through the possibly resulting pack expansion as well.
2188 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
2189 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
2190 Use gen_elem_of_pack_expansion_instantiation to build the
2191 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
2192 as gen_elem_of_pack_expansion_instantiation and the change in
2193 tsubst above generalize this particular case.
2194 (arg_from_parm_pack_p): Remove this for it's not used by
2195 tsubst_pack_expansion anymore.
2197 2013-01-21 Jason Merrill <jason@redhat.com>
2200 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
2201 template args count.
2203 2013-01-18 Jason Merrill <jason@redhat.com>
2206 * decl2.c (get_local_tls_init_fn): New.
2207 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
2208 with aliases for internal variables. Don't use weakrefs if
2209 the variable needs destruction.
2210 (generate_tls_wrapper): Mark the wrapper as const if no
2211 initialization is needed.
2212 (handle_tls_init): Don't require aliases.
2214 2013-01-15 Dodji Seketeli <dodji@redhat.com>
2217 * pt.c (coerce_innermost_template_parms): New static function.
2218 (instantiate_alias_template): Use it here.
2220 2013-01-09 Jason Merrill <jason@redhat.com>
2223 * rtti.c (build_typeid, get_typeid): Add complain parm.
2224 (get_tinfo_decl_dynamic): Likewise.
2225 * cp-tree.h, parser.c, pt.c: Adjust.
2228 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
2231 2013-01-09 Jakub Jelinek <jakub@redhat.com>
2234 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
2235 call maybe_constant_value for the negative or too big shift
2238 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
2241 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
2242 of the argument is true.
2244 2013-01-08 Joel Brobecker <brobecker@adacore.com>
2246 * parser.c (cp_parser_initializer_list): Move declaration
2247 of variable non_const to start of lexical block.
2249 2013-01-07 Jason Merrill <jason@redhat.com>
2252 * tree.c (build_aggr_init_expr): Do nothing in a template.
2253 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
2254 a FUNCTION_DECL before tsubsting.
2256 2013-01-04 Dodji Seketeli <dodji@redhat.com>
2259 * pt.c (check_instantiated_arg): Allow type template arguments.
2261 2013-01-04 Jason Merrill <jason@redhat.com>
2264 * decl.c (reset_type_linkage, bt_reset_linkage): New.
2265 (grokdeclarator): Use reset_type_linkage.
2266 * name-lookup.c (binding_table_foreach): Handle null table.
2267 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
2269 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2271 PR c++/54526 (again)
2272 * parser.c (cp_parser_template_id): Revert core of previous change
2273 (keep adjusted inform message).
2275 2013-01-03 Jason Merrill <jason@redhat.com>
2279 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
2283 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
2286 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
2289 * call.c (type_has_extended_temps): New.
2290 * cp-tree.h: Declare it.
2291 * decl.c (check_initializer): Use build_aggr_init for arrays
2293 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
2295 2013-01-02 Jason Merrill <jason@redhat.com>
2298 * call.c (build_new_method_call_1): Don't use build_value_init for
2299 user-provided default constructors.
2301 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
2305 * tree.c (build_cplus_array_type): Copy layout information
2306 to main variant if necessary.
2308 Copyright (C) 2013 Free Software Foundation, Inc.
2310 Copying and distribution of this file, with or without modification,
2311 are permitted in any medium without royalty provided the copyright
2312 notice and this notice are preserved.