1 2013-11-15 Aldy Hernandez <aldyh@redhat.com>
3 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Depend on cp/cp-cilkplus.o.
4 * cp-cilkplus.c: New file.
5 * cp-tree.h (cpp_validate_cilk_plus_loop): Protoize.
6 * parser.c (cp_parser_cilk_simd): New.
7 (cp_debug_parser): Add case for IN_CILK_SIMD_FOR.
8 (cp_parser_jump_statement): Same.
9 (cp_parser_omp_for_cond): Add new argument.
11 (cp_parser_omp_for_loop): Pass new argument to
12 cp_parser_omp_for_cond.
13 Handle CILK_SIMD nodes.
14 Abstract initilization code to..
15 (cp_parser_omp_for_loop_init): ...here.
16 (cp_parser_pragma): Add case for PRAGMA_CILK_SIMD.
17 (cp_parser_cilk_simd_vectorlength): New.
18 (cp_parser_cilk_simd_linear): New.
19 (cp_parser_cilk_simd_clause_name): New.
20 (cp_parser_cilk_simd_all_clauses): New.
21 (cp_parser_cilk_simd): New.
22 * parser.h (IN_CILK_SIMD_FOR): New macro.
23 * pt.c (tsubst_expr): Add case for CILK_SIMD.
24 * typeck2.c (cxx_readonly_error): Pass location argument to
27 2013-11-14 Paolo Carlini <paolo.carlini@oracle.com>
30 * parser.c (cp_parser_late_parsing_nsdmi): Call
31 maybe_begin_member_template_processing.
32 * pt.c (maybe_begin_member_template_processing): Handle NSDMIs.
33 (inline_needs_template_parms): Adjust.
35 2013-11-14 Andrew MacLeod <amacleod@redhat.com>
37 * class.c: Include only gimplify.h and gimple.h as needed.
38 * cp-gimplify.c: Likewise.
41 * optimize.c: Likewise.
43 * semantics.c: Likewise.
45 * vtable-class-hierarchy.c: Likewise.
47 2013-11-12 Andrew MacLeod <amacleod@redhat.com>
49 * class.c: Include gimplify.h.
50 * cp-gimplify.c: Likewise.
53 * optimize.c: Likewise.
55 * semantics.c: Likewise.
57 * vtable-class-hierarchy.c: Likewise.
58 * decl2.c: Don't include gimple.h.
60 * method.c: Include pointer-set.h instead of gimple.h.
62 2013-11-12 Adam Butcher <adam@jessamine.co.uk>
64 * pt.c (convert_generic_types_to_packs): New function to transform
65 a range of implicitly introduced non-pack template parms to be parameter
67 * cp-tree.h (convert_generic_types_to_packs): Declare.
68 * parser.c (cp_parser_parameter_declaration_list): If a function
69 parameter pack contains generic types, convert them to packs prior to
72 2013-11-12 Adam Butcher <adam@jessamine.co.uk>
79 * parser.h (struct cp_parser): New members implicit_template_parms,
80 implicit_template_scope and auto_is_implicit_function_template_parm_p.
81 * parser.c (add_implicit_template_parms): Refactor as ...
82 (synthesize_implicit_template_parm): ... this to append a new template
83 type parm to the current template parameter list (introducing a new list
84 if necessary). Removed push_deferring_access_checks.
85 (finish_fully_implicit_template): Removed pop_deferring_access_checks.
86 (cp_parser_new): Initialize new cp_parser members.
87 (cp_parser_parameter_declaration_clause): Consider auto as implicit
88 template parm when parsing a parameter declaration (unless parsing an
89 explicit specialization).
90 (cp_parser_parameter_declaration_list): Remove local
91 implicit_template_parms counter and reset cp_parser implicit template
93 (cp_parser_lambda_expression): Reset implicit template cp_parser members
94 whilst generating lambda class.
95 (cp_parser_function_definition_after_declarator): Reset implicit
96 template cp_parser members whilst parsing function definition.
97 (make_generic_type_name): Respell '<autoN>' as 'auto:N' which works
98 better with template diagnostics.
99 (cp_parser_simple_type_specifier): Synthesize implicit template parm on
100 parsing 'auto' if auto_is_implicit_function_template_parm_p and provide
102 * decl.c (grokdeclarator): ... that were previously done here.
104 2013-11-12 Paolo Carlini <paolo.carlini@oracle.com>
107 * pt.c (lookup_template_class_1): Handle alias template declarations
108 of enumeration types.
110 2013-11-10 Paolo Carlini <paolo.carlini@oracle.com>
112 * cvt.c (cp_convert_to_pointer): Call build_ptrmemfunc before
113 maybe_warn_zero_as_null_pointer_constant to avoid duplicate
114 -Wzero-as-null-pointer-constant diagnostics.
116 * typeck.c (build_ptrmemfunc): Use cp_build_c_cast.
118 2013-11-06 Paolo Carlini <paolo.carlini@oracle.com>
121 * init.c (build_new_1): Don't call build_java_class_ref on non-class
124 2013-11-05 Jason Merrill <jason@redhat.com>
127 * decl.c (check_initializer): Don't use build_vec_init for arrays
130 2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
133 * name-lookup.c (handle_namespace_attrs): Use get_attribute_name.
135 2013-11-05 Tobias Burnus <burnus@net-b.de>
137 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
138 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
139 cp_parser_omp_declare): Handle -fopenmp-simd.
141 2013-11-04 Eric Botcazou <ebotcazou@adacore.com>
143 * decl2.c (cpp_check): Change type of first parameter and deal with
146 2013-11-03 Paolo Carlini <paolo.carlini@oracle.com>
149 * parser.c (cp_parser_constructor_declarator_p): Check that the
150 class-name matches current_class_type.
152 2013-11-03 Marek Polacek <polacek@redhat.com>
154 * decl.c (cp_finish_decl): Move C++1y bounds checking...
155 (compute_array_index_type): ...here. Add VLA instrumentation.
156 Call stabilize_vla_size.
157 (grokdeclarator): Don't call stabilize_vla_size here.
159 2013-11-02 Paolo Carlini <paolo.carlini@oracle.com>
163 * parser.c (cp_parser_cast_expression): If we aren't looking at
164 a cast-expression don't call cp_parser_type_id.
165 (cp_parser_postfix_expression): Likewise for compound-literal.
166 (cp_parser_tokens_start_cast_expression): Adjust.
168 2013-11-01 Edward Smith-Rowland <3dw4rd@verizon.net>
171 * parser.c (make_string_pack): Discover non-const type and size
172 of character and build parm pack with correct type and chars.
174 2013-11-01 Trevor Saunders <tsaunders@mozilla.com>
176 * semantics.c (build_anon_member_initialization): Convert fields to be
179 2013-11-01 Marc Glisse <marc.glisse@inria.fr>
182 * pt.c (type_dependent_expression_p): Handle null argument.
184 2013-11-01 Jakub Jelinek <jakub@redhat.com>
186 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
187 check_dup_generic at the end, unless remove is true.
188 (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
191 2013-10-31 Jakub Jelinek <jakub@redhat.com>
193 * semantics.c (finish_omp_clauses): Diagnose aligned clause
194 with decl that is not pointer nor array nor reference to those.
196 2013-10-31 Jason Merrill <jason@redhat.com>
198 * semantics.c (cxx_eval_call_expression): Handle trivial
199 value-initialization.
200 * typeck2.c (store_init_value): Call maybe_constant_init after
203 * decl.c (cxx_maybe_build_cleanup): Always set LOOKUP_NONVIRTUAL.
204 * decl2.c (build_cleanup): Just call cxx_maybe_build_cleanup.
207 * parser.c (cp_parser_late_parse_one_default_arg): Set
208 TARGET_EXPR_DIRECT_INIT_P.
210 * class.c (type_build_ctor_call): Return early in C++98 mode.
211 (type_build_dtor_call): Likewise.
213 2013-10-31 Paolo Carlini <paolo.carlini@oracle.com>
217 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
220 * pt.c (most_specialized_class): Bump processing_template_decl for
223 2013-10-30 Paolo Carlini <paolo.carlini@oracle.com>
226 * call.c (build_over_call): Check return value of mark_used.
228 2013-10-30 Jason Merrill <jason@redhat.com>
230 * semantics.c (finish_compound_literal): Don't create a static variable
231 inside cp_unevaluated_operand.
233 * init.c (push_base_cleanups): Check ANON_AGGR_TYPE_P.
235 2013-10-30 Tobias Burnus <burnus@net-b.de>
238 * cp-tree.h (RANGE_FOR_IVDEP): Define.
239 (cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
240 finish_for_cond): Take 'bool ivdep' parameter.
241 * cp-array-notation.c (create_an_loop): Update call.
242 * init.c (build_vec_init): Ditto.
243 * pt.c (tsubst_expr): Ditto.
244 * parser.c (cp_parser_iteration_statement, cp_parser_for,
245 cp_parser_range_for, cp_convert_range_for): Update calls.
246 (cp_parser_pragma): Accept GCC ivdep for 'while' and 'do'.
247 * semantics.c (finish_while_stmt_cond, finish_do_stmt,
248 finish_for_cond): Optionally build ivdep annotation.
250 2013-10-30 Jason Merrill <jason@redhat.com>
252 * decl.c (cp_finish_decl): Never throw for VLA bound == 0.
254 2013-10-29 David Malcolm <dmalcolm@redhat.com>
256 Patch autogenerated by refactor_symtab.py from
257 https://github.com/davidmalcolm/gcc-refactoring-scripts
258 revision 58bb219cc090b2f4516a9297d868c245495ee622
260 * call.c (mark_versions_used): Update for conversion of symtab types
261 to a true class hierarchy.
262 * decl2.c (cp_write_global_declarations): Likewise.
263 (clear_decl_external): Likewise.
264 (build_java_method_aliases): Likewise.
265 (collect_candidates_for_java_method_aliases): Likewise.
266 (mark_needed): Likewise.
267 (var_finalized_p): Likewise.
268 (maybe_make_one_only): Likewise.
269 (maybe_emit_vtables): Likewise.
270 * lambda.c (maybe_add_lambda_conv_op): Likewise.
271 * method.c (use_thunk): Likewise.
272 * optimize.c (maybe_clone_body): Likewise.
273 * tree.c (cp_fix_function_decl_p): Likewise.
275 2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
278 * decl2.c (grokfield): Handle auto like NSDMI.
280 2013-10-25 Paolo Carlini <paolo.carlini@oracle.com>
283 * pt.c (check_template_shadow): Don't skip declarations in inline
286 2013-10-25 Tobias Burnus <burnus@net-b.de>
289 * parser.c (cp_parser_iteration_statement,
290 cp_parser_for, cp_parser_c_for, cp_parser_pragma): Handle
293 2013-10-24 Marek Polacek <polacek@redhat.com>
296 * typeck2.c (check_narrowing): Don't check narrowing when the scalar
297 initializer is empty.
299 2013-10-23 Jason Merrill <jason@redhat.com>
302 * method.c (defaulted_late_check): Delete on eh-spec mismatch.
303 (maybe_explain_implicit_delete): Explain it.
305 * error.c (eh_spec_to_string): New.
306 (cp_printer): Use it for %X.
308 In C++11 a trivial [cd]tor might not be callable.
309 * class.c (user_provided_p): A function deleted on its declation
310 in the class is not user-provided.
311 (type_build_ctor_call): Also force a ctor call if we
312 might have a deleted or private trivial ctor.
313 (type_build_dtor_call): New.
314 (deduce_noexcept_on_destructors): Remove obsolete code.
315 * cp-tree.h: Declare type_build_dtor_call.
316 * decl.c (expand_static_init): Make sure trivial dtors are callable.
317 (cxx_maybe_build_cleanup): Likewise.
318 * except.c (build_throw): Likewise.
319 * init.c (build_value_init): Handle trivial but not callable ctors.
320 (perform_target_ctor): Make sure trivial dtor is callable.
321 (perform_member_init): Likewise.
322 (expand_cleanup_for_base): Likewise.
323 (build_vec_delete_1): Likewise.
324 (build_delete): Likewise.
325 (push_base_cleanups): Likewise.
326 (build_new_1): Avoid redundant error.
327 * method.c (synthesized_method_walk): Can't ever exit early in C++11.
328 Always process the subobject destructor.
329 * semantics.c (finish_compound_literal): Make sure trivial dtor is
331 * typeck2.c (split_nonconstant_init): Likewise.
333 2013-10-23 Edward Smith-Rowland <3dw4rd@verizon.net>
335 Implement C++14 [[deprecated]] modulo [[gnu::deprecated]] bugs.
336 * parser.c (cp_parser_std_attribute): Interpret [[deprecated]]
337 as [[gnu::deprecated]].
339 2013-10-22 Paolo Carlini <paolo.carlini@oracle.com>
342 * pt.c (apply_late_template_attributes): Use get_attribute_name,
345 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
348 * pt.c (most_specialized_class): Bump processing_template_decl for
351 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
353 * parser.c (cp_parser_lookup_name): Tidy.
355 2013-10-17 Andrew MacLeod <amacleod@redhat.com>
357 * parser.c: Include omp-low.h.
358 * semantics.c: Likewise.
360 2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
363 * lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
364 cp_unevaluated_operand case.
366 2013-10-16 Jason Merrill <jason@redhat.com>
368 * pt.c (apply_late_template_attributes): Use
369 attribute_takes_identifier_p.
371 * error.c (dump_exception_spec): Print "noexcept" rather than
375 * pt.c (unify_array_domain): Split out from unify.
376 (unify): Use it for list deduction, too.
379 * decl2.c (dump_tu): Split out from...
380 (cp_write_global_declarations): ...here. Call it in PCH mode.
382 2013-10-16 Paolo Carlini <paolo.carlini@oracle.com>
384 * pt.c (tsubst): Fix typo in last commit.
386 2013-10-16 Paulo Matos <pmatos@broadcom.com>
388 * error.c (code_to_string): Use new wrapper get_tree_code_name.
389 * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
390 * pt.c (tsubst): Likewise.
391 * semantics.c (cxx_eval_constant_expression,
392 potential_constant_expression_1): Likewise.
393 * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
394 add_substitution, find_substitution): Likewise.
396 2013-10-15 Paolo Carlini <paolo.carlini@oracle.com>
399 * parser.c (cp_parser_postfix_open_square_expression): Set
400 parser->greater_than_is_operator_p for the argument.
402 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
405 * parser.c (cp_parser_commit_to_topmost_tentative_parse): New.
406 (cp_parser_pseudo_destructor_name): Use it.
408 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
411 * pt.c (convert_nontype_argument): Set expr_type to
412 TREE_TYPE (probe_type).
414 2013-10-11 Jakub Jelinek <jakub@redhat.com>
416 * decl.c (duplicate_decls): Error out for redeclaration of UDRs.
417 (declare_simd_adjust_this): New function.
418 (grokfndecl): If "omp declare simd" attribute is present,
419 call declare_simd_adjust_this if needed and
420 c_omp_declare_simd_clauses_to_numbers.
421 * cp-array-notation.c (expand_array_notation_exprs): Handle
423 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
424 OMP_DISTRIBUTE. Handle is_invisiref_parm decls in
425 OMP_CLAUSE_REDUCTION.
426 (cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
428 (cxx_omp_privatize_by_reference): Return true for
429 is_invisiref_parm decls.
430 (cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
432 * pt.c (apply_late_template_attributes): For "omp declare simd"
433 attribute call tsubst_omp_clauses,
434 c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
435 and c_omp_declare_simd_clauses_to_numbers.
436 (instantiate_class_template_1): Call cp_check_omp_declare_reduction
438 (tsubst_decl): Handle UDRs.
439 (tsubst_omp_clauses): Add declare_simd argument, if true don't
440 call finish_omp_clauses. Handle new OpenMP 4.0 clauses.
441 Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
442 OMP_CLAUSE_REDUCTION.
443 (tsubst_expr): For UDRs call pushdecl and
444 cp_check_omp_declare_reduction. Adjust tsubst_omp_clauses
445 callers. Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
446 OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
447 Adjust finish_omp_atomic caller.
448 (tsubst_omp_udr): New function.
449 (instantiate_decl): For UDRs at block scope, don't call
450 start_preparsed_function/finish_function. Call tsubst_omp_udr.
451 * semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
452 use it instead of need_default_ctor || need_copy_ctor.
453 (struct cp_check_omp_declare_reduction_data): New type.
454 (handle_omp_array_sections_1, handle_omp_array_sections,
455 omp_reduction_id, omp_reduction_lookup,
456 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
457 cp_check_omp_declare_reduction, clone_omp_udr,
458 find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
459 (finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
461 (finish_omp_for): Add CODE argument, use it instead of hardcoded
462 OMP_FOR. Adjust c_finish_omp_for caller.
463 (finish_omp_atomic): Add seq_cst argument, adjust
464 c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
466 (finish_omp_cancel, finish_omp_cancellation_point): New functions.
467 * decl2.c (mark_used): Force immediate instantiation of
468 DECL_OMP_DECLARE_REDUCTION_P decls.
469 (is_late_template_attribute): Return true for "omp declare simd"
471 (cp_omp_mappable_type): New function.
472 (cplus_decl_attributes): Add implicit "omp declare target" attribute
474 * parser.c (cp_debug_parser): Print
475 parser->colon_doesnt_start_class_def_p.
476 (cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
478 (enum pragma_context): Add pragma_member and pragma_objc_icode.
479 (cp_parser_binary_expression): Handle no_toplevel_fold_p
480 even for binary operations other than comparison.
481 (cp_parser_linkage_specification): Call
482 cp_ensure_no_omp_declare_simd if needed.
483 (cp_parser_namespace_definition): Likewise.
484 (cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
485 (cp_parser_direct_declarator): Pass declarator to
486 cp_parser_late_return_type_opt.
487 (cp_parser_late_return_type_opt): Add declarator argument,
488 call cp_parser_late_parsing_omp_declare_simd for declare simd.
489 (cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
490 Parse UDRs before all other methods.
491 (cp_parser_member_specification_opt): Use pragma_member instead of
493 (cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
494 (cp_parser_function_definition_from_specifiers_and_declarator,
495 cp_parser_save_member_function_body): Likewise.
496 (cp_parser_late_parsing_for_member): Handle UDRs specially.
497 (cp_parser_next_token_starts_class_definition_p): Don't allow
498 CPP_COLON if colon_doesnt_start_class_def_p flag is true.
499 (cp_parser_objc_interstitial_code): Use pragma_objc_icode
500 instead of pragma_external.
501 (cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
502 (cp_parser_omp_var_list_no_open): Parse array sections for
503 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses. Add COLON argument,
504 if non-NULL, allow parsing to end with a colon rather than close
506 (cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
508 (cp_parser_omp_clause_reduction): Handle user defined reductions.
509 (cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
510 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
511 cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
512 cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
513 cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
514 cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
515 cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
516 cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
518 (cp_parser_omp_all_clauses): Add finish_p argument. Don't call
519 finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
520 (cp_parser_omp_atomic): Parse seq_cst clause, pass
521 true if it is present to finish_omp_atomic. Handle new OpenMP 4.0
523 (cp_parser_omp_for_loop): Add CODE argument, pass it through
524 to finish_omp_for. Change last argument to cclauses,
525 and adjust uses to grab parallel clauses from the array of all
527 (cp_omp_split_clauses): New function.
528 (cp_parser_omp_simd): New function.
529 (cp_parser_omp_for): Add p_name, mask and cclauses arguments.
530 Allow the function to be called also when parsing combined constructs,
531 and call c_parser_omp_simd when parsing for simd.
532 (cp_parser_omp_sections_scope): If section-sequence doesn't start with
533 #pragma omp section, require exactly one structured-block instead of
534 sequence of statements.
535 (cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
536 Allow the function to be called also when parsing combined constructs.
537 (cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
538 Allow the function to be called also when parsing combined
540 (cp_parser_omp_taskgroup, cp_parser_omp_cancel,
541 cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
542 cp_parser_omp_teams, cp_parser_omp_target_data,
543 cp_parser_omp_target_update, cp_parser_omp_target,
544 cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
545 cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
546 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
547 cp_parser_omp_declare): New functions.
548 (cp_parser_omp_construct): Add p_name and mask vars. Handle
549 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
550 PRAGMA_OMP_TEAMS. Adjust cp_parser_omp_for, cp_parser_omp_parallel
551 and cp_parser_omp_sections callers.
552 (cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
553 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
554 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
555 PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
556 Handle pragma_member and pragma_objc_icode like pragma_external.
557 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
558 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
559 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
560 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
562 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
563 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
564 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
565 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
566 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
567 * parser.h (struct cp_omp_declare_simd_data): New type.
568 (struct cp_parser): Add colon_doesnt_start_class_def_p and
569 omp_declare_simd fields.
570 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
571 * cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
573 (DECL_OMP_DECLARE_REDUCTION_P): Define.
574 (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
575 (struct saved_scope): Add omp_declare_target_attribute field.
576 (cp_omp_mappable_type, omp_reduction_id,
577 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
578 finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
579 (finish_omp_for): Add CODE argument.
580 (finish_omp_atomic): Add seq_cst argument.
581 (cxx_omp_create_clause_info): Add need_dtor argument.
583 2013-10-09 Marek Polacek <polacek@redhat.com>
586 * semantics.c (finish_return_stmt): Return error_mark_node
587 when error_operand_p of the expr is true.
588 (build_transaction_expr): Check for EXPR_P before setting the
591 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
594 * lambda.c (begin_lambda_type): Check return value of xref_tag
595 for error_mark_node; tidy.
596 * decl.c (grokdeclarator): Tweak error message.
598 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
602 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
605 * pt.c (tsubst): Use error_operand_p on parameter t.
607 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
610 * class.c (check_bases): Propagate CLASSTYPE_READONLY_FIELDS_NEED_INIT
611 and CLASSTYPE_REF_FIELDS_NEED_INIT from bases to derived.
612 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Extend error
613 messages about uninitialized const and references members to mention
616 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
619 * pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
621 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
624 * typeck2.c (build_functional_cast): Use error_operand_p on exp.
626 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
629 * parser.c (cp_parser_perform_range_for_lookup): If eventually
630 either *begin or *end is type-dependent, return NULL_TREE.
631 (do_range_for_auto_deduction): If cp_parser_perform_range_for_lookup
632 returns NULL_TREE, don't actually do_auto_deduction.
634 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
637 * pt.c (tsubst): Use error_operand_p on parameter t.
639 2013-10-04 Marc Glisse <marc.glisse@inria.fr>
642 * decl.c (cxx_init_decl_processing): Set operator_new_flag.
644 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
647 * decl2.c (save_template_attributes): Handle error_mark_node as
649 (cp_check_const_attributes): Likewise for attributes.
650 * parser.c (cp_parser_std_attribute_spec): When alignas_expr is an
651 error_mark_node call cp_parser_skip_to_end_of_statement.
653 2013-10-03 Easwaran Raman <eraman@google.com>
656 * parser.c (cp_parser_init_declarator): Do not drop attributes
657 of template member functions.
659 2013-10-03 Marek Polacek <polacek@redhat.com>
662 * init.c (sort_mem_initializers): Splice when giving an error.
664 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
667 * parser.c (cp_parser_function_specifier_opt): Upon error about
668 virtual templates don't set ds_virtual.
669 (finish_fully_implicit_template): Reject virtual implicit templates.
671 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
674 * semantics.c (potential_constant_expression_1): Handle LABEL_EXPR.
676 2013-10-01 Paolo Carlini <paolo.carlini@oracle.com>
679 * parser.c (cp_parser_lookup_name): Check make_typename_type return
680 value for error_mark_node.
682 2013-09-25 Tom Tromey <tromey@redhat.com>
684 * Make-lang.in (CXX_TREE_H, CXX_PARSER_H, CXX_PRETTY_PRINT_H):
687 2013-09-25 Tom Tromey <tromey@redhat.com>
689 * Make-lang.in (g++spec.o): Remove.
690 (CFLAGS-cp/g++spec.o): New variable.
691 (GXX_OBJS): Reference cp/g++spec.o.
692 (cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
693 (cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
694 (cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
695 (cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
696 (cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
697 (cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
698 (cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
699 (cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.
701 2013-09-25 Tom Tromey <tromey@redhat.com>
703 * Make-lang.in (g++spec.o): Don't use subshell.
705 2013-09-25 Marek Polacek <polacek@redhat.com>
708 * semantics.c (finish_transaction_stmt): Check for EXPR_P before
709 setting the expr location.
711 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
714 * type-utils.h (find_type_usage): Only traverse one type level into
715 member function pointers.
717 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
719 * parser.c (cp_parser_init_declarator): Defer calling
720 finish_fully_implicit_template for forward declarations until after
721 other decl processing is complete. Cleanup for clarity: Extract 'else'
722 case after 'if' containing unconditional return.
724 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
726 * parser.c (make_generic_type_name): Spell generic type names '<autoN>'
727 rather than '__GenN'.
729 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
731 * lambda.c (maybe_add_lambda_conv_op): Don't check for instantiated
732 callop in the case of generic lambdas.
734 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
736 * parser.c (make_generic_type_name): Use global count rather than
738 (add_implicit_template_parms): ... propagate interface change here.
740 2013-09-20 Paolo Carlini <paolo.carlini@oracle.com>
743 * pt.c (tsubst_copy): Use current_nonlambda_class_type to
744 call tsubst_baselink.
746 2013-09-18 Paolo Carlini <paolo.carlini@oracle.com>
749 * class.c (instantiate_type): Loosen a bit the gcc_assert.
751 2013-09-18 Marek Polacek <polacek@redhat.com>
754 * typeck.c (cp_build_binary_op): Properly honor -fsanitize options.
755 Remove unnecessary check.
757 2013-09-18 Marek Polacek <polacek@redhat.com>
760 * typeck.c (cp_build_binary_op): Don't sanitize function if it has the
761 no_sanitize_undefined attribute.
763 2013-09-17 Paolo Carlini <paolo.carlini@oracle.com>
766 * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account
767 the cp_type_quals (r) too.
769 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
771 * cp-tree.h (type_uses_auto_or_concept): Declare.
772 (is_auto_or_concept): Declare.
773 * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
774 -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
775 * type-utils.h: New header defining ...
776 (find_type_usage): ... this new function based on pt.c (type_uses_auto)
777 for searching a type tree given a predicate.
778 * pt.c (type_uses_auto): Reimplement via type-utils.h (find_type_usage).
779 (is_auto_or_concept): New function.
780 (type_uses_auto_or_concept): New function.
781 * parser.h (struct cp_parser): Add fully_implicit_function_template_p.
782 * parser.c (cp_parser_new): Initialize
783 fully_implicit_function_template_p.
784 (cp_parser_new): Initialize fully_implicit_function_template_p.
785 (cp_parser_lambda_expression): Copy and restore value of
786 fully_implicit_function_template_p as per other parser fields.
787 (cp_parser_parameter_declaration_list): Count generic
788 parameters and call ...
789 (add_implicit_template_parms): ... this new function to synthesize them
790 with help from type-utils.h (find_type_usage), ...
791 (tree_type_is_auto_or_concept): ... this new static function and ...
792 (make_generic_type_name): ... this new static function.
793 (cp_parser_direct_declarator): Account for implicit template parameters.
794 (cp_parser_lambda_declarator_opt): Finish fully implicit template if
795 necessary by calling ...
796 (finish_fully_implicit_template): ... this new function.
797 (cp_parser_init_declarator): Likewise.
798 (cp_parser_function_definition_after_declarator): Likewise.
799 (cp_parser_member_declaration): Likewise.
800 * Make-lang.in (cp/pt.o): Add dependency on type-utils.h.
801 (cp/parser.o): Likewise.
803 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
805 * parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
806 list with std=c++1y or std=gnu++1y.
807 (cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
808 operator template to avoid adding template result to symbol table.
809 * lambda.c (lambda_function): Return template result if call operator is
811 (maybe_add_lambda_conv_op): Move declarations to point of use. Refactor
812 operator call building in order to support conversion of a non-capturing
813 lambda template to a function pointer with help from ...
814 (prepare_op_call): ... this new function.
815 * decl2.c (check_member_template): Don't reject lambda call operator
816 template in local [lambda] class.
817 * pt.c (instantiate_class_template_1): Don't instantiate lambda call
818 operator template when instantiating lambda class.
820 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
822 * pt.c (make_auto_1): Use input_location rather than BUILTINS_LOCATION.
824 2013-09-15 Jason Merrill <jason@redhat.com>
828 * parser.c (cp_parser_lambda_introducer): Handle variadic capture.
829 * lambda.c (add_capture): Handle variadic capture.
830 (add_default_capture, lambda_capture_field_type): Likewise.
831 (build_capture_proxy, register_capture_members): Likewise.
832 * pt.c (register_specialization): Allow FIELD_DECL.
833 (retrieve_specialization): Likewise.
834 (find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
835 (tsubst_pack_expansion): Handle FIELD_DECL packs.
836 (gen_elem_of_pack_expansion_instantiation): Likewise.
837 (instantiate_class_template_1): Likewise.
838 (tsubst_decl, tsubst_copy): Likewise.
839 (tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
840 (tsubst_copy_and_build) [VAR_DECL]: Likewise.
841 * semantics.c (finish_non_static_data_member): Don't try to represent
842 the type of a COMPOUND_REF of a FIELD_DECL pack.
845 * cp-tree.h (DECL_PACK_P): Replace FUNCTION_PARAMETER_PACK_P.
846 * cxx-pretty-print.c (direct_declarator): Adjust.
847 * decl2.c (cp_build_parm_decl): Adjust.
848 * pt.c (function_parameter_pack_p): Adjust.
849 (find_parameter_packs_r, push_template_decl_real): Adjust.
850 (tsubst_pack_expansion, tsubst_decl): Adjust.
851 (regenerate_decl_from_template, instantiate_decl): Adjust.
853 * lambda.c (add_capture): Don't add DECL_LANG_SPECIFIC.
855 2013-09-13 Jason Merrill <jason@redhat.com>
858 * pt.c (any_type_dependent_elements_p): Actually check for
859 type-dependence, not value-dependence.
861 2013-09-13 Jacek Caban <jacek@codeweavers.com>
863 * decl.c: Use new cxx_implicit_extern_c hook
865 2013-09-12 Brooks Moses <bmoses@google.com>
868 * Make-lang.in: Do not install driver binaries in $(target)/bin.
870 2013-09-12 Adam Butcher <adam@jessamine.co.uk>
872 * pt.c (instantiate_decl): Save/restore cp_unevaluated_operand and
873 c_inhibit_evaluation_warnings. Reset if instantiating within a
874 function-local template.
876 2013-09-12 Paolo Carlini <paolo.carlini@oracle.com>
878 * semantics.c (finish_pseudo_destructor_expr): Add location_t
880 * pt.c (unify_arg_conversion): Use EXPR_LOC_OR_HERE.
881 (tsubst_copy_and_build): Adjust finish_pseudo_destructor_expr
883 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
884 (cp_parser_postfix_expression): Pass the proper location to
885 cp_parser_postfix_dot_deref_expression.
886 * cp-tree.h (finish_pseudo_destructor_expr): Update declaration.
888 2013-09-10 Jan Hubicka <jh@suse.cz>
889 Paolo Carlini <paolo.carlini@oracle.com>
891 * error.c (print_instantiation_partial_context_line): If
892 loc == UNKNOWN_LOCATION return immediately.
894 2013-09-09 Jakub Jelinek <jakub@redhat.com>
897 * init.c (build_vec_delete): Call mark_rvalue_use on base.
899 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
902 * init.c (build_vec_delete_1): When the type is incomplete emit a
903 warning, enabled by default (not an error).
904 (build_delete): Adjust to use OPT_Wdelete_incomplete.
906 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
909 * error.c (location_of): Don't handle PARM_DECLs specially.
911 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
913 * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
914 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
915 Tweak, TREE_OPERAND (t, 1) may be null.
917 2013-09-08 Caroline Tice <cmtice@google.com>
920 * vtable-class-hierarchy.c (vtv_generate_init_routine): In
921 preinit case, move call to assemble_vtv_preinit_initializer to
922 after call to cgraph_process_new_functions.
924 2013-09-08 Tom de Vries <tom@codesourcery.com>
927 * except.c (build_must_not_throw_expr): Handle
930 2013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
932 * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p.
934 2013-09-04 Paolo Carlini <paolo.carlini@oracle.com>
937 * class.c (finish_struct_anon_r): New.
938 (finish_struct_anon): Use it.
940 2013-09-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
942 * cxx-pretty-print.h (cxx_pretty_printer::simple_type_specifier):
943 Declare as overrider.
944 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier):
945 Rename from pp_cxx_simple_type_specifier.
946 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
947 simple_type_specifier.
949 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com>
952 * typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
954 2013-09-03 Mike Stump <mikestump@comcast.net>
956 * Make-lang.in (cp/lambda.o): Add dependencies.
958 2013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
960 * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as
962 * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove.
963 (pp_cxx_userdef_literal): Tidy.
964 (pp_cxx_template_argument_list): Likewise.
965 (pp_cxx_typeid_expression): Likewise.
966 (pp_cxx_offsetof_expression_1): Likewise.
967 (cxx_pretty_printer::postfix_expression): Likewise.
968 (cxx_pretty_printer::unary_expression): Likewise.
969 (cxx_pretty_printer::statement): Likewise.
970 (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id.
971 (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id.
972 * error.c (dump_decl): Tidy.
973 (dump_expr): Likewise.
975 2013-09-02 Paolo Carlini <paolo.carlini@oracle.com>
977 PR c++/21682, implement DR 565
978 * name-lookup.c (compparms_for_decl_and_using_decl): New.
979 (push_overloaded_decl_1, do_nonmember_using_decl): Use it.
981 2013-08-30 Marek Polacek <polacek@redhat.com>
983 * typeck.c (cp_build_binary_op): Add division by zero and shift
985 * error.c (dump_expr): Special-case ubsan builtins.
987 2013-08-30 Paolo Carlini <paolo.carlini@oracle.com>
990 * cp-tree.h (LOOKUP_DELEGATING_CONS): Add.
991 * init.c (perform_target_ctor): Use it.
992 * call.c (build_special_member_call): Diagnose self-delegating
995 2013-08-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
997 * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as
999 (cxx_pretty_printer::declaration_specifiers): Likewise.
1000 (cxx_pretty_printer::function_specifier): Likewise.
1001 (cxx_pretty_printer::declarator): Likewise.
1002 (cxx_pretty_printer::direct_declarator): Likewise.
1003 (cxx_pretty_printer::abstract_declarator): Likewise.
1004 (cxx_pretty_printer::direct_abstract_declarator): Likewise.
1005 (pp_cxx_declaration): Remove.
1006 * cxx-pretty-print.c (cxx_pretty_printer::function_specifier):
1007 Rename from pp_cxx_function_specifier. Adjust.
1008 (cxx_pretty_printer::declaration_specifiers): Rename from
1009 pp_cxx_decl_specifier_seq. Adjust.
1010 (cxx_pretty_printer::direct_declarator): Rename from
1011 pp_cxx_direct_declarator. Adjust.
1012 (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator.
1014 (cxx_pretty_printer::abstract_declarator): Rename from
1015 pp_cxx_abstract_declarator. Adjust.
1016 (cxx_pretty_printer::direct_abstract_declarator): Rename from
1017 pp_cxx_direct_abstract_declarator. Adjust.
1018 (cxx_pretty_printer::declaration): Rename from
1019 pp_cxx_declaration. Adjust.
1020 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1021 declaration, declaration_specifiers, function_specifier,
1022 declarator, direct_declarator, abstract_declarator,
1023 direct_abstract_declarator.
1024 * error.c (dump_decl): Adjust.
1026 2013-08-29 Jan Hubicka <jh@suse.cz>
1028 Correct previous patch to not mark terminate as LEAF.
1029 * class.c (build_vtbl_initializer): Drop LEAF
1030 * decl.c (cxx_init_decl_processing): Likewise.
1031 (push_throw_library_fn): Likewise.
1032 * except.c (init_exception_processing): Likewise.
1033 (do_begin_catch): Likewise.
1034 (do_end_catch): Likewise.
1035 (do_allocate_exception): Likewise.
1037 2013-08-29 Jan Hubicka <jh@suse.cz>
1039 * class.c (build_vtbl_initializer): Make __cxa_deleted_virtual
1040 ECF_NORETURN | ECF_LEAF
1041 * cp-tree.h (build_library_fn_ptr, build_cp_library_fn_ptr,
1042 push_library_fn, push_void_library_fn): Update prototype.
1043 * decl.c (build_library_fn_1): Remove.
1044 (push_cp_library_fn, build_cp_library_fn): Update to take ECF flags.
1045 (cxx_init_decl_processing): Update; global_delete_fndecl is ECF_NOTROW;
1046 __cxa_pure_virtual is ECF_NORETURN | ECF_NORETURN | ECF_LEAF.
1047 (build_library_fn_1): Add ecf_flags argument; rename to ...
1048 (build_library_fn): ... this one.
1049 (build_cp_library_fn): Take ecf_flags; do not copy NOTHROW flag.
1050 (build_library_fn_ptr): Take ecf_flags.
1051 (build_cp_library_fn_ptr): Likewise.
1052 (push_library_fn): Likewise.
1053 (push_cp_library_fn): Likewise.
1054 (push_void_library_fn): Likewise.
1055 (push_throw_library_fn): All throws are ECF_NORETURN.
1056 (__cxa_atexit, __cxa_thread_atexit): Add ECF_LEAF | ECF_NOTHROW attributes.
1057 (expand_static_init): __cxa_guard_acquire, __cxa_guard_release,
1058 __cxa_guard_abort are ECF_NOTHROW | ECF_LEAF.
1059 * except.c (init_exception_processing): terminate is
1060 ECF_NOTHROW | ECF_NORETURN | ECF_LEAF.
1061 (declare_nothrow_library_fn): Add ecf_flags parameter.
1062 (__cxa_get_exception_ptr): Is ECF_NOTHROW | ECF_PURE | ECF_LEAF |
1064 (do_begin_catch): cxa_begin_catch and _ITM_cxa_begin_catch
1065 are ECF_NOTHROW | ECF_LEAF.
1066 (do_end_catch): __cxa_end_catch and _ITM_cxa_end_catch is
1068 (do_allocate_exception): _cxa_allocate_exception
1069 and _ITM_cxa_allocate_exception are ECF_NOTHROW | ECF_MALLOC
1071 (do_free_exception): __cxa_free_exception is
1072 ECF_NOTHROW | ECF_LEAF.
1073 * rtti.c (build_dynamic_cast_1): __dynamic_cast
1074 is ECF_LEAF | ECF_PURE | ECF_NOTHROW.
1076 2013-08-29 Adam Butcher <adam@jessamine.co.uk>
1078 * error.c (dump_lambda_function): New function, dependent on ...
1079 (dump_substitution): ... this new function, factored out of ...
1080 (subst_to_string): ... here and ...
1081 (dump_function_decl): ... here. Updated to early-out with call to
1082 dump_lambda_function after determining template bindings.
1084 2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
1087 * init.c (build_aggr_init): When init == void_type_node do not
1088 set LOOKUP_ONLYCONVERTING.
1090 2013-08-27 Caroline Tice <cmtice@google.com>
1092 * vtable-class-hierarchy.c: Remove unnecessary include statements.
1093 (MAX_SET_SIZE): Remove unnecessary constant.
1094 (register_construction_vtables): Make vtable_ptr_array parameter
1095 into a vector; remove num_args parameter. Change array accesses to
1097 (register_other_binfo_vtables): Ditto.
1098 (insert_call_to_register_set): Ditto.
1099 (insert_call_to_register_pair): Ditto.
1100 (output_set_info): Ditto. Also change warning calls to warning_at
1101 calls, and fix format of warning messages.
1102 (register_all_pairs): Change vtbl_ptr_array from an array into a
1103 vector. Remove num_vtable_args (replace with calls to vector length).
1104 Change array stores & accesses to vector functions. Change calls to
1105 register_construction_vtables, register_other_binfo_vtables,
1106 insert_call_to_register_set, insert_call_to_register_pair and
1107 output_set_info to match their new signatures. Change warning to
1108 warning_at and fix the format of the warning message.
1110 2013-08-27 Jakub Jelinek <jakub@redhat.com>
1111 Aldy Hernandez <aldyh@redhat.com>
1113 * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
1115 2013-08-27 Paolo Carlini <paolo.carlini@oracle.com>
1117 * decl.c (grokfndecl): Remove old bison hack.
1119 2013-08-26 Jan Hubicka <jh@suse.cz>
1121 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
1124 2013-08-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1126 * cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
1127 Declare as overrider.
1128 (cxx_pretty_printer::multiplicative_expression): Likewise.
1129 (cxx_pretty_printer::conditional_expression): Likewise.
1130 (cxx_pretty_printer::assignment_expression): Likewise.
1131 (cxx_pretty_printer::expression): Likewise.
1132 * cxx-pretty-print.c (cxx_pretty_printer::unary_expression):
1133 Rename from pp_cxx_unary_expression. Adjust.
1134 (cxx_pretty_printer::multiplicative_expression): Rename from
1135 pp_cxx_multiplicative_expression. Adjust.
1136 (cxx_pretty_printer::conditional_expression): Rename from
1137 pp_cxx_conditional_expression. Adjust.
1138 (cxx_pretty_printer::assignment_expression): Rename from
1139 pp_cxx_assignment_expression. Adjust.
1140 (cxx_pretty_printer::expression): Rename from pp_cxx_expression.
1142 (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to
1143 unary_expression, multiplicative_expression,
1144 conditional_expression, assignment_expression, expression.
1146 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1148 * cxx-pretty-print.h (cxx_pretty_printer::postfix_expression):
1149 Declare as overrider.
1150 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
1151 Rename from pp_cxx_postfix_expression. Adjust.
1152 (pp_cxx_expression): Use pp_postfix_expression.
1153 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1156 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1158 * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now
1159 an overrider of c_pretty_printer::primary_expression.
1160 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression):
1161 Rename from pp_cxx_primary_expression. Adjust.
1162 (pp_cxx_postfix_expression): Use pp_primary_expression.
1163 (pp_cxx_ctor_initializer): Likewise.
1164 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1167 2013-08-23 Jan Hubicka <jh@suse.cz>
1169 * cp-tree.h (struct lang_type_class): Free is_final bit.
1170 (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
1171 (DECL_FINAL_P): Remove.
1172 * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
1173 is called on CLASS_TYPE_P.
1175 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1177 * cxx-pretty-print.c (M_): Remove.
1178 (pp_cxx_unqualified_id): Use translate_string instead of M_.
1179 (pp_cxx_canonical_template_parameter): Likewise.
1181 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1183 * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
1184 * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
1185 from pp_cxx_id_expression. Adjust.
1186 (pp_cxx_userdef_literal): Use pp_id_expression.
1187 (pp_cxx_primary_expression): Likewise.
1188 (pp_cxx_direct_declarator): Likewise.
1189 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1192 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1194 * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
1195 function, overriding c_pretty_printer::constant.
1196 * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
1197 pp_cxx_constant. Adjust.
1198 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
1200 2013-08-23 Gabriel Dos Reis <gdr@integrable-solutiobs.net>
1202 * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
1203 destructor for the early printer.
1204 * error.c (type_to_string): Use pp_buffer.
1206 2013-08-22 Paolo Carlini <paolo.carlini@oracle.com>
1209 * class.c (check_field_decls): Check for const mutable and const
1210 reference data members.
1212 2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1214 * error.c (init_error): Remove calls to pp_construct and
1215 pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
1216 * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
1217 (cxx_pretty_printer_init): Remove.
1218 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
1219 Rename from cxx_pretty_printer_init. Adjust.
1220 * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
1221 initialization of C++ diagnostics pretty printer.
1223 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1225 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1226 * cp-tree.h (REFERENCE_REF_P): Likewise.
1227 * semantics.c (finish_offsetof): Likewise.
1229 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1232 * semantics.c (finish_id_expression): Handle deprecated references.
1234 2013-08-20 Jason Merrill <jason@redhat.com>
1237 * cvt.c (build_expr_type_conversion): Don't complain about a
1238 template that can't match the desired type category.
1240 2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
1242 * error.c (pp_ggc_formatted_text): New.
1243 (type_as_string): Use it in lieu of pp_formatted_text.
1244 (type_as_string_translate): Likewise.
1245 (expr_as_string): Likewise.
1246 (decl_as_string): Likewise.
1247 (decl_as_string_translate): Likewise.
1248 (lang_decl_name): Likewise.
1249 (decl_to_string): Likewise.
1250 (expr_to_string): Likewise.
1251 (fndecl_to_string): Likewise.
1252 (parm_to_string): Likewise.
1253 (type_to_string): Likewise.
1254 (args_to_string): Likewise.
1255 (subst_to_string): Likewise.
1257 2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
1260 * cp-array-notation.c (cp_expand_cond_array_notations): Added a
1261 check for truth values.
1262 (expand_array_notation_exprs): Added truth values case. Removed an
1263 unwanted else. Added for-loop to walk through subtrees in default
1265 * call.c (build_cxx_call): Inherited the type of the array notation for
1266 certain built-in array notation functions.
1268 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1270 * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
1271 Use cp_parser_lookup_name_simple.
1273 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1275 * name-lookup.h (pop_bindings_and_leave_scope): Declare.
1276 * name-lookup.c (pop_bindings_and_leave_scope): Define.
1277 * parser.c (cp_parser_lambda_declarator_opt,
1278 cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
1280 2013-08-17 Jason Merrill <jason@redhat.com>
1283 * name-lookup.c (push_class_level_binding_1): It's OK to push a
1284 lambda type after the enclosing type is complete.
1286 2013-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
1288 * error.c (dump_scope): Add a cxx_pretty_printer parameter.
1290 (dump_template_argument): Likewise.
1291 (dump_template_argument_list): Likewise.
1292 (dump_template_parameter): Likewise.
1293 (dump_template_bindings): Likewise.
1294 (dump_alias_template_specialization): Likewise.
1295 (dump_type): Likewise.
1296 (dump_typename): Likewise.
1297 (dump_aggr_type): Likewise.
1298 (dump_type_prefix): Likewise.
1299 (dump_type_suffix): Likewise.
1300 (dump_global_iord): Likewise.
1301 (dump_simple_decl): Likewise.
1302 (dump_decl): Likewise.
1303 (dump_template_decl): Likewise.
1304 (dump_function_decl): Likewise.
1305 (dump_parameters): Likewise.
1306 (dump_ref_qualifier): Likewise.
1307 (dump_exception_spec): Likewise.
1308 (dump_function_name): Likewise.
1309 (dump_template_parms): Likewise.
1310 (dump_call_expr_args): Likewise.
1311 (dump_aggr_init_expr_args): Likewise.
1312 (dump_expr_list): Likewise.
1313 (dump_expr_init_vec): Likewise.
1314 (dump_expr): Likewise.
1315 (dump_binary_op): Likewise.
1316 (dump_unary_op): Likewise.
1318 2013-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1321 * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
1322 * decl.c (case_conversion): Use it.
1323 * call.c (standard_conversion): Likewise.
1324 (implicit_conversion): Adjust.
1326 2013-08-13 Adam Butcher <adam@jessamine.co.uk>
1328 * pt.c: Grammar fix in comments ("it's" to "its").
1330 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
1332 * decl.c (warn_extern_redeclared_static, duplicate_decls,
1333 check_elaborated_type_specifier): Use error + inform.
1334 * friend.c (make_friend_class): Likewise.
1335 * semantics.c (finish_id_expression): Likewise.
1337 2013-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1340 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1343 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1346 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1349 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1352 2013-08-06 Caroline Tice <cmtice@google.com>
1354 * Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
1356 (vtable-class-hierarchy.o): Add build rule.
1357 * cp-tree.h (vtv_start_verification_constructor_init_function): New
1358 extern function decl.
1359 (vtv_finish_verification_constructor_init_function): New extern
1361 (build_vtbl_address): New extern function decl.
1362 (get_mangled_vtable_map_var_name): New extern function decl.
1363 (vtv_compute_class_hierarchy_transitive_closure): New extern function
1365 (vtv_generate_init_routine): New extern function decl.
1366 (vtv_save_class_info): New extern function decl.
1367 (vtv_recover_class_info): New extern function decl.
1368 (vtv_build_vtable_verify_fndecl): New extern function decl.
1369 * class.c (finish_struct_1): Add call to vtv_save_class_info if
1370 flag_vtable_verify is true.
1371 * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
1372 * vtable-class-hierarchy.c: New file.
1373 * mangle.c (get_mangled_vtable_map_var_name): New function.
1374 * decl2.c (start_objects): Update function comment.
1375 (cp_write_global_declarations): Call vtv_recover_class_info,
1376 vtv_compute_class_hierarchy_transitive_closure and
1377 vtv_build_vtable_verify_fndecl, before calling
1378 finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
1379 flag_vtable_verify is true.
1380 (vtv_start_verification_constructor_init_function): New function.
1381 (vtv_finish_verification_constructor_init_function): New function.
1382 * init.c (build_vtbl_address): Remove static qualifier from function.
1384 2013-08-06 Jason Merrill <jason@redhat.com>
1387 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
1389 2013-08-05 Paolo Carlini <paolo.carlini@oracle.com>
1392 * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
1393 (cp_build_binary_op): Adjust.
1395 2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
1397 * cxx-pretty-print.h (pp_c_base): Remove.
1398 (cxx_pretty_printer): Derive from c_pretty_printer.
1399 Adjust macros using pp_c_base.
1400 * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
1401 * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
1402 (pp_cxx_colon_colon): Likewise.
1403 (pp_cxx_separate_with): Likewise.
1404 (pp_cxx_storage_class_specifier): Do not call pp_c_base.
1405 (pp_cxx_expression_list): Likewise.
1406 (pp_cxx_space_for_pointer_operator): Likewise.
1407 (pp_cxx_init_declarator): Likewise.
1408 (pp_cxx_call_argument_list): Likewise.
1409 (pp_cxx_constant): Likewise.
1410 (pp_cxx_postfix_expression): Likewise.
1411 (pp_cxx_new_expression): Likewise.
1412 (pp_cxx_unary_expression): Likewise.
1413 (pp_cxx_cast_expression): Likewise.
1414 (pp_cxx_conditional_expression): Likewise.
1415 (pp_cxx_assignment_expression): Likewise.
1416 (pp_cxx_expression): Likewise.
1417 (pp_cxx_function_specifier): Likewise.
1418 (pp_cxx_decl_specifier_seq): Likewise.
1419 (pp_cxx_simple_type_specifier): Likewise.
1420 (pp_cxx_type_specifier_seq): Likewise.
1421 (pp_cxx_ptr_operator): Likewise.
1422 (pp_cxx_parameter_declaration_clause): Likewise.
1423 (pp_cxx_direct_declarator): Likewise.
1424 (pp_cxx_direct_abstract_declarator): Likewise.
1425 (pp_cxx_type_id): Likewise.
1426 (pp_cxx_statement): Likewise.
1427 (pp_cxx_pretty_printer_init): Tidy.
1428 * error.c (init_error): Do not use pp_base.
1429 (dump_aggr_type): Likewise.
1430 (dump_type_prefix): Likewise.
1431 (dump_type_suffix): Likewise.
1432 (dump_global_iord): Likewise.
1433 (dump_decl): Likewise.
1434 (dump_function_decl): Likewise.
1435 (dump_ref_qualifier): Likewise.
1436 (reinit_cxx_pp): Likewise.
1437 (decl_as_dwarf_string): Likewise.
1438 (lang_decl_dwarf_name): Likewise.
1439 (type_to_string): Likewise.
1440 (cv_to_string): Likewise.
1441 (cxx_print_error_function): Likewise.
1442 (cp_diagnostic_starter): Likewise.
1443 (cp_diagnostic_finalizer): Likewise.
1444 (cp_print_error_function): Likewise.
1445 (print_instantiation_context): Likewise.
1446 (cp_printer): Likewise.
1448 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1450 * error.c (dump_type_prefix): Use specialized pretty printer
1451 functions instead of pp_string or operators and punctuators.
1452 (dump_decl): Likewise.
1453 (dump_expr): Likewise.
1455 2013-08-03 Jason Merrill <jason@redhat.com>
1458 * pt.c (get_underlying_template): New.
1459 (convert_template_argument, lookup_template_class_1): Use it.
1463 * pt.c (pack_expansion_args_count): Rename from
1464 any_pack_expanson_args_p.
1465 (coerce_template_parms): Reject pack expansion to
1466 non-pack template parameter of alias template.
1468 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1470 * error.c (dump_aggr_type): Use specialized pretty printer
1471 functions instead of pp_character.
1472 (dump_type_prefix): Likewise.
1473 (dump_simple_decl): Likewise.
1474 (type_to_string): Likewise.
1476 2013-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1478 * cp-tree.h (finish_stmt): Do not declare.
1479 * decl.c (finish_stmt): Do not define.
1480 * parser.c (cp_parser_expression_statement,
1481 cp_parser_declaration_statement,
1482 cp_parser_transaction_cancel): Don't call finish_stmt.
1483 * semantics.c (finish_expr_stmt, finish_if_stmt,
1484 finish_while_stmt, finish_do_stmt, finish_return_stmt,
1485 finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
1486 finish_transaction_stmt): Likewise.
1488 2013-08-01 Fabien Chêne <fabien@gcc.gnu.org>
1491 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
1492 * name-lookup.c (do_nonmember_using_decl): Make sure we have an
1493 OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
1494 instead of issuing an error without mentioning the conflicting
1497 2013-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1499 * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
1500 return value for error_mark_node.
1502 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1505 * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
1506 token->type == CPP_ELLIPSIS.
1508 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1511 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
1513 2013-07-29 Jason Merrill <jason@redhat.com>
1516 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
1517 Use break_out_target_exprs instead of unshare_expr.
1519 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
1522 * call.c (initialize_reference): Don't crash when reference_binding
1523 returns a conv with conv->kind == ck_ambig.
1525 2013-07-29 Jason Merrill <jason@redhat.com>
1527 * mangle.c (write_name): Check for null context.
1528 (write_unscoped_name): Allow PARM_DECL context.
1530 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1533 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
1534 (grokparms): Adjust.
1535 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1536 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
1537 a tsubst_flags_t parameter.
1538 (tsubst_decl): Adjust.
1539 * call.c (convert_default_arg): Likewise.
1540 * cp-tree.h (check_default_argument, tsubst_default_argument):
1541 Update declarations.
1543 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1546 * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
1547 CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
1548 CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
1549 Fix string_len management, tidy.
1551 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1554 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
1555 target type is incomplete; return a bool, not an int.
1556 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
1558 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
1560 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
1561 tf_warning_or_error.
1563 2013-07-21 Ondřej BÃÂlka <neleai@seznam.cz>
1565 * class.c: Fix typos.
1566 * cp-array-notation.c: Likewise.
1567 * cp-objcp-common.c: Likewise.
1570 * mangle.c: Likewise.
1571 * parser.c: Likewise.
1573 * semantics.c: Likewise.
1575 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
1577 * semantics.c (build_lambda_expr),
1578 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
1579 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
1580 (is_normal_capture_proxy), (insert_capture_proxy),
1581 (insert_pending_capture_proxies), (lambda_proxy_type),
1582 (build_capture_proxy), (vla_capture_type),
1583 (register_capture_members), (add_default_capture),
1584 (lambda_expr_this_capture), (maybe_resolve_dummy),
1585 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
1586 (is_lambda_ignored_entity): Moved definitions into ...
1587 * lambda.c: ... this new file.
1589 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
1591 * call.c (build_conditional_expr_1): Handle the case with 1 vector
1592 and 2 scalars. Call save_expr before building a vector.
1593 * typeck.c (cp_build_binary_op): Check complain before complaining.
1595 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
1598 * init.c (build_aggr_init): Check for warn_unused attribute.
1599 * decl.c (poplevel): Likewise.
1601 2013-07-13 Jason Merrill <jason@redhat.com>
1604 * init.c (build_vec_init): Use {} for arrays of class type.
1605 (build_vec_delete): Don't take the address of the array.
1608 * class.c (layout_class_type): Check for too-large class.
1610 * call.c (can_convert): Allow user-defined conversions.
1611 (can_convert_standard): New.
1612 * cp-tree.h: Declare it.
1613 * cvt.c (convert_to_reference): Use it.
1614 * pt.c (convert_nontype_argument): Likewise.
1615 * search.c (check_final_overrider): Likewise.
1616 Don't worry about user-defined conversions.
1618 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
1621 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
1622 warn about casting between pointer-to-function and pointer-to-object.
1624 2013-07-09 Jason Merrill <jason@redhat.com>
1627 * init.c (build_vec_init): Don't take shortcuts when initializing
1631 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
1634 * semantics.c (finish_id_expression): Return the id for an
1635 unevaluated outer variable.
1638 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
1639 if the variable type uses 'auto'.
1642 * typeck.c (check_return_expr): Lambda proxies aren't eligible
1643 for nrv or return by move.
1646 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
1647 a ref-qualifier in C++98 mode.
1650 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
1651 argument to have the exact type of the parameter.
1654 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
1655 a POINTER_PLUS_EXPR for type punning diagnostic.
1658 * pt.c (tsubst_copy): Handle USING_DECL.
1660 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
1663 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
1665 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
1668 * call.c (build_conditional_expr_1): Preserve xvalues.
1670 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1673 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
1674 also check declares_class_or_enum.
1676 2013-07-08 Jason Merrill <jason@redhat.com>
1679 * pt.c (fn_type_unification): Only defer during substitution.
1680 (type_unification_real): Defer during defarg substitution,
1681 add checks parm to pass back deferred checks.
1682 (unify, do_auto_deduction): Adjust.
1683 * semantics.c (reopen_deferring_access_checks): New.
1684 * cp-tree.h: Declare it.
1686 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
1689 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
1690 set parser->default_arg_ok_p to false before cp_parser_declarator.
1692 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1695 * class.c (build_base_path): Improve diagnostic.
1697 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
1700 * decl.c (start_preparsed_function): Return a bool, false if
1701 push_template_decl fails.
1702 (start_function): Adjust.
1703 * cp-tree.h: Update.
1705 2013-07-03 Jakub Jelinek <jakub@redhat.com>
1708 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
1709 Temporarily set parser->greater_than_is_operator_p for
1710 cp_parser_expression and restore from saved value afterwards.
1712 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1714 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
1715 * parser.c (cp_parser_operator()): Parse user-defined string
1716 literal as literal operator.
1718 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1721 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
1722 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
1725 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
1727 * parser.c (cp_parser_array_notation): Removed rejection array notation
1728 of type function pointers. Added handling of array expressions when
1729 Cilk Plus is enabled. Took out type-checking.
1730 (cp_parser_postfix_open_square_expression): Moved normal array expr.
1731 parsing into cp_parser_array_notation when cilkplus is enabled.
1732 (cp_parser_compound_statement): Removed expansion of array notations.
1733 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1734 (cp_parser_function_definition_after_declarator): Likewise.
1735 (cp_parser_selection_statement): Removed error reporting.
1736 (cp_parser_iteration_statement): Likewise.
1737 (cp_parser_direct_declarator): Removed error checking/reporting if
1738 array notations are used in the declarator.
1739 * pt.c (instantiate_decl): Likewise.
1740 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
1741 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
1742 (potential_constant_expression_1): Returned false for
1743 ARRAY_NOTATION_REF case.
1744 * cp-gimplify.c (cp_genericize): Added expansion of array notation
1746 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
1747 parameters. Replaced build_decls with get_temp_regvar with type as
1749 (create_array_refs): Made the type-casting to ptrdiff_type.
1750 (replace_invariant_var): Added a check for void return type before
1751 creating new var. Replaced build_decl and build_min_nt_loc with
1753 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
1754 with gcc_unreachable. Removed few unwanted checks. Made induction
1755 variable type as ptrdiff_type. Removed loc and complain arguments
1756 passed into make_triplet_val_inv. Replaced all modify expression's
1757 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
1758 into stmt. list with the non-forceful one. Replaced some integer
1759 conversion and equality-checking to using tree_int_cst_equal.
1760 (expand_sec_reduce_builtin): All changes mentioned in above function
1761 expand_an_in_modify_expr. Made the new variable type of
1762 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
1763 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
1764 the error reporting from parser to this function. Removed unwanted
1765 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
1766 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
1767 in function pointers.
1768 (cp_expand_cond_array_notations): Added a new if statements to check
1769 if condition has a zero rank. If so, then just return.
1770 (expand_return_expr): Added a check for return expressions with a rank.
1771 Replaced get_tmp_regvar with a create_temporary_var.
1772 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
1773 Moved common code outside if-statements. Moved type-checking from
1775 * semantics.c (finish_return_stmt): Removed a check for return exprs.
1777 * call.c (convert_like_real): Removed a check for array notation
1778 expression in a function.
1779 (build_over_call): Likewise.
1780 (magic_varargs_p): Added a check for builtin array notation function.
1781 Made this function non-static and removed its prototype.
1782 * cp-tree.h (magic_varargs_p): New prototype.
1783 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
1784 nargs to the param->length when builtin reduction function is used.
1785 (convert_arguments): Replaced check for a constant_p function with
1786 margic_varargs_p function call.
1787 (cp_build_binary_op): Removed calling of the function
1788 find_correct_array_notation_type.
1789 (cp_build_addr_expr_1): Removed an unwanted if-statement.
1790 (convert_for_assignment): Removed automatic return of rhs when array
1791 notation builtin function is used.
1793 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1796 * parser.c (cp_parser_save_member_function_body): Handle correctly
1797 curly braces in function-try-block mem-initializers.
1799 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
1802 * typeck.c (cp_build_vec_perm_expr): New function.
1803 * cp-tree.h: Declare it.
1804 * parser.c (cp_parser_postfix_expression): Call it.
1805 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
1806 (tsubst_copy_and_build): Likewise.
1808 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
1811 * pt.c (more_specialized_fn): If both arguments are references,
1812 give priority to an lvalue.
1814 2013-06-26 Jason Merrill <jason@redhat.com>
1816 * typeck2.c (store_init_value): Diagnose a non-constant
1817 initializer for in-class static.
1820 * semantics.c (add_capture): Set type to error_mark_node after
1823 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
1826 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
1827 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
1829 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1831 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
1832 * class.c (add_implicitly_declared_members): Likewise.
1833 (check_field_decl): Likewise.
1834 (finalize_literal_type_property): Likewise.
1835 (check_bases_and_members): Likewise.
1836 * decl.c (poplevel): Likewise.
1837 (case_conversion): Likewise.
1838 (check_initializer): Likewise.
1839 (grokfndecl): Likewise.
1840 (check_static_variable_definition): Likewise.
1841 (compute_array_index_type): Likewise.
1842 (grokdeclarator): Likewise.
1843 (build_enumerator): Likewise.
1844 * friend.c (make_friend_class): Likewise.
1845 * lex.c (init_reswords): Likewise.
1846 * method.c (synthesized_method_walk): Likewise.
1847 (implicitly_declare_fn): Likewise.
1848 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
1849 (cp_parser_constant_expression): Likewise.
1850 (cp_parser_for_init_statement): Likewise.
1851 (cp_parser_block_declaration): Likewise.
1852 (cp_parser_type_name): Likewise.
1853 (cp_parser_enum_specifier): Likewise.
1854 (cp_parser_enumerator_list): Likewise.
1855 (cp_parser_member_declaration): Likewise.
1856 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
1857 (cp_parser_template_declaration_after_export): Likewise.
1858 * pt.c (convert_nontype_argument_function): Likewise.
1859 (convert_nontype_argument): Likewise.
1860 (convert_template_argument): Likewise.
1861 (tsubst_copy_and_build): Likewise.
1862 (build_non_dependent_expr): Likewise.
1863 * semantics.c (non_const_var_error): Likewise.
1864 (potential_constant_expression_1): Likewise.
1865 * tree.c (lvalue_kind): Likewise.
1866 (build_vec_init_expr): Likewise.
1867 (cast_valid_in_integral_constant_expression_p): Likewise.
1868 * typeck.c (build_x_conditional_expr): Likewise.
1869 * typeck2.c (check_narrowing): Likewise.
1871 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
1873 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
1874 (expand_an_in_modify_expr): Changed a function call from the above
1875 removed function to length_mismatch_in_expr_p.
1877 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
1879 * call.c (convert_like_real): Added a check if array notation is present
1880 in expression. If so, then no conversion of arguments is necessary.
1881 (build_over_call): Likewise.
1882 * typeck.c (cp_build_function_call_vec): Likewise.
1883 (convert_for_assignment): Likewise.
1884 (cp_build_array_ref): Reject array notations with a rank greater than 1
1885 as an array's index.
1886 (cp_build_binary_op): If array notations are preent in op, then call
1887 find_correct_array_notation_type.
1888 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
1889 * cp-array-notation.c: New file.
1890 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
1892 * cp-tree.h (fix_array_notation_exprs): New prototype.
1893 * semantics.c (finish_return_stmt): Reject array notations as
1895 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
1896 (potential_constant_expression_1): Likewise.
1897 * tree.c (lvalue_kind): Likewise.
1898 * error.c (dump_decl): Likewise.
1899 (dump_expr): Likewise.
1900 * pt.c (ARRAY_NOTATION_REF): Likewise.
1901 (type_unification_real): Do not unify any arguments if array notations
1903 (instantiate_decl): Added a check for array notaitons inside the
1904 function body. If so, then expand them.
1905 * parser.c (cp_parser_array_notation): New function.
1906 (cp_parser_postfix_open_square_expression): Added a check for colons
1907 inside square braces. If found, then handle the array access as an
1908 array notation access. Also, disable auto-correction from a single
1909 colon to scope when Cilk Plus is enabled.
1910 (cp_parser_compound_statement): Added a check for array notations
1911 inside the statement. If found, then expand them.
1912 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1913 (cp_parser_function_definition_after_declarator): Likewise.
1914 (cp_parser_selection_statement): Searched for array notations inside
1915 condition. If so, then emit an error.
1916 (cp_parser_iteration_statement): Likewise.
1917 (cp_parser_direct_declarator): Reject array notations inside a
1918 variable or array declaration.
1919 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
1921 2013-06-20 Jason Merrill <jason@redhat.com>
1924 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
1925 context if we're in C++14 mode.
1926 * tree.c (array_of_runtime_bound_p): Return true for a dependent
1927 bound that is not potentually constant.
1928 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
1929 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
1930 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
1931 (build_capture_proxy): Set REFERENCE_VLA_OK.
1932 (vla_capture_type): Make it a proper C++ class.
1933 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
1936 * decl.c (compute_array_index_type): Use size_one_node.
1938 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
1939 a partial specialization.
1940 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
1942 (most_specialized_class): Adjust.
1944 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
1945 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
1946 TEMPLATE_DECL_CHECK.
1948 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1951 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
1952 TREE_TYPE (arg), not arg itself.
1954 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
1957 * pt.c (type_dependent_expression_p): Handle an array of unknown
1958 bound depending on a variadic parameter.
1959 * parser.c (cp_parser_range_for): Revert PR56794 changes.
1961 2013-06-17 Richard Biener <rguenther@suse.de>
1963 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
1965 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
1968 * parser.c (cp_parser_expression_statement): Check whether
1969 cp_parser_expression returns error_mark_node.
1971 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1974 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
1976 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1979 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
1980 accessible base simply forward to build_static_cast.
1982 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1985 * decl.c (poplevel): For the benefit of -Wunused-variable see
1988 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1990 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
1992 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1995 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
1996 again diagnostic already emitted by cp_parser_lookup_name.
1998 2013-06-11 Jan Hubicka <jh@suse.cz>
2001 * cp/pt.c (mark_decl_instantiated): Do not export explicit
2002 instantiations of anonymous namespace templates.
2004 2013-06-10 Jason Merrill <jason@redhat.com>
2006 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
2007 namespace to static_decls.
2009 2013-06-07 Sriraman Tallam <tmsriram@google.com>
2012 * call.c (build_over_call): Check if current_function_decl is
2015 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
2018 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
2019 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
2021 2013-06-06 Jason Merrill <jason@redhat.com>
2024 * semantics.c (add_capture): Diagnose capture of variable-size
2025 type that is not a C++1y array of runtime bound.
2027 * decl.c (grokdeclarator): Keep a decl with error type.
2028 (grokfield, grokbitfield): Likewise.
2029 * pt.c (instantiate_class_template_1): Likewise.
2030 (tsubst_decl): Drop redundant error.
2031 * class.c (walk_subobject_offsets): Handle erroneous fields.
2032 * typeck2.c (process_init_constructor_record): Likewise.
2034 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
2037 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
2038 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
2040 2013-06-03 Jan Hubicka <jh@suse.cz>
2042 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
2043 mark_decl_referenced.
2044 (mark_needed): Likewise.
2046 2013-06-03 Jason Merrill <jason@redhat.com>
2048 * class.c (mark_type_abi_tags): New.
2049 (check_abi_tags): Use it.
2051 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2054 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
2055 * semantics.c (finish_qualified_id_expr): Use it.
2056 * cp-tree.h: Update.
2058 2013-06-01 Jan Hubicka <jh@suse.cz>
2060 * decl2.c (cp_write_global_declarations): Replace same_body_alias
2061 by symbol.cpp_implicit_alias.
2063 2013-05-30 Jason Merrill <jason@redhat.com>
2066 * cp-lang.c (cp_classify_record): Handle structs without
2070 * class.c (common_enclosing_class): New.
2071 * cp-tree.h: Declare it.
2072 * init.c (sort_mem_initializers): Don't splice out a union member
2075 2013-05-29 Jan Hubicka <jh@suse.cz>
2077 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
2078 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
2080 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
2083 * decl2.c (check_classfn): Check for destructors declared as member
2086 2013-05-24 Jason Merrill <jason@redhat.com>
2089 * pt.c (any_template_arguments_need_structural_equality_p): A
2090 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
2092 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
2095 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
2096 with width exceeding the type.
2098 2013-05-24 Jason Merrill <jason@redhat.com>
2101 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
2102 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
2104 2013-05-23 Jason Merrill <jason@redhat.com>
2107 * tree.c (build_ref_qualified_type): Clear
2108 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
2110 2013-05-22 Jason Merrill <jason@redhat.com>
2113 * call.c (convert_like_real): Use cp_convert_and_check.
2114 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
2115 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
2116 (potential_constant_expression_1): Handle OMP_ATOMIC*.
2119 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
2122 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2125 * parser.c (cp_parser_conversion_type_id): Set up
2126 parser->type_definition_forbidden_message before calling
2127 cp_parser_type_specifier_seq.
2129 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2132 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
2133 warnings about defaulted functions.
2135 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2137 * call.c (build_conditional_expr_1): Add location_t parameter.
2138 (build_conditional_expr): Likewise.
2139 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
2140 get_member_function_from_ptrfunc, build_x_conditional_expr,
2141 cp_build_modify_expr): Update.
2142 * init.c (build_new_1): Likewise.
2143 * cp-tree.h: Update declaration.
2145 2013-05-20 Jason Merrill <jason@redhat.com>
2148 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
2152 * decl.c (fndecl_declared_return_type): Also look in
2153 DECL_SAVED_FUNCTION_DATA.
2155 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2158 * parser.c (cp_parser_parameter_declaration): Check return value
2159 of cp_parser_parse_and_diagnose_invalid_type_name.
2161 2013-05-20 Jason Merrill <jason@redhat.com>
2164 * class.c (vbase_has_user_provided_move_assign): New.
2165 * method.c (synthesized_method_walk): Check it.
2166 * cp-tree.h: Declare it.
2169 * tree.c (build_cplus_array_type): Copy layout info if element
2172 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2175 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
2177 2013-05-20 Jason Merrill <jason@redhat.com>
2180 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
2181 whether a template has its own args.
2183 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2186 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
2188 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2191 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
2192 instead of cp_parser_initializer_list for compound-literals.
2194 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
2197 * typeck.c (check_return_expr): Reverse the alignment comparison.
2199 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
2202 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
2203 correctly sizeof compound-literal; update comments.
2205 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
2207 * call.c (build_conditional_expr_1): Use cp_build_binary_op
2208 instead of directly calling fold_build2.
2210 2013-05-16 Jason Merrill <jason@redhat.com>
2212 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
2215 * decl.c (grokdeclarator): Allow member function qualifiers in
2216 TYPENAME context in C++11 mode.
2218 2013-05-16 Dodji Seketeli <dodji@redhat.com>
2220 PR c++/56782 - Regression with empty pack expansions
2221 * pt.c (use_pack_expansion_extra_args_p): When at least a
2222 parameter pack has an empty argument pack, and another parameter
2223 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
2226 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2228 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
2229 warning_at and permerror with warning_at/inform and permerror/
2230 inform, respectively.
2232 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2235 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
2238 2013-05-14 Jason Merrill <jason@redhat.com>
2241 * parser.c (cp_parser_range_for): Call complete_type.
2244 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
2246 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2249 * method.c (defaulted_late_check): Check for compatible exception
2250 specification out of class explicitly defaulted functions too.
2252 2013-05-14 Jason Merrill <jason@redhat.com>
2255 * semantics.c (potential_constant_expression_1): Make sure the
2256 called function is potentially constant.
2257 * call.c (null_ptr_cst_p): Revert earlier change.
2259 2013-05-13 Jason Merrill <jason@redhat.com>
2262 * call.c (null_ptr_cst_p): An expression with side-effects can't
2263 be a C++03 null pointer constant.
2266 * decl.c (reshape_init_class): Handle error_mark_node.
2269 * typeck.c (merge_types): Propagate ref-qualifier
2270 in METHOD_TYPE case.
2273 * decl.c (grokdeclarator): Apply ref-qualifier
2274 in the TYPENAME case.
2277 * decl.c (decls_match): Compare ref-qualifiers.
2279 2013-05-10 Jason Merrill <jason@redhat.com>
2282 * pt.c (convert_template_argument): Use dependent_template_arg_p,
2283 not uses_template_parms.
2286 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
2289 * semantics.c (add_capture): Error rather than abort on copy
2291 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
2292 warn about capture proxy.
2294 2013-05-09 Jason Merrill <jason@redhat.com>
2296 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
2299 * pt.c (lookup_template_class_1): Handle getting a template
2300 template parameter as D1.
2302 N3639 C++1y VLA diagnostics
2303 * decl.c (grokdeclarator): Complain about reference, pointer, or
2305 (create_array_type_for_decl): Complain about array of VLA.
2306 * pt.c (tsubst): Likewise.
2307 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
2308 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
2309 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
2310 (cxx_sizeof_or_alignof_type): Likewise.
2312 N3639 C++1y VLA support
2313 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
2314 (check_array_initializer): Allow VLA init.
2315 (reshape_init_array_1): Adjust.
2316 (cp_finish_decl): Check for invalid VLA length.
2317 * typeck2.c (process_init_constructor_array): Adjust.
2318 (store_init_value): Use build_vec_init for VLAs.
2319 * semantics.c (add_capture): Capture VLA as ptr+len.
2320 (vla_capture_type): New.
2321 (build_capture_proxy): Rebuild the VLA.
2322 * typeck.c (build_simple_component_ref): Split out from...
2323 (build_ptrmemfunc_access_expr): ...here.
2324 * tree.c (array_of_runtime_bound_p): New.
2325 * init.c (throw_bad_array_length): New.
2326 (build_vec_init): Use it.
2327 * parser.c (cp_convert_range_for): When iterating over a VLA,
2328 use it directly rather than bind a reference.
2329 * cp-tree.h: Declare new functions.
2331 2013-05-08 Jason Merrill <jason@redhat.com>
2333 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
2334 variably_modified_type_p.
2335 (expand_start_catch_block): Mark the typeinfo used here.
2336 * semantics.c (finish_handler_parms): Not here.
2338 * error.c (dump_type_suffix): Try harder on VLA length.
2341 * init.c (throw_bad_array_new_length): New.
2342 (build_new_1): Use it. Don't warn about braced-init-list.
2343 (build_vec_init): Use it.
2344 * call.c (build_operator_new_call): Use it.
2347 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
2348 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
2349 * error.c (maybe_warn_cpp0x): s/0x/11/.
2351 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2354 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
2357 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
2359 * typeck.c (cp_build_binary_op): Call save_expr before
2360 build_vector_from_val.
2362 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2365 * decl.c (cp_finish_decl): After do_auto_deduction copy the
2366 qualifers with cp_apply_type_quals_to_decl.
2368 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2370 * pt.c (convert_nontype_argument): Add missing whitespace in
2373 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2376 * decl.c (build_enumerator): Improve error message.
2378 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2381 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
2382 messages for template types and fix column numbers.
2384 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2387 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
2388 c_inhibit_evaluation_warnings around build_x_modify_expr call.
2390 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2393 * semantics.c (finish_decltype_type): Handle instantiated template
2396 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2399 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
2401 2013-04-26 Jakub Jelinek <jakub@redhat.com>
2403 * error.c (cp_print_error_function): Adjust file_name_as_prefix
2406 2013-04-25 Jason Merrill <jason@redhat.com>
2409 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
2412 * init.c (perform_member_init): Call reshape_init.
2414 2013-04-24 Jason Merrill <jason@redhat.com>
2417 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
2419 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2421 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
2422 pedwarn to simply use OPT_Wpointer_arith.
2423 (cp_build_unary_op): Likewise.
2425 2013-04-24 Jason Merrill <jason@redhat.com>
2427 N3648: init-captures are named.
2428 * semantics.c (add_capture): Don't prepend "__" to init-captures.
2429 (build_capture_proxy): Adjust.
2430 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
2432 N3648: Allow braced and parenthesized initializers.
2433 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
2434 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
2435 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
2436 (add_capture): Collapse a parenthesized initializer into a single
2438 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
2440 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2443 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
2444 * semantics.c (finish_qualified_id_expr): Likewise.
2445 (finish_id_expression): Update.
2446 * typeck.c (cp_build_addr_expr_1): Likewise.
2447 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
2448 * cp-tree.h: Update declarations.
2450 2013-04-22 Jason Merrill <jason@redhat.com>
2453 * parser.c (cp_parser_unqualified_id): Handle ~auto.
2454 (cp_parser_pseudo_destructor_name): Likewise.
2455 (cp_parser_postfix_dot_deref_expression): Adjust.
2456 (cp_lexer_nth_token_is_keyword): New.
2457 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
2458 * typeck.c (lookup_destructor): Handle ~auto.
2460 * pt.c (fn_type_unification): Push tinst level around
2461 type_unification_real if we aren't explaining.
2462 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
2463 * error.c (dump_function_decl): Respect it.
2464 (subst_to_string): Pass it.
2467 * rtti.c (get_typeid): Diagnose qualified function type.
2468 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
2470 * error.c (dump_aggr_type): Fix lambda detection.
2471 (dump_simple_decl): Pretty-print capture field.
2474 * cvt.c (build_expr_type_conversion): Two conversions that return
2475 the same type aren't necessarily ambiguous.
2478 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
2479 pedwarn unconditional except in C++1y mode.
2481 * semantics.c (potential_constant_expression_1): Don't crash on
2485 * semantics.c (finish_id_expression): Reject capture of anonymous
2489 * decl2.c (check_default_args): Check for pack expansion.
2491 * mangle.c (write_type): Mangle decltype(auto).
2493 2013-04-19 Jason Merrill <jason@redhat.com>
2495 N3638 changes to return type deduction
2496 * decl.c (undeduced_auto_decl): New.
2497 (require_deduced_type): New.
2498 (fndecl_declared_return_type): New.
2499 (decls_match): Use it.
2500 (duplicate_decls): Don't check for auto return.
2501 (grokdeclarator): Reject virtual auto.
2502 * class.c (resolve_address_of_overloaded_function): Handle
2503 auto function templates.
2504 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
2505 * cp-tree.h: Declare new fns.
2506 * error.c (dump_function_decl): Use fndecl_declared_return_type.
2507 * search.c (check_final_overrider): Likewise.
2508 * pt.c (make_decltype_auto): New.
2509 (do_auto_deduction): Require plain decltype(auto).
2513 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
2514 template specializations.
2516 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
2518 Implement n3599 - Literal operator templates for strings.
2519 * parser.c (make_string_pack (tree value)): New function.
2520 (cp_parser_userdef_string_literal (cp_token *)): Use it
2521 to construct calls to character string literal operator templates.
2522 (cp_parser_template_declaration_after_export): Check for new string
2523 literal operator template parameter form.
2525 2013-04-15 Jason Merrill <jason@redhat.com>
2527 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
2530 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
2531 rather than a destructor name, it isn't an unqualified-name.
2532 (tsubst_copy_and_build): Pass down decltype_flag to operator
2536 * semantics.c (insert_capture_proxy): Just use index 1 in the
2539 2013-04-12 Jakub Jelinek <jakub@redhat.com>
2541 * error.c (cp_print_error_function,
2542 print_instantiation_partial_context_line,
2543 maybe_print_constexpr_context): Colorize locus strings.
2545 2013-04-11 Jason Merrill <jason@redhat.com>
2548 * parser.c (complain_flags): New.
2549 (cp_parser_postfix_expression): Use it.
2550 (cp_parser_unary_expression): Likewise.
2551 (cp_parser_binary_expression): Likewise.
2552 (cp_parser_assignment_expression): Likewise.
2553 (cp_parser_expression): Likewise.
2554 (cp_parser_postfix_open_square_expression): Take decltype_p.
2555 (cp_parser_builtin_offsetof): Adjust.
2556 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
2557 * decl2.c (grok_array_decl): Add decltype_p parm.
2558 * cp-tree.h: Adjust prototype.
2559 * semantics.c (finish_unary_op_expr): Add complain parm.
2561 2013-04-11 Jakub Jelinek <jakub@redhat.com>
2564 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
2565 calling maybe_constant_value for C++98.
2567 2013-04-11 Jason Merrill <jason@redhat.com>
2570 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
2571 Strip references before checking WILDCARD_TYPE_P.
2573 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2575 * call.c (build_conditional_expr_1, build_over_call): Protect
2576 error calls with complain & tf_error.
2577 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
2578 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
2579 build_ptrmemfunc): Likewise.
2580 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
2582 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
2583 (convert_to_reference): Adjust.
2585 2013-04-11 Jason Merrill <jason@redhat.com>
2587 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
2588 local variables, look them up instead.
2589 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
2590 proxies and substitution in unevaluated context.
2591 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
2592 before the iterators.
2595 * pt.c (uses_deducible_template_parms): New.
2596 (deducible_array_bound, deducible_expression): New.
2597 (deducible_template_args): New.
2598 (unify_one_argument): Call uses_deducible_template_parms.
2600 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2603 * typeck2.c (build_m_component_ref): Protect error calls with
2604 (complain & tf_error).
2606 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2609 * parser.c (cp_parser_enum_specifier): Check for empty
2610 anonymous enums and anonymous scoped enums.
2612 2013-04-10 Jakub Jelinek <jakub@redhat.com>
2615 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
2616 first before calling maybe_constant_value for warn_for_div_by_zero
2617 or invalid shift count warning purposes.
2619 2013-04-09 Jason Merrill <jason@redhat.com>
2622 * rtti.c (build_typeid): Check the address of the argument
2623 rather than looking for an INDIRECT_REF.
2625 2013-04-04 Jason Merrill <jason@redhat.com>
2629 * typeck2.c (abstract_virtuals_error_sfinae): Disable
2630 complete_type again.
2632 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2635 * decl.c (validate_constexpr_redeclaration): Allow an explicit
2636 specialization to be different wrt the constexpr specifier.
2638 2013-04-06 Jason Merrill <jason@redhat.com>
2640 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
2643 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
2645 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
2646 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
2648 2013-04-03 Jason Merrill <jason@redhat.com>
2650 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
2651 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
2652 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
2654 * mangle.c (write_type): When writing a function type with
2655 function-cv-quals, don't add the unqualified type as a
2656 substitution candidate.
2658 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
2661 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
2664 2013-04-03 Jakub Jelinek <jakub@redhat.com>
2667 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
2668 from args to new_args.
2669 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
2670 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
2672 2013-04-02 Jason Merrill <jason@redhat.com>
2675 * mangle.c (write_function_type): Mangle ref-qualifier.
2676 (write_nested_name): Likewise.
2677 (canonicalize_for_substitution): Preserve ref-qualifier.
2678 (write_type): Likewise.
2681 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
2683 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
2685 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
2686 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
2687 (for_each_template_parm_r): Use TYPE_TI_ARGS.
2689 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
2691 * cp-tree.h (TAGGED_TYPE_P): Remove.
2692 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
2693 (TYPE_ANONYMOUS_P): Adjust.
2694 * call.c (build_new_op_1): Likewise.
2695 * class.c (find_abi_tags_r): Likewise.
2696 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
2697 type_is_deprecated): Likewise.
2698 * decl2.c (grokfield, min_vis_r): Likewise.
2699 * pt.c (get_template_info): Likewise.
2700 * tree.c (handle_abi_tag_attribute): Likewise.
2702 2013-04-01 Jason Merrill <jason@redhat.com>
2704 * semantics.c (maybe_constant_value): Check
2705 instantiation_dependent_expression_p.
2706 * pt.c (build_non_dependent_expr): Don't check it here.
2709 * init.c (build_new): Don't try to process an array initializer
2710 at template definition time.
2713 * typeck.c (finish_class_member_access_expr): Handle enum scope.
2716 * parser.c (cp_parser_range_for): Don't try to do auto deduction
2717 in a template if the type of the range is incomplete.
2719 * call.c (add_function_candidate): Take the address of 'this' here.
2720 (build_over_call): And here.
2721 (build_new_method_call_1, build_op_call_1): Not here.
2722 (build_user_type_conversion_1): Or here.
2723 (add_candidates): Adjust.
2725 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
2726 * class.c (same_signature_p): Use type_memfn_quals.
2727 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
2728 FUNCTION_OR_METHOD_TYPE_CHECK.
2729 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
2730 * pt.c (unify): Use static_fn_type.
2732 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
2733 Jason Merrill <jason@redhat.com>
2735 Implement N2439 (ref-qualifiers for 'this')
2736 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
2737 (FUNCTION_RVALUE_QUALIFIED): New.
2738 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
2739 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
2740 (cp_ref_qualifier): New enum.
2741 (cp_declarator): Add ref_qualifier.
2742 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
2743 (cp_parser_direct_declarator): Use it.
2744 (make_call_declarator): Adjust.
2745 (cp_parser_lambda_declarator_opt): Adjust.
2746 * call.c (add_function_candidate): Handle ref-qualifier overload
2747 resolution semantics.
2748 (standard_conversion): Adjust.
2749 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
2750 * decl.c (grokdeclarator): Handle ref-qualifiers.
2751 (grokfndecl): Check for invalid ref-qualifiers.
2752 (static_fn_type, revert_static_member_fn): Adjust.
2753 * decl2.c (build_memfn_type): Handle ref-qualifiers.
2754 (check_classfn): Check them.
2755 (cp_reconstruct_complex_type): Retain them.
2756 * error.c (dump_ref_qualifier): New.
2757 (dump_type_suffix, dump_function_decl): Use it.
2758 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
2759 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
2760 (unify): Retain them.
2761 * tree.c (cp_check_qualified_type): New.
2762 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
2763 (build_ref_qualified_type): New.
2764 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
2765 (cp_build_type_attribute_variant): Keep ref-qualifier.
2766 * typeck.c (merge_types): Keep ref-qualifier.
2767 (structural_comptypes): Compare ref-qualifier.
2768 (type_memfn_rqual): New.
2769 (apply_memfn_quals): Take ref-qual argument.
2770 * typeck2.c (build_m_component_ref): Check ref-qualifier.
2772 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2774 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
2775 (DECL_FUNCTION_TEMPLATE_P): Adjust.
2777 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
2778 pp_cxx_qualified_id): Use get_containing_scope.
2779 * parser.c (cp_parser_class_head): Likewise.
2780 * pt.c (push_template_decl_real): Likewise.
2782 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
2783 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
2785 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
2787 * decl2.c (collect_candidates_for_java_method_aliases): Use
2789 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
2790 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
2791 * decl.c (duplicate_decls): Likewise.
2792 * parser.c (cp_parser_template_declaration_after_export): Likewise,
2793 also DECL_DECLARES_TYPE_P.
2794 * pt.c (instantiate_class_template_1): Likewise.
2795 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
2796 (lookup_field_r): Likewise.
2797 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
2798 (lookup_fnfields_slot_nolazy): Likewise.
2799 * semantics.c (finish_member_declaration): Likewise.
2800 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
2802 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
2804 * pt.c (template_parms_to_args): Fix typo in comment.
2806 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2808 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
2810 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2812 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
2813 (build_op_call_1): Likewise.
2814 (build_over_call): Likewise.
2815 (compare_ics): Likewise.
2816 * class.c (build_base_path): Likewise.
2817 (resolve_address_of_overloaded_function): Likewise.
2818 * cp-tree.h: Likewise.
2819 * cvt.c (cp_convert_to_pointer): Likewise.
2820 (convert_to_reference): Likewise.
2821 (ocp_convert): Likewise.
2822 (convert_force): Likewise, tidy.
2823 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
2824 (pp_cxx_ptr_operator): Likewise.
2825 * decl.c (duplicate_decls): Likewise.
2826 (start_decl): Likewise.
2827 (grok_op_properties): Likewise.
2828 (start_preparsed_function): Likewise.
2829 (store_parm_decls): Likewise.
2830 (finish_function): Likewise.
2831 * decl2.c (delete_sanity): Likewise.
2832 (acceptable_java_type): Likewise.
2833 (grokbitfield): Likewise.
2834 (cp_reconstruct_complex_type): Likewise.
2835 * error.c (dump_type_prefix): Likewise.
2836 (dump_expr): Likewise.
2837 * except.c (push_eh_cleanup): Likewise.
2838 (complete_ptr_ref_or_void_ptr_p): Likewise.
2839 (can_convert_eh): Likewise.
2840 * init.c (build_new_1): Likewise.
2841 (build_delete): Likewise.
2842 (build_vec_delete): Likewise.
2843 * mangle.c (write_type): Likewise.
2844 * parser.c (lookup_literal_operator): Likewise.
2845 * pt.c (convert_nontype_argument_function): Likewise.
2846 (convert_nontype_argument): Likewise.
2849 (dependent_type_p_r): Likewise.
2850 * rtti.c (build_headof): Likewise.
2851 (build_typeid): Likewise.
2852 (build_dynamic_cast_1): Likewise.
2853 (target_incomplete_p): Likewise.
2854 (typeinfo_in_lib_p): Likewise.
2855 * semantics.c (finish_omp_for): Likewise.
2856 (cxx_eval_call_expression): Likewise.
2857 (maybe_resolve_dummy): Likewise.
2858 * tree.c (build_target_expr): Likewise.
2859 (cp_build_qualified_type_real): Likewise.
2860 * typeck.c (composite_pointer_type_r): Likewise.
2861 (composite_pointer_type): Likewise.
2862 (comp_except_types): Likewise.
2863 (cxx_sizeof_nowarn): Likewise.
2864 (string_conv_p): Likewise.
2865 (cp_build_array_ref): Likewise.
2866 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
2867 (pointer_diff): Likewise.
2868 (cp_build_addr_expr_1): Likewise.
2869 (cp_build_unary_op): Likewise.
2870 (build_static_cast_1): Likewise.
2871 (cp_build_c_cast): Likewise.
2872 (comp_ptr_ttypes_real): Likewise.
2873 (ptr_reasonably_similar): Likewise.
2874 (comp_ptr_ttypes_const): Likewise.
2875 (casts_away_constness): Likewise.
2876 (check_literal_operator_args): Likewise.
2877 * typeck2.c (build_x_arrow): Likewise.
2878 (add_exception_specifier): Likewise.
2880 2013-03-29 Jason Merrill <jason@redhat.com>
2883 * cp-tree.h (AUTO_IS_DECLTYPE): New.
2884 * parser.c (cp_parser_decltype): Handle decltype(auto).
2885 (cp_parser_type_id_1): Allow auto without a late-specified
2887 (cp_parser_primary_expression): Use the return value of
2888 finish_parenthesized_expr.
2889 (cp_parser_transaction_expression): Likewise.
2890 * semantics.c (force_paren_expr): New.
2891 (finish_parenthesized_expr): Use it.
2892 * call.c (build_conditional_expr_1): Likewise.
2893 * pt.c (do_auto_deduction): Handle decltype(auto).
2894 (tsubst_copy): Handle PAREN_EXPR.
2895 (tsubst_copy_and_build): Likewise.
2896 * error.c (dump_expr): Handle PAREN_EXPR.
2897 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
2898 * mangle.c (write_expression): Ignore PAREN_EXPR.
2900 * parser.c (cp_parser_decltype_expr): Split out...
2901 (cp_parser_decltype): ...from here.
2905 * pt.c (unify_pack_expansion): Fix indexing.
2907 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
2909 * call.c (build_java_interface_fn_ref): Likewise.
2910 (make_temporary_var_for_ref_to_temp): Likewise.
2911 * class.c (check_field_decls): Likewise.
2912 (layout_class_type): Likewise.
2913 (finish_struct_1): Likewise.
2914 (fixed_type_or_null): Likewise.
2915 (get_vtbl_decl_for_binfo): Likewise.
2916 * cp-gimplify.c (omp_var_to_track): Likewise.
2917 (cp_genericize_r): Likewise.
2918 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
2919 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
2920 (DECL_DISCRIMINATOR_P): Likewise.
2921 * decl.c (poplevel): Likewise.
2922 (decls_match): Likewise.
2923 (duplicate_decls): Likewise.
2924 (decl_jump_unsafe): Likewise.
2925 (start_decl): Likewise.
2926 (check_for_uninitialized_const_var): Likewise.
2927 (make_rtl_for_nonlocal_decl): Likewise.
2928 (cp_finish_decl): Likewise.
2929 (expand_static_init): Likewise.
2930 (local_variable_p): Likewise.
2931 (maybe_register_incomplete_var): Likewise.
2932 * decl2.c (grokfield): Likewise.
2933 (comdat_linkage): Likewise.
2934 (determine_visibility): Likewise.
2935 (import_export_decl): Likewise.
2936 (prune_vars_needing_no_initialization): Likewise.
2937 (decl_maybe_constant_var_p): Likewise.
2938 * error.c (dump_simple_decl): Likewise.
2939 (dump_template_decl): Likewise.
2940 (cp_printer): Likewise.
2941 * except.c (build_throw): Likewise.
2942 * init.c (build_vtbl_address): Likewise.
2943 (member_init_ok_or_else): Likewise.
2944 (build_aggr_init): Likewise.
2945 (expand_aggr_init_1): Likewise.
2946 (build_offset_ref): Likewise.
2947 (constant_value_1): Likewise.
2948 * mangle.c (write_mangled_name): Likewise.
2949 (write_prefix): Likewise.
2950 * name-lookup.c (supplement_binding_1): Likewise.
2951 (add_decl_to_level): Likewise.
2952 (pushdecl_maybe_friend_1): Likewise.
2953 (check_for_out_of_scope_variable): Likewise.
2954 (validate_nonmember_using_decl): Likewise.
2955 (lookup_name_innermost_nonclass_level_1): Likewise.
2956 (lookup_arg_dependent_1): Likewise.
2957 * parser.c (cp_parser_lambda_introducer): Likewise.
2958 (cp_parser_template_argument): Likewise.
2959 (cp_parser_single_declaration): Likewise.
2960 * pt.c (convert_nontype_argument): Likewise.
2961 (instantiate_class_template_1): Likewise.
2962 (tsubst_decl): Likewise.
2963 (tsubst_expr): Likewise.
2964 (do_decl_instantiation): Likewise.
2965 (do_type_instantiation): Likewise.
2966 (regenerate_decl_from_template): Likewise.
2967 (always_instantiate_p): Likewise.
2968 (instantiate_decl): Likewise.
2969 (type_dependent_expression_p): Likewise.
2970 (build_non_dependent_expr): Likewise.
2971 * repo.c (repo_emit_p): Likewise.
2972 * rtti.c (build_dynamic_cast_1): Likewise.
2973 * search.c (shared_member_p): Likewise.
2974 * semantics.c (outer_var_p): Likewise.
2975 (finish_id_expression): Likewise.
2976 (finish_omp_clauses): Likewise.
2977 (finish_decltype_type): Likewise.
2978 (ensure_literal_type_for_constexpr_object): Likewise.
2979 * tree.c (lvalue_kind): Likewise.
2980 (bot_replace): Likewise.
2981 (cp_tree_equal): Likewise.
2982 (handle_init_priority_attribute): Likewise.
2983 (decl_storage_duration): Likewise.
2984 * typeck.c (cxx_sizeof_expr): Likewise.
2985 (cxx_alignof_expr): Likewise.
2986 (decay_conversion): Likewise.
2987 (build_class_member_access_expr): Likewise.
2988 (cp_build_array_ref): Likewise.
2989 (cxx_mark_addressable): Likewise.
2990 (maybe_warn_about_returning_address_of_local): Likewise.
2991 (check_return_expr): Likewise.
2992 * typeck2.c (cxx_readonly_error): Likewise.
2993 (abstract_virtuals_error_sfinae): Likewise.
2994 (cxx_incomplete_type_diagnostic): Likewise.
2996 2013-03-28 Lawrence Crowl <crowl@google.com>
2999 (CXX_PARSER_H): Add header dependence.
3001 (extern debug (cp_binding_level &)): New.
3002 (extern debug (cp_binding_level *)): New.
3004 (debug (cp_binding_level &)): New.
3005 (debug (cp_binding_level *)): New.
3007 (debug (cp_parser &)): New.
3008 (debug (cp_parser *)): New.
3009 (debug (cp_token &)): New.
3010 (debug (cp_token *)): New.
3011 (debug (vec<cp_token, va_gc> &)): New.
3012 (debug (vec<cp_token, va_gc> *)): New.
3013 * parser.c: Add header dependence.
3014 (extern debug (cp_parser &)): New.
3015 (extern debug (cp_parser *)): New.
3016 (extern debug (cp_token &)): New.
3017 (extern debug (cp_token *)): New.
3018 (extern debug (vec<cp_token, va_gc> &)): New.
3019 (extern debug (vec<cp_token, va_gc> *)): New.
3021 2013-03-28 Jason Merrill <jason@redhat.com>
3025 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
3026 the type if tf_decltype is set.
3027 * pt.c (fn_type_unification): Add decltype_p parm.
3028 (get_bindings): Adjust.
3029 * cp-tree.h: Adjust.
3030 * class.c (resolve_address_of_overloaded_function): Adjust.
3031 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
3034 * parser.c (cp_parser_sizeof_pack): Split out from...
3035 (cp_parser_sizeof_operand): ...here. Require (id).
3038 * semantics.c (finish_this_expr): 'this' is an rvalue.
3039 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
3042 * semantics.c (finish_member_declaration): Don't push closure
3045 * name-lookup.c (pushdecl_maybe_friend_1): Use
3046 nonlambda_method_basetype and current_nonlambda_class_type.
3049 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
3050 conversion from integer to pointer.
3051 (cxx_eval_constant_expression): Likewise.
3052 (cxx_eval_indirect_ref): Use the folded operand if we still think
3053 this might be constant.
3055 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
3056 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3059 * call.c (convert_like_real): Change series of two permerrors
3060 to permerror + inform (and likewise for two errors).
3061 (build_new_method_call_1): Likewise.
3062 * typeck.c (convert_for_initialization): Change additional
3063 warning or error to inform.
3065 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3067 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
3068 (first_aggr_init_expr): Likewise.
3069 (more_aggr_init_expr_args_p): Likewise.
3070 (type_of_this_parm): Likewise.
3071 (class_of_this_parm): Likewise.
3072 * name-lookup.h (get_global_value_if_present): Likewise.
3073 (is_typename_at_global_scope): Likewise.
3075 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
3077 * call.c (joust): Don't call inform for a permerror returning false.
3078 * parser.c (cp_parser_check_class_key): Likewise.
3079 * pt.c (tsubst_copy_and_build): Likewise.
3081 2013-03-27 Jason Merrill <jason@redhat.com>
3084 * semantics.c (finish_qualified_id_expr): Return early
3087 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
3089 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
3090 * cvt.c (convert_to_void): Likewise.
3091 * error.c (dump_expr): Likewise.
3092 * mangle.c (write_expression): Likewise.
3093 * parser.c (cp_parser_template_argument): Likewise.
3094 * pt.c (convert_nontype_argument): Likewise.
3095 (tsubst_copy_and_build): Likewise.
3096 * rtti.c (build_typeid): Likewise.
3097 * semantics.c (finish_call_expr): Likewise.
3098 (finish_decltype_type): Likewise.
3099 (build_data_member_initialization): Likewise.
3100 * tree.c (is_dummy_object): Likewise.
3101 * typeck.c (decay_conversion): Likewise.
3102 (build_class_member_access_expr): Likewise.
3103 (cp_build_addr_expr_1): Likewise.
3104 (unary_complex_lvalue): Likewise.
3105 (check_return_expr): Likewise.
3106 * typeck2.c (cxx_readonly_error): Likewise.
3108 2013-03-26 Jason Merrill <jason@redhat.com>
3111 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
3112 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
3113 * cp-tree.h: Adjust prototype.
3116 * typeck2.c (build_m_component_ref): Handle prvalue object.
3118 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
3120 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
3121 * decl.c (duplicate_decls): Likewise.
3122 (cp_finish_decl): Likewise.
3123 (check_class_member_definition_namespace): Likewise.
3124 * decl2.c (grokfield): Likewise.
3125 (decl_needed_p): Likewise.
3126 (import_export_decl): Likewise.
3127 (mark_used): Likewise.
3128 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
3129 * pt.c (push_access_scope): Likewise.
3130 (instantiate_decl): Likewise.
3131 * ptree.c (cxx_print_decl): Likewise.
3132 * repo.c (repo_emit_p): Likewise.
3133 * semantics.c (note_decl_for_pch): Likewise.
3134 * tree.c (decl_linkage): Likewise.
3136 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3139 * decl.c (check_array_designated_initializer): Handle CONST_DECL
3142 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3144 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
3147 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
3149 2013-03-25 Jason Merrill <jason@redhat.com>
3152 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
3153 class is derived from the type of the object.
3156 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
3157 unevaluated context.
3159 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
3162 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
3163 DECL_TEMPLATE_INSTANTIATION.
3165 2013-03-22 Jason Merrill <jason@redhat.com>
3168 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
3171 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
3173 * cp-tree.h (identifier_p): New.
3174 * call.c: Throughout, call identifier_p insstead of direct
3175 comparaison of TREE_CODE against IDENTIFIER_NODE.
3176 * decl.c: Likewisse.
3177 * decl2.c: Likewise.
3179 * mangle.c: Likewise.
3180 * name-lookup.c: Likewise.
3181 * parser.c: Likewise.
3183 * search.c: Likewise.
3184 * semantics.c: Likewise.
3186 * typeck.c: Likewise.
3187 * typeck2.c: Likewise.
3189 2013-03-21 Jakub Jelinek <jakub@redhat.com>
3192 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
3193 * call.c (build_temp): Likewise.
3194 * method.c (synthesize_method): Likewise.
3195 * typeck.c (convert_for_initialization): Likewise.
3197 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
3199 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
3201 2013-03-21 Richard Biener <rguenther@suse.de>
3203 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
3204 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
3206 2013-03-20 Jason Merrill <jason@redhat.com>
3209 * parser.c (cp_parser_late_return_type_opt): Save and restore
3210 current_class_ptr/ref.
3213 * expr.c (cplus_expand_constant): Do nothing if the class is
3215 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
3216 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
3217 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
3218 (complete_vars): Likewise.
3220 * name-lookup.c (get_anonymous_namespace_name): Never use
3221 get_file_function_name.
3223 * pt.c (retrieve_specialization): Handle null tmpl argument.
3227 * pt.c (tsubst_decl): Check return value of register_specialization.
3228 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
3231 2013-03-17 Jason Merrill <jason@redhat.com>
3235 * parser.c (cp_parser_direct_declarator): Bail if we see a
3236 qualified-id not at namespace scope.
3240 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
3243 2013-03-16 Jason Merrill <jason@redhat.com>
3245 * decl.c (grokdeclarator): Assert that we won't see a pointer to
3249 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
3250 (MAYBE_CLASS_TYPE_P): ...here.
3251 * semantics.c (lambda_capture_field_type): Only build a
3252 magic decltype for wildcard types.
3253 (lambda_proxy_type): Likewise.
3254 (finish_non_static_data_member): Get the quals from
3258 * parser.c (cp_parser_template_argument): Don't
3259 fold_non_dependent_expr.
3261 * parser.c (cp_parser_lambda_declarator_opt): Use
3262 cp_parser_trailing_type_id.
3265 * parser.c (cp_parser_template_id): Don't forget access checks.
3268 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
3272 * name-lookup.h (tag_scope): Add ts_lambda.
3273 * semantics.c (begin_lambda_type): Use it.
3274 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
3275 * pt.c (check_default_tmpl_args): Ignore lambdas.
3276 (push_template_decl_real): Handle lambdas.
3277 * tree.c (no_linkage_check): Adjust lambda check.
3280 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
3283 * parser.c (cp_parser_direct_declarator): Fix late return
3284 for out-of-class defn of member function.
3287 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
3288 parms to avoid duplicate -Wshadow warnings.
3290 * search.c (lookup_base): Handle NULL_TREE.
3293 * semantics.c (potential_constant_expression_1): Use of 'this' in
3294 a non-constexpr function makes the expression not potentially
3299 * cp-tree.h (tsubst_flags): Add tf_decltype.
3300 * call.c (build_cxx_call): Don't build a temporary if it's set.
3301 (build_over_call): Make sure it's only passed to build_cxx_call.
3302 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
3303 (cp_parser_unary_expression): Likewise.
3304 (cp_parser_cast_expression): Likewise.
3305 (cp_parser_binary_expression): Likewise.
3306 (cp_parser_assignment_expression): Likewise.
3307 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
3308 (cp_parser_expression): Add decltype_p. Force a
3309 temporary for a call on the LHS of a comma.
3310 (cp_parser_decltype): Pass true to decltype_p parms.
3311 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
3312 (tsubst_copy_and_build): Pass tf_decltype down only for
3313 CALL_EXPR and the RHS of COMPOUND_EXPR.
3314 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
3316 * cp-tree.h (abstract_class_use): New enum.
3317 * typeck2.c (pending_abstract_type): Add use field.
3318 (abstract_virtuals_error_sfinae): Add overloads taking
3319 abstract_class_use instead of tree.
3320 * typeck.c (build_static_cast_1): Call it.
3321 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
3322 * pt.c: Adjust calls.
3323 * decl.c (cp_finish_decl): Don't handle functions specially.
3324 (grokdeclarator): Always check return type.
3325 * init.c (build_new_1): Adjust call.
3329 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
3330 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
3333 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
3334 (tsubst_arg_types): Likewise.
3338 * call.c (convert_like_real): Check for explicit constructors
3339 even for value-initialization.
3342 * pt.c (convert_nontype_argument): Handle invalid pointer.
3344 * parser.c (cp_parser_lambda_expression): Use nreverse.
3348 * pt.c (instantiate_class_template_1): Instantiate lambda capture
3350 (tsubst_copy_and_build): Not here.
3353 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
3356 * parser.c (parsing_nsdmi): New.
3357 * semantics.c (outer_automatic_var_p): Check it.
3358 (finish_id_expression): Likewise.
3359 * cp-tree.h: Declare it.
3362 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
3364 * parser.c (lookup_literal_operator): Correct parm/arg naming
3368 * pt.c (fold_non_dependent_expr_sfinae): Check
3369 instantiation_dependent_expression_p.
3372 * class.c (resolve_address_of_overloaded_function): Accept a
3373 reference to function for target_type.
3374 (instantiate_type): Likewise.
3375 * pt.c (convert_nontype_argument): Pass it to
3376 convert_nontype_argument_function.
3378 2013-03-16 Jakub Jelinek <jakub@redhat.com>
3380 * tree.c (cp_tree_equal): Fix a pasto.
3383 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
3384 pass op1 through maybe_constant_value first.
3386 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
3389 * semantics.c (cxx_eval_array_reference): Check for negative index.
3391 2013-03-14 Jason Merrill <jason@redhat.com>
3394 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
3397 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
3398 dso_handle parm on targets without __cxa_atexit.
3400 2013-03-11 Jason Merrill <jason@redhat.com>
3403 * typeck.c (check_return_expr): Disallow returning init list here.
3404 * semantics.c (apply_deduced_return_type): Not here.
3406 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
3409 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
3410 * error.c (dump_expr): Likewise.
3412 2013-03-08 Jason Merrill <jason@redhat.com>
3415 * class.c (modify_all_vtables): Mangle the vtable name before
3418 * semantics.c (lambda_expr_this_capture): In unevaluated context,
3419 just return the nearest 'this'.
3424 * tree.c (maybe_dummy_object): Don't capture 'this'.
3425 * semantics.c (maybe_resolve_dummy): New.
3426 (finish_non_static_data_member): Use it.
3427 (finish_qualified_id_expr): Don't test is_dummy_object.
3428 * cp-tree.h: Declare maybe_resolve_dummy.
3429 * call.c (build_new_method_call_1): Use it.
3432 * semantics.c (apply_deduced_return_type): Don't allow returning
3433 std::initializer_list.
3435 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
3438 * parser.c (cp_parser_elaborated_type_specifier): Don't call
3439 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
3440 * decl.c (check_elaborated_type_specifier): Tidy.
3442 2013-03-06 Jakub Jelinek <jakub@redhat.com>
3445 * tree.c (strip_typedefs): Don't copy args if they are NULL.
3447 2013-03-05 Jakub Jelinek <jakub@redhat.com>
3449 * parser.c (cp_parser_braced_list): For {} initialize
3450 *non_constant_p to false.
3452 2013-03-04 Jason Merrill <jason@redhat.com>
3456 * semantics.c (lambda_expr_this_capture): Handle NSDMI
3457 and non-class scopes.
3459 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
3461 * decl.c (grokdeclarator): Remove dead code.
3463 2013-02-28 Jason Merrill <jason@redhat.com>
3466 * semantics.c (potential_constant_expression_1): Use
3467 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
3470 * call.c (build_over_call): Avoid virtual lookup in a template.
3472 2013-02-27 Jason Merrill <jason@redhat.com>
3476 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
3477 of the base name for inheriting ctors.
3478 (push_class_level_binding_1): Remove inheriting ctor handling.
3479 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3480 * class.c (add_implicitly_declared_members): Adjust.
3482 2013-02-26 David Binderman <dcb314@hotmail.com>
3485 * decl.c (grokdeclarator): Tidy publicp assignment.
3487 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
3490 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
3491 (build_transaction_expr): Same.
3493 2013-02-25 Jason Merrill <jason@redhat.com>
3496 * pt.c (fn_type_unification): Wait to call push_tinst_level until
3497 we know what args we're looking at.
3500 * semantics.c (potential_constant_expression_1): In C++98, a cast
3501 to non-integral type can't be a constant expression.
3503 2013-02-24 Jakub Jelinek <jakub@redhat.com>
3506 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
3509 2013-02-22 Jason Merrill <jason@redhat.com>
3512 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
3513 if we got the wrong number of template parms.
3516 * pt.c (fn_type_unification): Use explicit args in template
3517 instantiation context.
3520 * call.c (can_convert_arg): Discard access checks.
3523 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
3526 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
3529 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
3530 * cvt.c (ocp_convert): Use the latter.
3531 (cp_convert_to_pointer): Likewise.
3532 * decl.c (check_default_argument): Likewise.
3533 * typeck.c (cp_build_binary_op): Likewise.
3534 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
3536 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
3537 Paolo Carlini <paolo.carlini@oracle.com>
3540 * decl2.c (grokbitfield): Allow scoped enumeration types.
3542 2013-02-15 Jason Merrill <jason@redhat.com>
3545 * semantics.c (finish_id_expression): Also return the identifier
3546 for an outer local static.
3549 * class.c (check_bases_and_members): Deduce noexcept after
3553 * semantics.c (finish_id_expression): In a template, return
3554 the identifier for a constant variable.
3556 2013-02-14 Jason Merrill <jason@redhat.com>
3559 * semantics.c (build_anon_member_initialization): New.
3560 (build_data_member_initialization): Use it.
3563 * decl.c (cp_finish_decl): Force instantiation of an
3564 auto static data member.
3567 * pt.c (unify): A pack expansion that is not the last template
3568 argument makes the entire template argument list non-deduced.
3571 * name-lookup.c (do_class_using_decl): Handle typedefs with
3572 inheriting constructors.
3573 (push_class_level_binding_1): Allow inheriting from template
3574 template parameter, too.
3575 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3578 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
3579 default argument scope.
3580 * mangle.c (write_name): Likewise.
3583 * error.c (find_typenames_r): Don't walk into a pack expansion.
3585 2013-02-13 Jason Merrill <jason@redhat.com>
3588 * parser.c (cp_parser_member_declaration): Check the declarator
3589 form when detecting a function declaration via typedef.
3592 * pt.c (maybe_process_partial_specialization): A lambda
3593 isn't what's being specialized.
3596 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
3600 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
3603 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
3604 non-zero offsets, too.
3607 * decl.c (build_enumerator): Always convert the value to a
3608 fixed underlying type.
3611 * pt.c (tsubst_copy_and_build): Don't forget any new
3612 captures that arose from use of dependent names.
3614 2013-02-13 Jakub Jelinek <jakub@redhat.com>
3617 * semantics.c (finish_asm_stmt): If input constraints allow
3618 neither register nor memory, try maybe_constant_value to get
3619 a constant if possible.
3621 2013-02-12 Jason Merrill <jason@redhat.com>
3624 * method.c (add_one_base_init): Handle base constructor
3625 taking rvalue reference parm.
3628 * semantics.c (sort_constexpr_mem_initializers): Handle
3631 2013-02-09 Jason Merrill <jason@redhat.com>
3634 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
3635 maybe_instantiate_noexcept.
3638 * pt.c (eq_specializations): Set comparing_specializations.
3639 * tree.c (cp_tree_equal): Check it.
3640 * cp-tree.h: Declare it.
3642 * decl.c (decls_match): Check versions later.
3645 * pt.c (build_non_dependent_expr): Don't try to fold
3646 instantiation-dependent expressions.
3647 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
3648 [BIND_EXPR]: Treat as dependent.
3650 2013-02-07 Jakub Jelinek <jakub@redhat.com>
3653 * init.c (build_vec_init): Don't append NULL values into new_vec.
3654 (build_zero_init_1): Don't push anything into v if recursive call
3656 (build_value_init_noctor): Don't push anything into v if
3657 build_value_init call returned NULL_TREE.
3660 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
3661 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
3662 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
3663 return true only if 2nd token isn't CPP_CLOSE_PAREN.
3664 (cp_parser_cast_expression): Adjust caller.
3667 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
3668 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
3669 DECL_LANG_SPECIFIC (t).
3671 2013-02-07 Jason Merrill <jason@redhat.com>
3674 * method.c (do_build_copy_constructor): Don't bother turning
3675 scalars from lvalues to xvalues.
3676 (do_build_copy_assign): Likewise.
3678 2013-02-06 Jason Merrill <jason@redhat.com>
3680 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
3682 2013-02-05 Jason Merrill <jason@redhat.com>
3685 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
3689 * decl.c (start_preparsed_function): Update restype if we change
3693 * pt.c (fn_type_unification): Discard any access checks from
3694 substituting explicit args.
3696 2013-01-31 Jason Merrill <jason@redhat.com>
3700 * typeck.c (get_member_function_from_ptrfunc): Fix
3701 ptrmemfunc_vbit_in_delta case.
3703 2013-01-29 Jason Merrill <jason@redhat.com>
3706 * class.c (build_ctor_vtbl_group): Give construction vtables
3709 2013-01-25 Jason Merrill <jason@redhat.com>
3712 * pt.c (convert_nontype_argument_function): Handle invalid input.
3713 (convert_nontype_argument): Likewise.
3716 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
3717 dynamic type has no virtual functions.
3719 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
3722 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
3723 on TARGET_EXPR nodes.
3725 2013-01-22 Jason Merrill <jason@redhat.com>
3728 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
3730 2013-01-22 Dodji Seketeli <dodji@redhat.com>
3733 * pt.c (argument_pack_element_is_expansion_p)
3734 (make_argument_pack_select, use_pack_expansion_extra_args_p)
3735 (gen_elem_of_pack_expansion_instantiation): New static functions.
3736 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
3737 look through the possibly resulting pack expansion as well.
3738 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
3739 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
3740 Use gen_elem_of_pack_expansion_instantiation to build the
3741 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
3742 as gen_elem_of_pack_expansion_instantiation and the change in
3743 tsubst above generalize this particular case.
3744 (arg_from_parm_pack_p): Remove this for it's not used by
3745 tsubst_pack_expansion anymore.
3747 2013-01-21 Jason Merrill <jason@redhat.com>
3750 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
3751 template args count.
3753 2013-01-18 Jason Merrill <jason@redhat.com>
3756 * decl2.c (get_local_tls_init_fn): New.
3757 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
3758 with aliases for internal variables. Don't use weakrefs if
3759 the variable needs destruction.
3760 (generate_tls_wrapper): Mark the wrapper as const if no
3761 initialization is needed.
3762 (handle_tls_init): Don't require aliases.
3764 2013-01-15 Dodji Seketeli <dodji@redhat.com>
3767 * pt.c (coerce_innermost_template_parms): New static function.
3768 (instantiate_alias_template): Use it here.
3770 2013-01-09 Jason Merrill <jason@redhat.com>
3773 * rtti.c (build_typeid, get_typeid): Add complain parm.
3774 (get_tinfo_decl_dynamic): Likewise.
3775 * cp-tree.h, parser.c, pt.c: Adjust.
3778 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
3781 2013-01-09 Jakub Jelinek <jakub@redhat.com>
3784 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
3785 call maybe_constant_value for the negative or too big shift
3788 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
3791 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
3792 of the argument is true.
3794 2013-01-08 Joel Brobecker <brobecker@adacore.com>
3796 * parser.c (cp_parser_initializer_list): Move declaration
3797 of variable non_const to start of lexical block.
3799 2013-01-07 Jason Merrill <jason@redhat.com>
3802 * tree.c (build_aggr_init_expr): Do nothing in a template.
3803 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
3804 a FUNCTION_DECL before tsubsting.
3806 2013-01-04 Dodji Seketeli <dodji@redhat.com>
3809 * pt.c (check_instantiated_arg): Allow type template arguments.
3811 2013-01-04 Jason Merrill <jason@redhat.com>
3814 * decl.c (reset_type_linkage, bt_reset_linkage): New.
3815 (grokdeclarator): Use reset_type_linkage.
3816 * name-lookup.c (binding_table_foreach): Handle null table.
3817 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
3819 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3821 PR c++/54526 (again)
3822 * parser.c (cp_parser_template_id): Revert core of previous change
3823 (keep adjusted inform message).
3825 2013-01-03 Jason Merrill <jason@redhat.com>
3829 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
3833 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
3836 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
3839 * call.c (type_has_extended_temps): New.
3840 * cp-tree.h: Declare it.
3841 * decl.c (check_initializer): Use build_aggr_init for arrays
3843 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
3845 2013-01-02 Jason Merrill <jason@redhat.com>
3848 * call.c (build_new_method_call_1): Don't use build_value_init for
3849 user-provided default constructors.
3851 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
3855 * tree.c (build_cplus_array_type): Copy layout information
3856 to main variant if necessary.
3858 Copyright (C) 2013 Free Software Foundation, Inc.
3860 Copying and distribution of this file, with or without modification,
3861 are permitted in any medium without royalty provided the copyright
3862 notice and this notice are preserved.