1 2013-11-05 Jason Merrill <jason@redhat.com>
4 * decl.c (check_initializer): Don't use build_vec_init for arrays
7 2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
10 * name-lookup.c (handle_namespace_attrs): Use get_attribute_name.
12 2013-11-05 Tobias Burnus <burnus@net-b.de>
14 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
15 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
16 cp_parser_omp_declare): Handle -fopenmp-simd.
18 2013-11-04 Eric Botcazou <ebotcazou@adacore.com>
20 * decl2.c (cpp_check): Change type of first parameter and deal with
23 2013-11-03 Paolo Carlini <paolo.carlini@oracle.com>
26 * parser.c (cp_parser_constructor_declarator_p): Check that the
27 class-name matches current_class_type.
29 2013-11-03 Marek Polacek <polacek@redhat.com>
31 * decl.c (cp_finish_decl): Move C++1y bounds checking...
32 (compute_array_index_type): ...here. Add VLA instrumentation.
33 Call stabilize_vla_size.
34 (grokdeclarator): Don't call stabilize_vla_size here.
36 2013-11-02 Paolo Carlini <paolo.carlini@oracle.com>
40 * parser.c (cp_parser_cast_expression): If we aren't looking at
41 a cast-expression don't call cp_parser_type_id.
42 (cp_parser_postfix_expression): Likewise for compound-literal.
43 (cp_parser_tokens_start_cast_expression): Adjust.
45 2013-11-01 Edward Smith-Rowland <3dw4rd@verizon.net>
48 * parser.c (make_string_pack): Discover non-const type and size
49 of character and build parm pack with correct type and chars.
51 2013-11-01 Trevor Saunders <tsaunders@mozilla.com>
53 * semantics.c (build_anon_member_initialization): Convert fields to be
56 2013-11-01 Marc Glisse <marc.glisse@inria.fr>
59 * pt.c (type_dependent_expression_p): Handle null argument.
61 2013-11-01 Jakub Jelinek <jakub@redhat.com>
63 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
64 check_dup_generic at the end, unless remove is true.
65 (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
68 2013-10-31 Jakub Jelinek <jakub@redhat.com>
70 * semantics.c (finish_omp_clauses): Diagnose aligned clause
71 with decl that is not pointer nor array nor reference to those.
73 2013-10-31 Jason Merrill <jason@redhat.com>
75 * semantics.c (cxx_eval_call_expression): Handle trivial
77 * typeck2.c (store_init_value): Call maybe_constant_init after
80 * decl.c (cxx_maybe_build_cleanup): Always set LOOKUP_NONVIRTUAL.
81 * decl2.c (build_cleanup): Just call cxx_maybe_build_cleanup.
84 * parser.c (cp_parser_late_parse_one_default_arg): Set
85 TARGET_EXPR_DIRECT_INIT_P.
87 * class.c (type_build_ctor_call): Return early in C++98 mode.
88 (type_build_dtor_call): Likewise.
90 2013-10-31 Paolo Carlini <paolo.carlini@oracle.com>
94 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
97 * pt.c (most_specialized_class): Bump processing_template_decl for
100 2013-10-30 Paolo Carlini <paolo.carlini@oracle.com>
103 * call.c (build_over_call): Check return value of mark_used.
105 2013-10-30 Jason Merrill <jason@redhat.com>
107 * semantics.c (finish_compound_literal): Don't create a static variable
108 inside cp_unevaluated_operand.
110 * init.c (push_base_cleanups): Check ANON_AGGR_TYPE_P.
112 2013-10-30 Tobias Burnus <burnus@net-b.de>
115 * cp-tree.h (RANGE_FOR_IVDEP): Define.
116 (cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
117 finish_for_cond): Take 'bool ivdep' parameter.
118 * cp-array-notation.c (create_an_loop): Update call.
119 * init.c (build_vec_init): Ditto.
120 * pt.c (tsubst_expr): Ditto.
121 * parser.c (cp_parser_iteration_statement, cp_parser_for,
122 cp_parser_range_for, cp_convert_range_for): Update calls.
123 (cp_parser_pragma): Accept GCC ivdep for 'while' and 'do'.
124 * semantics.c (finish_while_stmt_cond, finish_do_stmt,
125 finish_for_cond): Optionally build ivdep annotation.
127 2013-10-30 Jason Merrill <jason@redhat.com>
129 * decl.c (cp_finish_decl): Never throw for VLA bound == 0.
131 2013-10-29 David Malcolm <dmalcolm@redhat.com>
133 Patch autogenerated by refactor_symtab.py from
134 https://github.com/davidmalcolm/gcc-refactoring-scripts
135 revision 58bb219cc090b2f4516a9297d868c245495ee622
137 * call.c (mark_versions_used): Update for conversion of symtab types
138 to a true class hierarchy.
139 * decl2.c (cp_write_global_declarations): Likewise.
140 (clear_decl_external): Likewise.
141 (build_java_method_aliases): Likewise.
142 (collect_candidates_for_java_method_aliases): Likewise.
143 (mark_needed): Likewise.
144 (var_finalized_p): Likewise.
145 (maybe_make_one_only): Likewise.
146 (maybe_emit_vtables): Likewise.
147 * lambda.c (maybe_add_lambda_conv_op): Likewise.
148 * method.c (use_thunk): Likewise.
149 * optimize.c (maybe_clone_body): Likewise.
150 * tree.c (cp_fix_function_decl_p): Likewise.
152 2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
155 * decl2.c (grokfield): Handle auto like NSDMI.
157 2013-10-25 Paolo Carlini <paolo.carlini@oracle.com>
160 * pt.c (check_template_shadow): Don't skip declarations in inline
163 2013-10-25 Tobias Burnus <burnus@net-b.de>
166 * parser.c (cp_parser_iteration_statement,
167 cp_parser_for, cp_parser_c_for, cp_parser_pragma): Handle
170 2013-10-24 Marek Polacek <polacek@redhat.com>
173 * typeck2.c (check_narrowing): Don't check narrowing when the scalar
174 initializer is empty.
176 2013-10-23 Jason Merrill <jason@redhat.com>
179 * method.c (defaulted_late_check): Delete on eh-spec mismatch.
180 (maybe_explain_implicit_delete): Explain it.
182 * error.c (eh_spec_to_string): New.
183 (cp_printer): Use it for %X.
185 In C++11 a trivial [cd]tor might not be callable.
186 * class.c (user_provided_p): A function deleted on its declation
187 in the class is not user-provided.
188 (type_build_ctor_call): Also force a ctor call if we
189 might have a deleted or private trivial ctor.
190 (type_build_dtor_call): New.
191 (deduce_noexcept_on_destructors): Remove obsolete code.
192 * cp-tree.h: Declare type_build_dtor_call.
193 * decl.c (expand_static_init): Make sure trivial dtors are callable.
194 (cxx_maybe_build_cleanup): Likewise.
195 * except.c (build_throw): Likewise.
196 * init.c (build_value_init): Handle trivial but not callable ctors.
197 (perform_target_ctor): Make sure trivial dtor is callable.
198 (perform_member_init): Likewise.
199 (expand_cleanup_for_base): Likewise.
200 (build_vec_delete_1): Likewise.
201 (build_delete): Likewise.
202 (push_base_cleanups): Likewise.
203 (build_new_1): Avoid redundant error.
204 * method.c (synthesized_method_walk): Can't ever exit early in C++11.
205 Always process the subobject destructor.
206 * semantics.c (finish_compound_literal): Make sure trivial dtor is
208 * typeck2.c (split_nonconstant_init): Likewise.
210 2013-10-23 Edward Smith-Rowland <3dw4rd@verizon.net>
212 Implement C++14 [[deprecated]] modulo [[gnu::deprecated]] bugs.
213 * parser.c (cp_parser_std_attribute): Interpret [[deprecated]]
214 as [[gnu::deprecated]].
216 2013-10-22 Paolo Carlini <paolo.carlini@oracle.com>
219 * pt.c (apply_late_template_attributes): Use get_attribute_name,
222 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
225 * pt.c (most_specialized_class): Bump processing_template_decl for
228 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
230 * parser.c (cp_parser_lookup_name): Tidy.
232 2013-10-17 Andrew MacLeod <amacleod@redhat.com>
234 * parser.c: Include omp-low.h.
235 * semantics.c: Likewise.
237 2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
240 * lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
241 cp_unevaluated_operand case.
243 2013-10-16 Jason Merrill <jason@redhat.com>
245 * pt.c (apply_late_template_attributes): Use
246 attribute_takes_identifier_p.
248 * error.c (dump_exception_spec): Print "noexcept" rather than
252 * pt.c (unify_array_domain): Split out from unify.
253 (unify): Use it for list deduction, too.
256 * decl2.c (dump_tu): Split out from...
257 (cp_write_global_declarations): ...here. Call it in PCH mode.
259 2013-10-16 Paolo Carlini <paolo.carlini@oracle.com>
261 * pt.c (tsubst): Fix typo in last commit.
263 2013-10-16 Paulo Matos <pmatos@broadcom.com>
265 * error.c (code_to_string): Use new wrapper get_tree_code_name.
266 * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
267 * pt.c (tsubst): Likewise.
268 * semantics.c (cxx_eval_constant_expression,
269 potential_constant_expression_1): Likewise.
270 * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
271 add_substitution, find_substitution): Likewise.
273 2013-10-15 Paolo Carlini <paolo.carlini@oracle.com>
276 * parser.c (cp_parser_postfix_open_square_expression): Set
277 parser->greater_than_is_operator_p for the argument.
279 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
282 * parser.c (cp_parser_commit_to_topmost_tentative_parse): New.
283 (cp_parser_pseudo_destructor_name): Use it.
285 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
288 * pt.c (convert_nontype_argument): Set expr_type to
289 TREE_TYPE (probe_type).
291 2013-10-11 Jakub Jelinek <jakub@redhat.com>
293 * decl.c (duplicate_decls): Error out for redeclaration of UDRs.
294 (declare_simd_adjust_this): New function.
295 (grokfndecl): If "omp declare simd" attribute is present,
296 call declare_simd_adjust_this if needed and
297 c_omp_declare_simd_clauses_to_numbers.
298 * cp-array-notation.c (expand_array_notation_exprs): Handle
300 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
301 OMP_DISTRIBUTE. Handle is_invisiref_parm decls in
302 OMP_CLAUSE_REDUCTION.
303 (cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
305 (cxx_omp_privatize_by_reference): Return true for
306 is_invisiref_parm decls.
307 (cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
309 * pt.c (apply_late_template_attributes): For "omp declare simd"
310 attribute call tsubst_omp_clauses,
311 c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
312 and c_omp_declare_simd_clauses_to_numbers.
313 (instantiate_class_template_1): Call cp_check_omp_declare_reduction
315 (tsubst_decl): Handle UDRs.
316 (tsubst_omp_clauses): Add declare_simd argument, if true don't
317 call finish_omp_clauses. Handle new OpenMP 4.0 clauses.
318 Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
319 OMP_CLAUSE_REDUCTION.
320 (tsubst_expr): For UDRs call pushdecl and
321 cp_check_omp_declare_reduction. Adjust tsubst_omp_clauses
322 callers. Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
323 OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
324 Adjust finish_omp_atomic caller.
325 (tsubst_omp_udr): New function.
326 (instantiate_decl): For UDRs at block scope, don't call
327 start_preparsed_function/finish_function. Call tsubst_omp_udr.
328 * semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
329 use it instead of need_default_ctor || need_copy_ctor.
330 (struct cp_check_omp_declare_reduction_data): New type.
331 (handle_omp_array_sections_1, handle_omp_array_sections,
332 omp_reduction_id, omp_reduction_lookup,
333 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
334 cp_check_omp_declare_reduction, clone_omp_udr,
335 find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
336 (finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
338 (finish_omp_for): Add CODE argument, use it instead of hardcoded
339 OMP_FOR. Adjust c_finish_omp_for caller.
340 (finish_omp_atomic): Add seq_cst argument, adjust
341 c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
343 (finish_omp_cancel, finish_omp_cancellation_point): New functions.
344 * decl2.c (mark_used): Force immediate instantiation of
345 DECL_OMP_DECLARE_REDUCTION_P decls.
346 (is_late_template_attribute): Return true for "omp declare simd"
348 (cp_omp_mappable_type): New function.
349 (cplus_decl_attributes): Add implicit "omp declare target" attribute
351 * parser.c (cp_debug_parser): Print
352 parser->colon_doesnt_start_class_def_p.
353 (cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
355 (enum pragma_context): Add pragma_member and pragma_objc_icode.
356 (cp_parser_binary_expression): Handle no_toplevel_fold_p
357 even for binary operations other than comparison.
358 (cp_parser_linkage_specification): Call
359 cp_ensure_no_omp_declare_simd if needed.
360 (cp_parser_namespace_definition): Likewise.
361 (cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
362 (cp_parser_direct_declarator): Pass declarator to
363 cp_parser_late_return_type_opt.
364 (cp_parser_late_return_type_opt): Add declarator argument,
365 call cp_parser_late_parsing_omp_declare_simd for declare simd.
366 (cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
367 Parse UDRs before all other methods.
368 (cp_parser_member_specification_opt): Use pragma_member instead of
370 (cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
371 (cp_parser_function_definition_from_specifiers_and_declarator,
372 cp_parser_save_member_function_body): Likewise.
373 (cp_parser_late_parsing_for_member): Handle UDRs specially.
374 (cp_parser_next_token_starts_class_definition_p): Don't allow
375 CPP_COLON if colon_doesnt_start_class_def_p flag is true.
376 (cp_parser_objc_interstitial_code): Use pragma_objc_icode
377 instead of pragma_external.
378 (cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
379 (cp_parser_omp_var_list_no_open): Parse array sections for
380 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses. Add COLON argument,
381 if non-NULL, allow parsing to end with a colon rather than close
383 (cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
385 (cp_parser_omp_clause_reduction): Handle user defined reductions.
386 (cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
387 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
388 cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
389 cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
390 cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
391 cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
392 cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
393 cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
395 (cp_parser_omp_all_clauses): Add finish_p argument. Don't call
396 finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
397 (cp_parser_omp_atomic): Parse seq_cst clause, pass
398 true if it is present to finish_omp_atomic. Handle new OpenMP 4.0
400 (cp_parser_omp_for_loop): Add CODE argument, pass it through
401 to finish_omp_for. Change last argument to cclauses,
402 and adjust uses to grab parallel clauses from the array of all
404 (cp_omp_split_clauses): New function.
405 (cp_parser_omp_simd): New function.
406 (cp_parser_omp_for): Add p_name, mask and cclauses arguments.
407 Allow the function to be called also when parsing combined constructs,
408 and call c_parser_omp_simd when parsing for simd.
409 (cp_parser_omp_sections_scope): If section-sequence doesn't start with
410 #pragma omp section, require exactly one structured-block instead of
411 sequence of statements.
412 (cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
413 Allow the function to be called also when parsing combined constructs.
414 (cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
415 Allow the function to be called also when parsing combined
417 (cp_parser_omp_taskgroup, cp_parser_omp_cancel,
418 cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
419 cp_parser_omp_teams, cp_parser_omp_target_data,
420 cp_parser_omp_target_update, cp_parser_omp_target,
421 cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
422 cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
423 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
424 cp_parser_omp_declare): New functions.
425 (cp_parser_omp_construct): Add p_name and mask vars. Handle
426 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
427 PRAGMA_OMP_TEAMS. Adjust cp_parser_omp_for, cp_parser_omp_parallel
428 and cp_parser_omp_sections callers.
429 (cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
430 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
431 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
432 PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
433 Handle pragma_member and pragma_objc_icode like pragma_external.
434 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
435 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
436 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
437 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
439 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
440 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
441 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
442 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
443 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
444 * parser.h (struct cp_omp_declare_simd_data): New type.
445 (struct cp_parser): Add colon_doesnt_start_class_def_p and
446 omp_declare_simd fields.
447 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
448 * cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
450 (DECL_OMP_DECLARE_REDUCTION_P): Define.
451 (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
452 (struct saved_scope): Add omp_declare_target_attribute field.
453 (cp_omp_mappable_type, omp_reduction_id,
454 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
455 finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
456 (finish_omp_for): Add CODE argument.
457 (finish_omp_atomic): Add seq_cst argument.
458 (cxx_omp_create_clause_info): Add need_dtor argument.
460 2013-10-09 Marek Polacek <polacek@redhat.com>
463 * semantics.c (finish_return_stmt): Return error_mark_node
464 when error_operand_p of the expr is true.
465 (build_transaction_expr): Check for EXPR_P before setting the
468 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
471 * lambda.c (begin_lambda_type): Check return value of xref_tag
472 for error_mark_node; tidy.
473 * decl.c (grokdeclarator): Tweak error message.
475 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
479 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
482 * pt.c (tsubst): Use error_operand_p on parameter t.
484 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
487 * class.c (check_bases): Propagate CLASSTYPE_READONLY_FIELDS_NEED_INIT
488 and CLASSTYPE_REF_FIELDS_NEED_INIT from bases to derived.
489 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Extend error
490 messages about uninitialized const and references members to mention
493 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
496 * pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
498 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
501 * typeck2.c (build_functional_cast): Use error_operand_p on exp.
503 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
506 * parser.c (cp_parser_perform_range_for_lookup): If eventually
507 either *begin or *end is type-dependent, return NULL_TREE.
508 (do_range_for_auto_deduction): If cp_parser_perform_range_for_lookup
509 returns NULL_TREE, don't actually do_auto_deduction.
511 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
514 * pt.c (tsubst): Use error_operand_p on parameter t.
516 2013-10-04 Marc Glisse <marc.glisse@inria.fr>
519 * decl.c (cxx_init_decl_processing): Set operator_new_flag.
521 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
524 * decl2.c (save_template_attributes): Handle error_mark_node as
526 (cp_check_const_attributes): Likewise for attributes.
527 * parser.c (cp_parser_std_attribute_spec): When alignas_expr is an
528 error_mark_node call cp_parser_skip_to_end_of_statement.
530 2013-10-03 Easwaran Raman <eraman@google.com>
533 * parser.c (cp_parser_init_declarator): Do not drop attributes
534 of template member functions.
536 2013-10-03 Marek Polacek <polacek@redhat.com>
539 * init.c (sort_mem_initializers): Splice when giving an error.
541 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
544 * parser.c (cp_parser_function_specifier_opt): Upon error about
545 virtual templates don't set ds_virtual.
546 (finish_fully_implicit_template): Reject virtual implicit templates.
548 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
551 * semantics.c (potential_constant_expression_1): Handle LABEL_EXPR.
553 2013-10-01 Paolo Carlini <paolo.carlini@oracle.com>
556 * parser.c (cp_parser_lookup_name): Check make_typename_type return
557 value for error_mark_node.
559 2013-09-25 Tom Tromey <tromey@redhat.com>
561 * Make-lang.in (CXX_TREE_H, CXX_PARSER_H, CXX_PRETTY_PRINT_H):
564 2013-09-25 Tom Tromey <tromey@redhat.com>
566 * Make-lang.in (g++spec.o): Remove.
567 (CFLAGS-cp/g++spec.o): New variable.
568 (GXX_OBJS): Reference cp/g++spec.o.
569 (cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
570 (cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
571 (cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
572 (cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
573 (cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
574 (cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
575 (cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
576 (cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.
578 2013-09-25 Tom Tromey <tromey@redhat.com>
580 * Make-lang.in (g++spec.o): Don't use subshell.
582 2013-09-25 Marek Polacek <polacek@redhat.com>
585 * semantics.c (finish_transaction_stmt): Check for EXPR_P before
586 setting the expr location.
588 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
591 * type-utils.h (find_type_usage): Only traverse one type level into
592 member function pointers.
594 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
596 * parser.c (cp_parser_init_declarator): Defer calling
597 finish_fully_implicit_template for forward declarations until after
598 other decl processing is complete. Cleanup for clarity: Extract 'else'
599 case after 'if' containing unconditional return.
601 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
603 * parser.c (make_generic_type_name): Spell generic type names '<autoN>'
604 rather than '__GenN'.
606 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
608 * lambda.c (maybe_add_lambda_conv_op): Don't check for instantiated
609 callop in the case of generic lambdas.
611 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
613 * parser.c (make_generic_type_name): Use global count rather than
615 (add_implicit_template_parms): ... propagate interface change here.
617 2013-09-20 Paolo Carlini <paolo.carlini@oracle.com>
620 * pt.c (tsubst_copy): Use current_nonlambda_class_type to
621 call tsubst_baselink.
623 2013-09-18 Paolo Carlini <paolo.carlini@oracle.com>
626 * class.c (instantiate_type): Loosen a bit the gcc_assert.
628 2013-09-18 Marek Polacek <polacek@redhat.com>
631 * typeck.c (cp_build_binary_op): Properly honor -fsanitize options.
632 Remove unnecessary check.
634 2013-09-18 Marek Polacek <polacek@redhat.com>
637 * typeck.c (cp_build_binary_op): Don't sanitize function if it has the
638 no_sanitize_undefined attribute.
640 2013-09-17 Paolo Carlini <paolo.carlini@oracle.com>
643 * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account
644 the cp_type_quals (r) too.
646 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
648 * cp-tree.h (type_uses_auto_or_concept): Declare.
649 (is_auto_or_concept): Declare.
650 * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
651 -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
652 * type-utils.h: New header defining ...
653 (find_type_usage): ... this new function based on pt.c (type_uses_auto)
654 for searching a type tree given a predicate.
655 * pt.c (type_uses_auto): Reimplement via type-utils.h (find_type_usage).
656 (is_auto_or_concept): New function.
657 (type_uses_auto_or_concept): New function.
658 * parser.h (struct cp_parser): Add fully_implicit_function_template_p.
659 * parser.c (cp_parser_new): Initialize
660 fully_implicit_function_template_p.
661 (cp_parser_new): Initialize fully_implicit_function_template_p.
662 (cp_parser_lambda_expression): Copy and restore value of
663 fully_implicit_function_template_p as per other parser fields.
664 (cp_parser_parameter_declaration_list): Count generic
665 parameters and call ...
666 (add_implicit_template_parms): ... this new function to synthesize them
667 with help from type-utils.h (find_type_usage), ...
668 (tree_type_is_auto_or_concept): ... this new static function and ...
669 (make_generic_type_name): ... this new static function.
670 (cp_parser_direct_declarator): Account for implicit template parameters.
671 (cp_parser_lambda_declarator_opt): Finish fully implicit template if
672 necessary by calling ...
673 (finish_fully_implicit_template): ... this new function.
674 (cp_parser_init_declarator): Likewise.
675 (cp_parser_function_definition_after_declarator): Likewise.
676 (cp_parser_member_declaration): Likewise.
677 * Make-lang.in (cp/pt.o): Add dependency on type-utils.h.
678 (cp/parser.o): Likewise.
680 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
682 * parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
683 list with std=c++1y or std=gnu++1y.
684 (cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
685 operator template to avoid adding template result to symbol table.
686 * lambda.c (lambda_function): Return template result if call operator is
688 (maybe_add_lambda_conv_op): Move declarations to point of use. Refactor
689 operator call building in order to support conversion of a non-capturing
690 lambda template to a function pointer with help from ...
691 (prepare_op_call): ... this new function.
692 * decl2.c (check_member_template): Don't reject lambda call operator
693 template in local [lambda] class.
694 * pt.c (instantiate_class_template_1): Don't instantiate lambda call
695 operator template when instantiating lambda class.
697 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
699 * pt.c (make_auto_1): Use input_location rather than BUILTINS_LOCATION.
701 2013-09-15 Jason Merrill <jason@redhat.com>
705 * parser.c (cp_parser_lambda_introducer): Handle variadic capture.
706 * lambda.c (add_capture): Handle variadic capture.
707 (add_default_capture, lambda_capture_field_type): Likewise.
708 (build_capture_proxy, register_capture_members): Likewise.
709 * pt.c (register_specialization): Allow FIELD_DECL.
710 (retrieve_specialization): Likewise.
711 (find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
712 (tsubst_pack_expansion): Handle FIELD_DECL packs.
713 (gen_elem_of_pack_expansion_instantiation): Likewise.
714 (instantiate_class_template_1): Likewise.
715 (tsubst_decl, tsubst_copy): Likewise.
716 (tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
717 (tsubst_copy_and_build) [VAR_DECL]: Likewise.
718 * semantics.c (finish_non_static_data_member): Don't try to represent
719 the type of a COMPOUND_REF of a FIELD_DECL pack.
722 * cp-tree.h (DECL_PACK_P): Replace FUNCTION_PARAMETER_PACK_P.
723 * cxx-pretty-print.c (direct_declarator): Adjust.
724 * decl2.c (cp_build_parm_decl): Adjust.
725 * pt.c (function_parameter_pack_p): Adjust.
726 (find_parameter_packs_r, push_template_decl_real): Adjust.
727 (tsubst_pack_expansion, tsubst_decl): Adjust.
728 (regenerate_decl_from_template, instantiate_decl): Adjust.
730 * lambda.c (add_capture): Don't add DECL_LANG_SPECIFIC.
732 2013-09-13 Jason Merrill <jason@redhat.com>
735 * pt.c (any_type_dependent_elements_p): Actually check for
736 type-dependence, not value-dependence.
738 2013-09-13 Jacek Caban <jacek@codeweavers.com>
740 * decl.c: Use new cxx_implicit_extern_c hook
742 2013-09-12 Brooks Moses <bmoses@google.com>
745 * Make-lang.in: Do not install driver binaries in $(target)/bin.
747 2013-09-12 Adam Butcher <adam@jessamine.co.uk>
749 * pt.c (instantiate_decl): Save/restore cp_unevaluated_operand and
750 c_inhibit_evaluation_warnings. Reset if instantiating within a
751 function-local template.
753 2013-09-12 Paolo Carlini <paolo.carlini@oracle.com>
755 * semantics.c (finish_pseudo_destructor_expr): Add location_t
757 * pt.c (unify_arg_conversion): Use EXPR_LOC_OR_HERE.
758 (tsubst_copy_and_build): Adjust finish_pseudo_destructor_expr
760 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
761 (cp_parser_postfix_expression): Pass the proper location to
762 cp_parser_postfix_dot_deref_expression.
763 * cp-tree.h (finish_pseudo_destructor_expr): Update declaration.
765 2013-09-10 Jan Hubicka <jh@suse.cz>
766 Paolo Carlini <paolo.carlini@oracle.com>
768 * error.c (print_instantiation_partial_context_line): If
769 loc == UNKNOWN_LOCATION return immediately.
771 2013-09-09 Jakub Jelinek <jakub@redhat.com>
774 * init.c (build_vec_delete): Call mark_rvalue_use on base.
776 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
779 * init.c (build_vec_delete_1): When the type is incomplete emit a
780 warning, enabled by default (not an error).
781 (build_delete): Adjust to use OPT_Wdelete_incomplete.
783 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
786 * error.c (location_of): Don't handle PARM_DECLs specially.
788 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
790 * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
791 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
792 Tweak, TREE_OPERAND (t, 1) may be null.
794 2013-09-08 Caroline Tice <cmtice@google.com>
797 * vtable-class-hierarchy.c (vtv_generate_init_routine): In
798 preinit case, move call to assemble_vtv_preinit_initializer to
799 after call to cgraph_process_new_functions.
801 2013-09-08 Tom de Vries <tom@codesourcery.com>
804 * except.c (build_must_not_throw_expr): Handle
807 2013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
809 * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p.
811 2013-09-04 Paolo Carlini <paolo.carlini@oracle.com>
814 * class.c (finish_struct_anon_r): New.
815 (finish_struct_anon): Use it.
817 2013-09-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
819 * cxx-pretty-print.h (cxx_pretty_printer::simple_type_specifier):
820 Declare as overrider.
821 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier):
822 Rename from pp_cxx_simple_type_specifier.
823 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
824 simple_type_specifier.
826 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com>
829 * typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
831 2013-09-03 Mike Stump <mikestump@comcast.net>
833 * Make-lang.in (cp/lambda.o): Add dependencies.
835 2013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
837 * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as
839 * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove.
840 (pp_cxx_userdef_literal): Tidy.
841 (pp_cxx_template_argument_list): Likewise.
842 (pp_cxx_typeid_expression): Likewise.
843 (pp_cxx_offsetof_expression_1): Likewise.
844 (cxx_pretty_printer::postfix_expression): Likewise.
845 (cxx_pretty_printer::unary_expression): Likewise.
846 (cxx_pretty_printer::statement): Likewise.
847 (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id.
848 (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id.
849 * error.c (dump_decl): Tidy.
850 (dump_expr): Likewise.
852 2013-09-02 Paolo Carlini <paolo.carlini@oracle.com>
854 PR c++/21682, implement DR 565
855 * name-lookup.c (compparms_for_decl_and_using_decl): New.
856 (push_overloaded_decl_1, do_nonmember_using_decl): Use it.
858 2013-08-30 Marek Polacek <polacek@redhat.com>
860 * typeck.c (cp_build_binary_op): Add division by zero and shift
862 * error.c (dump_expr): Special-case ubsan builtins.
864 2013-08-30 Paolo Carlini <paolo.carlini@oracle.com>
867 * cp-tree.h (LOOKUP_DELEGATING_CONS): Add.
868 * init.c (perform_target_ctor): Use it.
869 * call.c (build_special_member_call): Diagnose self-delegating
872 2013-08-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
874 * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as
876 (cxx_pretty_printer::declaration_specifiers): Likewise.
877 (cxx_pretty_printer::function_specifier): Likewise.
878 (cxx_pretty_printer::declarator): Likewise.
879 (cxx_pretty_printer::direct_declarator): Likewise.
880 (cxx_pretty_printer::abstract_declarator): Likewise.
881 (cxx_pretty_printer::direct_abstract_declarator): Likewise.
882 (pp_cxx_declaration): Remove.
883 * cxx-pretty-print.c (cxx_pretty_printer::function_specifier):
884 Rename from pp_cxx_function_specifier. Adjust.
885 (cxx_pretty_printer::declaration_specifiers): Rename from
886 pp_cxx_decl_specifier_seq. Adjust.
887 (cxx_pretty_printer::direct_declarator): Rename from
888 pp_cxx_direct_declarator. Adjust.
889 (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator.
891 (cxx_pretty_printer::abstract_declarator): Rename from
892 pp_cxx_abstract_declarator. Adjust.
893 (cxx_pretty_printer::direct_abstract_declarator): Rename from
894 pp_cxx_direct_abstract_declarator. Adjust.
895 (cxx_pretty_printer::declaration): Rename from
896 pp_cxx_declaration. Adjust.
897 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
898 declaration, declaration_specifiers, function_specifier,
899 declarator, direct_declarator, abstract_declarator,
900 direct_abstract_declarator.
901 * error.c (dump_decl): Adjust.
903 2013-08-29 Jan Hubicka <jh@suse.cz>
905 Correct previous patch to not mark terminate as LEAF.
906 * class.c (build_vtbl_initializer): Drop LEAF
907 * decl.c (cxx_init_decl_processing): Likewise.
908 (push_throw_library_fn): Likewise.
909 * except.c (init_exception_processing): Likewise.
910 (do_begin_catch): Likewise.
911 (do_end_catch): Likewise.
912 (do_allocate_exception): Likewise.
914 2013-08-29 Jan Hubicka <jh@suse.cz>
916 * class.c (build_vtbl_initializer): Make __cxa_deleted_virtual
917 ECF_NORETURN | ECF_LEAF
918 * cp-tree.h (build_library_fn_ptr, build_cp_library_fn_ptr,
919 push_library_fn, push_void_library_fn): Update prototype.
920 * decl.c (build_library_fn_1): Remove.
921 (push_cp_library_fn, build_cp_library_fn): Update to take ECF flags.
922 (cxx_init_decl_processing): Update; global_delete_fndecl is ECF_NOTROW;
923 __cxa_pure_virtual is ECF_NORETURN | ECF_NORETURN | ECF_LEAF.
924 (build_library_fn_1): Add ecf_flags argument; rename to ...
925 (build_library_fn): ... this one.
926 (build_cp_library_fn): Take ecf_flags; do not copy NOTHROW flag.
927 (build_library_fn_ptr): Take ecf_flags.
928 (build_cp_library_fn_ptr): Likewise.
929 (push_library_fn): Likewise.
930 (push_cp_library_fn): Likewise.
931 (push_void_library_fn): Likewise.
932 (push_throw_library_fn): All throws are ECF_NORETURN.
933 (__cxa_atexit, __cxa_thread_atexit): Add ECF_LEAF | ECF_NOTHROW attributes.
934 (expand_static_init): __cxa_guard_acquire, __cxa_guard_release,
935 __cxa_guard_abort are ECF_NOTHROW | ECF_LEAF.
936 * except.c (init_exception_processing): terminate is
937 ECF_NOTHROW | ECF_NORETURN | ECF_LEAF.
938 (declare_nothrow_library_fn): Add ecf_flags parameter.
939 (__cxa_get_exception_ptr): Is ECF_NOTHROW | ECF_PURE | ECF_LEAF |
941 (do_begin_catch): cxa_begin_catch and _ITM_cxa_begin_catch
942 are ECF_NOTHROW | ECF_LEAF.
943 (do_end_catch): __cxa_end_catch and _ITM_cxa_end_catch is
945 (do_allocate_exception): _cxa_allocate_exception
946 and _ITM_cxa_allocate_exception are ECF_NOTHROW | ECF_MALLOC
948 (do_free_exception): __cxa_free_exception is
949 ECF_NOTHROW | ECF_LEAF.
950 * rtti.c (build_dynamic_cast_1): __dynamic_cast
951 is ECF_LEAF | ECF_PURE | ECF_NOTHROW.
953 2013-08-29 Adam Butcher <adam@jessamine.co.uk>
955 * error.c (dump_lambda_function): New function, dependent on ...
956 (dump_substitution): ... this new function, factored out of ...
957 (subst_to_string): ... here and ...
958 (dump_function_decl): ... here. Updated to early-out with call to
959 dump_lambda_function after determining template bindings.
961 2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
964 * init.c (build_aggr_init): When init == void_type_node do not
965 set LOOKUP_ONLYCONVERTING.
967 2013-08-27 Caroline Tice <cmtice@google.com>
969 * vtable-class-hierarchy.c: Remove unnecessary include statements.
970 (MAX_SET_SIZE): Remove unnecessary constant.
971 (register_construction_vtables): Make vtable_ptr_array parameter
972 into a vector; remove num_args parameter. Change array accesses to
974 (register_other_binfo_vtables): Ditto.
975 (insert_call_to_register_set): Ditto.
976 (insert_call_to_register_pair): Ditto.
977 (output_set_info): Ditto. Also change warning calls to warning_at
978 calls, and fix format of warning messages.
979 (register_all_pairs): Change vtbl_ptr_array from an array into a
980 vector. Remove num_vtable_args (replace with calls to vector length).
981 Change array stores & accesses to vector functions. Change calls to
982 register_construction_vtables, register_other_binfo_vtables,
983 insert_call_to_register_set, insert_call_to_register_pair and
984 output_set_info to match their new signatures. Change warning to
985 warning_at and fix the format of the warning message.
987 2013-08-27 Jakub Jelinek <jakub@redhat.com>
988 Aldy Hernandez <aldyh@redhat.com>
990 * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
992 2013-08-27 Paolo Carlini <paolo.carlini@oracle.com>
994 * decl.c (grokfndecl): Remove old bison hack.
996 2013-08-26 Jan Hubicka <jh@suse.cz>
998 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
1001 2013-08-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1003 * cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
1004 Declare as overrider.
1005 (cxx_pretty_printer::multiplicative_expression): Likewise.
1006 (cxx_pretty_printer::conditional_expression): Likewise.
1007 (cxx_pretty_printer::assignment_expression): Likewise.
1008 (cxx_pretty_printer::expression): Likewise.
1009 * cxx-pretty-print.c (cxx_pretty_printer::unary_expression):
1010 Rename from pp_cxx_unary_expression. Adjust.
1011 (cxx_pretty_printer::multiplicative_expression): Rename from
1012 pp_cxx_multiplicative_expression. Adjust.
1013 (cxx_pretty_printer::conditional_expression): Rename from
1014 pp_cxx_conditional_expression. Adjust.
1015 (cxx_pretty_printer::assignment_expression): Rename from
1016 pp_cxx_assignment_expression. Adjust.
1017 (cxx_pretty_printer::expression): Rename from pp_cxx_expression.
1019 (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to
1020 unary_expression, multiplicative_expression,
1021 conditional_expression, assignment_expression, expression.
1023 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1025 * cxx-pretty-print.h (cxx_pretty_printer::postfix_expression):
1026 Declare as overrider.
1027 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
1028 Rename from pp_cxx_postfix_expression. Adjust.
1029 (pp_cxx_expression): Use pp_postfix_expression.
1030 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1033 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1035 * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now
1036 an overrider of c_pretty_printer::primary_expression.
1037 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression):
1038 Rename from pp_cxx_primary_expression. Adjust.
1039 (pp_cxx_postfix_expression): Use pp_primary_expression.
1040 (pp_cxx_ctor_initializer): Likewise.
1041 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1044 2013-08-23 Jan Hubicka <jh@suse.cz>
1046 * cp-tree.h (struct lang_type_class): Free is_final bit.
1047 (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
1048 (DECL_FINAL_P): Remove.
1049 * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
1050 is called on CLASS_TYPE_P.
1052 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1054 * cxx-pretty-print.c (M_): Remove.
1055 (pp_cxx_unqualified_id): Use translate_string instead of M_.
1056 (pp_cxx_canonical_template_parameter): Likewise.
1058 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1060 * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
1061 * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
1062 from pp_cxx_id_expression. Adjust.
1063 (pp_cxx_userdef_literal): Use pp_id_expression.
1064 (pp_cxx_primary_expression): Likewise.
1065 (pp_cxx_direct_declarator): Likewise.
1066 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1069 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1071 * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
1072 function, overriding c_pretty_printer::constant.
1073 * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
1074 pp_cxx_constant. Adjust.
1075 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
1077 2013-08-23 Gabriel Dos Reis <gdr@integrable-solutiobs.net>
1079 * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
1080 destructor for the early printer.
1081 * error.c (type_to_string): Use pp_buffer.
1083 2013-08-22 Paolo Carlini <paolo.carlini@oracle.com>
1086 * class.c (check_field_decls): Check for const mutable and const
1087 reference data members.
1089 2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1091 * error.c (init_error): Remove calls to pp_construct and
1092 pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
1093 * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
1094 (cxx_pretty_printer_init): Remove.
1095 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
1096 Rename from cxx_pretty_printer_init. Adjust.
1097 * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
1098 initialization of C++ diagnostics pretty printer.
1100 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1102 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1103 * cp-tree.h (REFERENCE_REF_P): Likewise.
1104 * semantics.c (finish_offsetof): Likewise.
1106 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1109 * semantics.c (finish_id_expression): Handle deprecated references.
1111 2013-08-20 Jason Merrill <jason@redhat.com>
1114 * cvt.c (build_expr_type_conversion): Don't complain about a
1115 template that can't match the desired type category.
1117 2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
1119 * error.c (pp_ggc_formatted_text): New.
1120 (type_as_string): Use it in lieu of pp_formatted_text.
1121 (type_as_string_translate): Likewise.
1122 (expr_as_string): Likewise.
1123 (decl_as_string): Likewise.
1124 (decl_as_string_translate): Likewise.
1125 (lang_decl_name): Likewise.
1126 (decl_to_string): Likewise.
1127 (expr_to_string): Likewise.
1128 (fndecl_to_string): Likewise.
1129 (parm_to_string): Likewise.
1130 (type_to_string): Likewise.
1131 (args_to_string): Likewise.
1132 (subst_to_string): Likewise.
1134 2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
1137 * cp-array-notation.c (cp_expand_cond_array_notations): Added a
1138 check for truth values.
1139 (expand_array_notation_exprs): Added truth values case. Removed an
1140 unwanted else. Added for-loop to walk through subtrees in default
1142 * call.c (build_cxx_call): Inherited the type of the array notation for
1143 certain built-in array notation functions.
1145 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1147 * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
1148 Use cp_parser_lookup_name_simple.
1150 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1152 * name-lookup.h (pop_bindings_and_leave_scope): Declare.
1153 * name-lookup.c (pop_bindings_and_leave_scope): Define.
1154 * parser.c (cp_parser_lambda_declarator_opt,
1155 cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
1157 2013-08-17 Jason Merrill <jason@redhat.com>
1160 * name-lookup.c (push_class_level_binding_1): It's OK to push a
1161 lambda type after the enclosing type is complete.
1163 2013-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
1165 * error.c (dump_scope): Add a cxx_pretty_printer parameter.
1167 (dump_template_argument): Likewise.
1168 (dump_template_argument_list): Likewise.
1169 (dump_template_parameter): Likewise.
1170 (dump_template_bindings): Likewise.
1171 (dump_alias_template_specialization): Likewise.
1172 (dump_type): Likewise.
1173 (dump_typename): Likewise.
1174 (dump_aggr_type): Likewise.
1175 (dump_type_prefix): Likewise.
1176 (dump_type_suffix): Likewise.
1177 (dump_global_iord): Likewise.
1178 (dump_simple_decl): Likewise.
1179 (dump_decl): Likewise.
1180 (dump_template_decl): Likewise.
1181 (dump_function_decl): Likewise.
1182 (dump_parameters): Likewise.
1183 (dump_ref_qualifier): Likewise.
1184 (dump_exception_spec): Likewise.
1185 (dump_function_name): Likewise.
1186 (dump_template_parms): Likewise.
1187 (dump_call_expr_args): Likewise.
1188 (dump_aggr_init_expr_args): Likewise.
1189 (dump_expr_list): Likewise.
1190 (dump_expr_init_vec): Likewise.
1191 (dump_expr): Likewise.
1192 (dump_binary_op): Likewise.
1193 (dump_unary_op): Likewise.
1195 2013-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1198 * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
1199 * decl.c (case_conversion): Use it.
1200 * call.c (standard_conversion): Likewise.
1201 (implicit_conversion): Adjust.
1203 2013-08-13 Adam Butcher <adam@jessamine.co.uk>
1205 * pt.c: Grammar fix in comments ("it's" to "its").
1207 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
1209 * decl.c (warn_extern_redeclared_static, duplicate_decls,
1210 check_elaborated_type_specifier): Use error + inform.
1211 * friend.c (make_friend_class): Likewise.
1212 * semantics.c (finish_id_expression): Likewise.
1214 2013-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1217 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1220 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1223 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1226 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1229 2013-08-06 Caroline Tice <cmtice@google.com>
1231 * Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
1233 (vtable-class-hierarchy.o): Add build rule.
1234 * cp-tree.h (vtv_start_verification_constructor_init_function): New
1235 extern function decl.
1236 (vtv_finish_verification_constructor_init_function): New extern
1238 (build_vtbl_address): New extern function decl.
1239 (get_mangled_vtable_map_var_name): New extern function decl.
1240 (vtv_compute_class_hierarchy_transitive_closure): New extern function
1242 (vtv_generate_init_routine): New extern function decl.
1243 (vtv_save_class_info): New extern function decl.
1244 (vtv_recover_class_info): New extern function decl.
1245 (vtv_build_vtable_verify_fndecl): New extern function decl.
1246 * class.c (finish_struct_1): Add call to vtv_save_class_info if
1247 flag_vtable_verify is true.
1248 * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
1249 * vtable-class-hierarchy.c: New file.
1250 * mangle.c (get_mangled_vtable_map_var_name): New function.
1251 * decl2.c (start_objects): Update function comment.
1252 (cp_write_global_declarations): Call vtv_recover_class_info,
1253 vtv_compute_class_hierarchy_transitive_closure and
1254 vtv_build_vtable_verify_fndecl, before calling
1255 finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
1256 flag_vtable_verify is true.
1257 (vtv_start_verification_constructor_init_function): New function.
1258 (vtv_finish_verification_constructor_init_function): New function.
1259 * init.c (build_vtbl_address): Remove static qualifier from function.
1261 2013-08-06 Jason Merrill <jason@redhat.com>
1264 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
1266 2013-08-05 Paolo Carlini <paolo.carlini@oracle.com>
1269 * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
1270 (cp_build_binary_op): Adjust.
1272 2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
1274 * cxx-pretty-print.h (pp_c_base): Remove.
1275 (cxx_pretty_printer): Derive from c_pretty_printer.
1276 Adjust macros using pp_c_base.
1277 * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
1278 * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
1279 (pp_cxx_colon_colon): Likewise.
1280 (pp_cxx_separate_with): Likewise.
1281 (pp_cxx_storage_class_specifier): Do not call pp_c_base.
1282 (pp_cxx_expression_list): Likewise.
1283 (pp_cxx_space_for_pointer_operator): Likewise.
1284 (pp_cxx_init_declarator): Likewise.
1285 (pp_cxx_call_argument_list): Likewise.
1286 (pp_cxx_constant): Likewise.
1287 (pp_cxx_postfix_expression): Likewise.
1288 (pp_cxx_new_expression): Likewise.
1289 (pp_cxx_unary_expression): Likewise.
1290 (pp_cxx_cast_expression): Likewise.
1291 (pp_cxx_conditional_expression): Likewise.
1292 (pp_cxx_assignment_expression): Likewise.
1293 (pp_cxx_expression): Likewise.
1294 (pp_cxx_function_specifier): Likewise.
1295 (pp_cxx_decl_specifier_seq): Likewise.
1296 (pp_cxx_simple_type_specifier): Likewise.
1297 (pp_cxx_type_specifier_seq): Likewise.
1298 (pp_cxx_ptr_operator): Likewise.
1299 (pp_cxx_parameter_declaration_clause): Likewise.
1300 (pp_cxx_direct_declarator): Likewise.
1301 (pp_cxx_direct_abstract_declarator): Likewise.
1302 (pp_cxx_type_id): Likewise.
1303 (pp_cxx_statement): Likewise.
1304 (pp_cxx_pretty_printer_init): Tidy.
1305 * error.c (init_error): Do not use pp_base.
1306 (dump_aggr_type): Likewise.
1307 (dump_type_prefix): Likewise.
1308 (dump_type_suffix): Likewise.
1309 (dump_global_iord): Likewise.
1310 (dump_decl): Likewise.
1311 (dump_function_decl): Likewise.
1312 (dump_ref_qualifier): Likewise.
1313 (reinit_cxx_pp): Likewise.
1314 (decl_as_dwarf_string): Likewise.
1315 (lang_decl_dwarf_name): Likewise.
1316 (type_to_string): Likewise.
1317 (cv_to_string): Likewise.
1318 (cxx_print_error_function): Likewise.
1319 (cp_diagnostic_starter): Likewise.
1320 (cp_diagnostic_finalizer): Likewise.
1321 (cp_print_error_function): Likewise.
1322 (print_instantiation_context): Likewise.
1323 (cp_printer): Likewise.
1325 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1327 * error.c (dump_type_prefix): Use specialized pretty printer
1328 functions instead of pp_string or operators and punctuators.
1329 (dump_decl): Likewise.
1330 (dump_expr): Likewise.
1332 2013-08-03 Jason Merrill <jason@redhat.com>
1335 * pt.c (get_underlying_template): New.
1336 (convert_template_argument, lookup_template_class_1): Use it.
1340 * pt.c (pack_expansion_args_count): Rename from
1341 any_pack_expanson_args_p.
1342 (coerce_template_parms): Reject pack expansion to
1343 non-pack template parameter of alias template.
1345 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1347 * error.c (dump_aggr_type): Use specialized pretty printer
1348 functions instead of pp_character.
1349 (dump_type_prefix): Likewise.
1350 (dump_simple_decl): Likewise.
1351 (type_to_string): Likewise.
1353 2013-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1355 * cp-tree.h (finish_stmt): Do not declare.
1356 * decl.c (finish_stmt): Do not define.
1357 * parser.c (cp_parser_expression_statement,
1358 cp_parser_declaration_statement,
1359 cp_parser_transaction_cancel): Don't call finish_stmt.
1360 * semantics.c (finish_expr_stmt, finish_if_stmt,
1361 finish_while_stmt, finish_do_stmt, finish_return_stmt,
1362 finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
1363 finish_transaction_stmt): Likewise.
1365 2013-08-01 Fabien Chêne <fabien@gcc.gnu.org>
1368 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
1369 * name-lookup.c (do_nonmember_using_decl): Make sure we have an
1370 OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
1371 instead of issuing an error without mentioning the conflicting
1374 2013-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1376 * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
1377 return value for error_mark_node.
1379 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1382 * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
1383 token->type == CPP_ELLIPSIS.
1385 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1388 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
1390 2013-07-29 Jason Merrill <jason@redhat.com>
1393 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
1394 Use break_out_target_exprs instead of unshare_expr.
1396 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
1399 * call.c (initialize_reference): Don't crash when reference_binding
1400 returns a conv with conv->kind == ck_ambig.
1402 2013-07-29 Jason Merrill <jason@redhat.com>
1404 * mangle.c (write_name): Check for null context.
1405 (write_unscoped_name): Allow PARM_DECL context.
1407 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1410 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
1411 (grokparms): Adjust.
1412 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1413 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
1414 a tsubst_flags_t parameter.
1415 (tsubst_decl): Adjust.
1416 * call.c (convert_default_arg): Likewise.
1417 * cp-tree.h (check_default_argument, tsubst_default_argument):
1418 Update declarations.
1420 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1423 * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
1424 CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
1425 CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
1426 Fix string_len management, tidy.
1428 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1431 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
1432 target type is incomplete; return a bool, not an int.
1433 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
1435 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
1437 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
1438 tf_warning_or_error.
1440 2013-07-21 OndÃ…
\99ej BÃÂlka <neleai@seznam.cz>
1442 * class.c: Fix typos.
1443 * cp-array-notation.c: Likewise.
1444 * cp-objcp-common.c: Likewise.
1447 * mangle.c: Likewise.
1448 * parser.c: Likewise.
1450 * semantics.c: Likewise.
1452 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
1454 * semantics.c (build_lambda_expr),
1455 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
1456 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
1457 (is_normal_capture_proxy), (insert_capture_proxy),
1458 (insert_pending_capture_proxies), (lambda_proxy_type),
1459 (build_capture_proxy), (vla_capture_type),
1460 (register_capture_members), (add_default_capture),
1461 (lambda_expr_this_capture), (maybe_resolve_dummy),
1462 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
1463 (is_lambda_ignored_entity): Moved definitions into ...
1464 * lambda.c: ... this new file.
1466 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
1468 * call.c (build_conditional_expr_1): Handle the case with 1 vector
1469 and 2 scalars. Call save_expr before building a vector.
1470 * typeck.c (cp_build_binary_op): Check complain before complaining.
1472 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
1475 * init.c (build_aggr_init): Check for warn_unused attribute.
1476 * decl.c (poplevel): Likewise.
1478 2013-07-13 Jason Merrill <jason@redhat.com>
1481 * init.c (build_vec_init): Use {} for arrays of class type.
1482 (build_vec_delete): Don't take the address of the array.
1485 * class.c (layout_class_type): Check for too-large class.
1487 * call.c (can_convert): Allow user-defined conversions.
1488 (can_convert_standard): New.
1489 * cp-tree.h: Declare it.
1490 * cvt.c (convert_to_reference): Use it.
1491 * pt.c (convert_nontype_argument): Likewise.
1492 * search.c (check_final_overrider): Likewise.
1493 Don't worry about user-defined conversions.
1495 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
1498 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
1499 warn about casting between pointer-to-function and pointer-to-object.
1501 2013-07-09 Jason Merrill <jason@redhat.com>
1504 * init.c (build_vec_init): Don't take shortcuts when initializing
1508 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
1511 * semantics.c (finish_id_expression): Return the id for an
1512 unevaluated outer variable.
1515 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
1516 if the variable type uses 'auto'.
1519 * typeck.c (check_return_expr): Lambda proxies aren't eligible
1520 for nrv or return by move.
1523 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
1524 a ref-qualifier in C++98 mode.
1527 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
1528 argument to have the exact type of the parameter.
1531 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
1532 a POINTER_PLUS_EXPR for type punning diagnostic.
1535 * pt.c (tsubst_copy): Handle USING_DECL.
1537 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
1540 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
1542 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
1545 * call.c (build_conditional_expr_1): Preserve xvalues.
1547 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1550 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
1551 also check declares_class_or_enum.
1553 2013-07-08 Jason Merrill <jason@redhat.com>
1556 * pt.c (fn_type_unification): Only defer during substitution.
1557 (type_unification_real): Defer during defarg substitution,
1558 add checks parm to pass back deferred checks.
1559 (unify, do_auto_deduction): Adjust.
1560 * semantics.c (reopen_deferring_access_checks): New.
1561 * cp-tree.h: Declare it.
1563 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
1566 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
1567 set parser->default_arg_ok_p to false before cp_parser_declarator.
1569 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1572 * class.c (build_base_path): Improve diagnostic.
1574 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
1577 * decl.c (start_preparsed_function): Return a bool, false if
1578 push_template_decl fails.
1579 (start_function): Adjust.
1580 * cp-tree.h: Update.
1582 2013-07-03 Jakub Jelinek <jakub@redhat.com>
1585 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
1586 Temporarily set parser->greater_than_is_operator_p for
1587 cp_parser_expression and restore from saved value afterwards.
1589 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1591 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
1592 * parser.c (cp_parser_operator()): Parse user-defined string
1593 literal as literal operator.
1595 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1598 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
1599 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
1602 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
1604 * parser.c (cp_parser_array_notation): Removed rejection array notation
1605 of type function pointers. Added handling of array expressions when
1606 Cilk Plus is enabled. Took out type-checking.
1607 (cp_parser_postfix_open_square_expression): Moved normal array expr.
1608 parsing into cp_parser_array_notation when cilkplus is enabled.
1609 (cp_parser_compound_statement): Removed expansion of array notations.
1610 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1611 (cp_parser_function_definition_after_declarator): Likewise.
1612 (cp_parser_selection_statement): Removed error reporting.
1613 (cp_parser_iteration_statement): Likewise.
1614 (cp_parser_direct_declarator): Removed error checking/reporting if
1615 array notations are used in the declarator.
1616 * pt.c (instantiate_decl): Likewise.
1617 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
1618 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
1619 (potential_constant_expression_1): Returned false for
1620 ARRAY_NOTATION_REF case.
1621 * cp-gimplify.c (cp_genericize): Added expansion of array notation
1623 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
1624 parameters. Replaced build_decls with get_temp_regvar with type as
1626 (create_array_refs): Made the type-casting to ptrdiff_type.
1627 (replace_invariant_var): Added a check for void return type before
1628 creating new var. Replaced build_decl and build_min_nt_loc with
1630 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
1631 with gcc_unreachable. Removed few unwanted checks. Made induction
1632 variable type as ptrdiff_type. Removed loc and complain arguments
1633 passed into make_triplet_val_inv. Replaced all modify expression's
1634 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
1635 into stmt. list with the non-forceful one. Replaced some integer
1636 conversion and equality-checking to using tree_int_cst_equal.
1637 (expand_sec_reduce_builtin): All changes mentioned in above function
1638 expand_an_in_modify_expr. Made the new variable type of
1639 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
1640 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
1641 the error reporting from parser to this function. Removed unwanted
1642 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
1643 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
1644 in function pointers.
1645 (cp_expand_cond_array_notations): Added a new if statements to check
1646 if condition has a zero rank. If so, then just return.
1647 (expand_return_expr): Added a check for return expressions with a rank.
1648 Replaced get_tmp_regvar with a create_temporary_var.
1649 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
1650 Moved common code outside if-statements. Moved type-checking from
1652 * semantics.c (finish_return_stmt): Removed a check for return exprs.
1654 * call.c (convert_like_real): Removed a check for array notation
1655 expression in a function.
1656 (build_over_call): Likewise.
1657 (magic_varargs_p): Added a check for builtin array notation function.
1658 Made this function non-static and removed its prototype.
1659 * cp-tree.h (magic_varargs_p): New prototype.
1660 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
1661 nargs to the param->length when builtin reduction function is used.
1662 (convert_arguments): Replaced check for a constant_p function with
1663 margic_varargs_p function call.
1664 (cp_build_binary_op): Removed calling of the function
1665 find_correct_array_notation_type.
1666 (cp_build_addr_expr_1): Removed an unwanted if-statement.
1667 (convert_for_assignment): Removed automatic return of rhs when array
1668 notation builtin function is used.
1670 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1673 * parser.c (cp_parser_save_member_function_body): Handle correctly
1674 curly braces in function-try-block mem-initializers.
1676 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
1679 * typeck.c (cp_build_vec_perm_expr): New function.
1680 * cp-tree.h: Declare it.
1681 * parser.c (cp_parser_postfix_expression): Call it.
1682 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
1683 (tsubst_copy_and_build): Likewise.
1685 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
1688 * pt.c (more_specialized_fn): If both arguments are references,
1689 give priority to an lvalue.
1691 2013-06-26 Jason Merrill <jason@redhat.com>
1693 * typeck2.c (store_init_value): Diagnose a non-constant
1694 initializer for in-class static.
1697 * semantics.c (add_capture): Set type to error_mark_node after
1700 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
1703 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
1704 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
1706 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1708 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
1709 * class.c (add_implicitly_declared_members): Likewise.
1710 (check_field_decl): Likewise.
1711 (finalize_literal_type_property): Likewise.
1712 (check_bases_and_members): Likewise.
1713 * decl.c (poplevel): Likewise.
1714 (case_conversion): Likewise.
1715 (check_initializer): Likewise.
1716 (grokfndecl): Likewise.
1717 (check_static_variable_definition): Likewise.
1718 (compute_array_index_type): Likewise.
1719 (grokdeclarator): Likewise.
1720 (build_enumerator): Likewise.
1721 * friend.c (make_friend_class): Likewise.
1722 * lex.c (init_reswords): Likewise.
1723 * method.c (synthesized_method_walk): Likewise.
1724 (implicitly_declare_fn): Likewise.
1725 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
1726 (cp_parser_constant_expression): Likewise.
1727 (cp_parser_for_init_statement): Likewise.
1728 (cp_parser_block_declaration): Likewise.
1729 (cp_parser_type_name): Likewise.
1730 (cp_parser_enum_specifier): Likewise.
1731 (cp_parser_enumerator_list): Likewise.
1732 (cp_parser_member_declaration): Likewise.
1733 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
1734 (cp_parser_template_declaration_after_export): Likewise.
1735 * pt.c (convert_nontype_argument_function): Likewise.
1736 (convert_nontype_argument): Likewise.
1737 (convert_template_argument): Likewise.
1738 (tsubst_copy_and_build): Likewise.
1739 (build_non_dependent_expr): Likewise.
1740 * semantics.c (non_const_var_error): Likewise.
1741 (potential_constant_expression_1): Likewise.
1742 * tree.c (lvalue_kind): Likewise.
1743 (build_vec_init_expr): Likewise.
1744 (cast_valid_in_integral_constant_expression_p): Likewise.
1745 * typeck.c (build_x_conditional_expr): Likewise.
1746 * typeck2.c (check_narrowing): Likewise.
1748 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
1750 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
1751 (expand_an_in_modify_expr): Changed a function call from the above
1752 removed function to length_mismatch_in_expr_p.
1754 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
1756 * call.c (convert_like_real): Added a check if array notation is present
1757 in expression. If so, then no conversion of arguments is necessary.
1758 (build_over_call): Likewise.
1759 * typeck.c (cp_build_function_call_vec): Likewise.
1760 (convert_for_assignment): Likewise.
1761 (cp_build_array_ref): Reject array notations with a rank greater than 1
1762 as an array's index.
1763 (cp_build_binary_op): If array notations are preent in op, then call
1764 find_correct_array_notation_type.
1765 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
1766 * cp-array-notation.c: New file.
1767 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
1769 * cp-tree.h (fix_array_notation_exprs): New prototype.
1770 * semantics.c (finish_return_stmt): Reject array notations as
1772 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
1773 (potential_constant_expression_1): Likewise.
1774 * tree.c (lvalue_kind): Likewise.
1775 * error.c (dump_decl): Likewise.
1776 (dump_expr): Likewise.
1777 * pt.c (ARRAY_NOTATION_REF): Likewise.
1778 (type_unification_real): Do not unify any arguments if array notations
1780 (instantiate_decl): Added a check for array notaitons inside the
1781 function body. If so, then expand them.
1782 * parser.c (cp_parser_array_notation): New function.
1783 (cp_parser_postfix_open_square_expression): Added a check for colons
1784 inside square braces. If found, then handle the array access as an
1785 array notation access. Also, disable auto-correction from a single
1786 colon to scope when Cilk Plus is enabled.
1787 (cp_parser_compound_statement): Added a check for array notations
1788 inside the statement. If found, then expand them.
1789 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1790 (cp_parser_function_definition_after_declarator): Likewise.
1791 (cp_parser_selection_statement): Searched for array notations inside
1792 condition. If so, then emit an error.
1793 (cp_parser_iteration_statement): Likewise.
1794 (cp_parser_direct_declarator): Reject array notations inside a
1795 variable or array declaration.
1796 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
1798 2013-06-20 Jason Merrill <jason@redhat.com>
1801 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
1802 context if we're in C++14 mode.
1803 * tree.c (array_of_runtime_bound_p): Return true for a dependent
1804 bound that is not potentually constant.
1805 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
1806 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
1807 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
1808 (build_capture_proxy): Set REFERENCE_VLA_OK.
1809 (vla_capture_type): Make it a proper C++ class.
1810 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
1813 * decl.c (compute_array_index_type): Use size_one_node.
1815 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
1816 a partial specialization.
1817 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
1819 (most_specialized_class): Adjust.
1821 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
1822 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
1823 TEMPLATE_DECL_CHECK.
1825 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1828 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
1829 TREE_TYPE (arg), not arg itself.
1831 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
1834 * pt.c (type_dependent_expression_p): Handle an array of unknown
1835 bound depending on a variadic parameter.
1836 * parser.c (cp_parser_range_for): Revert PR56794 changes.
1838 2013-06-17 Richard Biener <rguenther@suse.de>
1840 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
1842 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
1845 * parser.c (cp_parser_expression_statement): Check whether
1846 cp_parser_expression returns error_mark_node.
1848 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1851 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
1853 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1856 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
1857 accessible base simply forward to build_static_cast.
1859 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1862 * decl.c (poplevel): For the benefit of -Wunused-variable see
1865 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1867 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
1869 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1872 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
1873 again diagnostic already emitted by cp_parser_lookup_name.
1875 2013-06-11 Jan Hubicka <jh@suse.cz>
1878 * cp/pt.c (mark_decl_instantiated): Do not export explicit
1879 instantiations of anonymous namespace templates.
1881 2013-06-10 Jason Merrill <jason@redhat.com>
1883 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
1884 namespace to static_decls.
1886 2013-06-07 Sriraman Tallam <tmsriram@google.com>
1889 * call.c (build_over_call): Check if current_function_decl is
1892 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
1895 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
1896 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
1898 2013-06-06 Jason Merrill <jason@redhat.com>
1901 * semantics.c (add_capture): Diagnose capture of variable-size
1902 type that is not a C++1y array of runtime bound.
1904 * decl.c (grokdeclarator): Keep a decl with error type.
1905 (grokfield, grokbitfield): Likewise.
1906 * pt.c (instantiate_class_template_1): Likewise.
1907 (tsubst_decl): Drop redundant error.
1908 * class.c (walk_subobject_offsets): Handle erroneous fields.
1909 * typeck2.c (process_init_constructor_record): Likewise.
1911 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
1914 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
1915 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
1917 2013-06-03 Jan Hubicka <jh@suse.cz>
1919 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
1920 mark_decl_referenced.
1921 (mark_needed): Likewise.
1923 2013-06-03 Jason Merrill <jason@redhat.com>
1925 * class.c (mark_type_abi_tags): New.
1926 (check_abi_tags): Use it.
1928 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1931 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
1932 * semantics.c (finish_qualified_id_expr): Use it.
1933 * cp-tree.h: Update.
1935 2013-06-01 Jan Hubicka <jh@suse.cz>
1937 * decl2.c (cp_write_global_declarations): Replace same_body_alias
1938 by symbol.cpp_implicit_alias.
1940 2013-05-30 Jason Merrill <jason@redhat.com>
1943 * cp-lang.c (cp_classify_record): Handle structs without
1947 * class.c (common_enclosing_class): New.
1948 * cp-tree.h: Declare it.
1949 * init.c (sort_mem_initializers): Don't splice out a union member
1952 2013-05-29 Jan Hubicka <jh@suse.cz>
1954 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
1955 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
1957 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
1960 * decl2.c (check_classfn): Check for destructors declared as member
1963 2013-05-24 Jason Merrill <jason@redhat.com>
1966 * pt.c (any_template_arguments_need_structural_equality_p): A
1967 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
1969 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1972 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
1973 with width exceeding the type.
1975 2013-05-24 Jason Merrill <jason@redhat.com>
1978 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
1979 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
1981 2013-05-23 Jason Merrill <jason@redhat.com>
1984 * tree.c (build_ref_qualified_type): Clear
1985 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
1987 2013-05-22 Jason Merrill <jason@redhat.com>
1990 * call.c (convert_like_real): Use cp_convert_and_check.
1991 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
1992 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
1993 (potential_constant_expression_1): Handle OMP_ATOMIC*.
1996 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
1999 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2002 * parser.c (cp_parser_conversion_type_id): Set up
2003 parser->type_definition_forbidden_message before calling
2004 cp_parser_type_specifier_seq.
2006 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2009 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
2010 warnings about defaulted functions.
2012 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2014 * call.c (build_conditional_expr_1): Add location_t parameter.
2015 (build_conditional_expr): Likewise.
2016 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
2017 get_member_function_from_ptrfunc, build_x_conditional_expr,
2018 cp_build_modify_expr): Update.
2019 * init.c (build_new_1): Likewise.
2020 * cp-tree.h: Update declaration.
2022 2013-05-20 Jason Merrill <jason@redhat.com>
2025 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
2029 * decl.c (fndecl_declared_return_type): Also look in
2030 DECL_SAVED_FUNCTION_DATA.
2032 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2035 * parser.c (cp_parser_parameter_declaration): Check return value
2036 of cp_parser_parse_and_diagnose_invalid_type_name.
2038 2013-05-20 Jason Merrill <jason@redhat.com>
2041 * class.c (vbase_has_user_provided_move_assign): New.
2042 * method.c (synthesized_method_walk): Check it.
2043 * cp-tree.h: Declare it.
2046 * tree.c (build_cplus_array_type): Copy layout info if element
2049 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2052 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
2054 2013-05-20 Jason Merrill <jason@redhat.com>
2057 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
2058 whether a template has its own args.
2060 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2063 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
2065 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2068 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
2069 instead of cp_parser_initializer_list for compound-literals.
2071 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
2074 * typeck.c (check_return_expr): Reverse the alignment comparison.
2076 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
2079 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
2080 correctly sizeof compound-literal; update comments.
2082 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
2084 * call.c (build_conditional_expr_1): Use cp_build_binary_op
2085 instead of directly calling fold_build2.
2087 2013-05-16 Jason Merrill <jason@redhat.com>
2089 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
2092 * decl.c (grokdeclarator): Allow member function qualifiers in
2093 TYPENAME context in C++11 mode.
2095 2013-05-16 Dodji Seketeli <dodji@redhat.com>
2097 PR c++/56782 - Regression with empty pack expansions
2098 * pt.c (use_pack_expansion_extra_args_p): When at least a
2099 parameter pack has an empty argument pack, and another parameter
2100 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
2103 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2105 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
2106 warning_at and permerror with warning_at/inform and permerror/
2107 inform, respectively.
2109 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2112 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
2115 2013-05-14 Jason Merrill <jason@redhat.com>
2118 * parser.c (cp_parser_range_for): Call complete_type.
2121 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
2123 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2126 * method.c (defaulted_late_check): Check for compatible exception
2127 specification out of class explicitly defaulted functions too.
2129 2013-05-14 Jason Merrill <jason@redhat.com>
2132 * semantics.c (potential_constant_expression_1): Make sure the
2133 called function is potentially constant.
2134 * call.c (null_ptr_cst_p): Revert earlier change.
2136 2013-05-13 Jason Merrill <jason@redhat.com>
2139 * call.c (null_ptr_cst_p): An expression with side-effects can't
2140 be a C++03 null pointer constant.
2143 * decl.c (reshape_init_class): Handle error_mark_node.
2146 * typeck.c (merge_types): Propagate ref-qualifier
2147 in METHOD_TYPE case.
2150 * decl.c (grokdeclarator): Apply ref-qualifier
2151 in the TYPENAME case.
2154 * decl.c (decls_match): Compare ref-qualifiers.
2156 2013-05-10 Jason Merrill <jason@redhat.com>
2159 * pt.c (convert_template_argument): Use dependent_template_arg_p,
2160 not uses_template_parms.
2163 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
2166 * semantics.c (add_capture): Error rather than abort on copy
2168 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
2169 warn about capture proxy.
2171 2013-05-09 Jason Merrill <jason@redhat.com>
2173 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
2176 * pt.c (lookup_template_class_1): Handle getting a template
2177 template parameter as D1.
2179 N3639 C++1y VLA diagnostics
2180 * decl.c (grokdeclarator): Complain about reference, pointer, or
2182 (create_array_type_for_decl): Complain about array of VLA.
2183 * pt.c (tsubst): Likewise.
2184 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
2185 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
2186 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
2187 (cxx_sizeof_or_alignof_type): Likewise.
2189 N3639 C++1y VLA support
2190 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
2191 (check_array_initializer): Allow VLA init.
2192 (reshape_init_array_1): Adjust.
2193 (cp_finish_decl): Check for invalid VLA length.
2194 * typeck2.c (process_init_constructor_array): Adjust.
2195 (store_init_value): Use build_vec_init for VLAs.
2196 * semantics.c (add_capture): Capture VLA as ptr+len.
2197 (vla_capture_type): New.
2198 (build_capture_proxy): Rebuild the VLA.
2199 * typeck.c (build_simple_component_ref): Split out from...
2200 (build_ptrmemfunc_access_expr): ...here.
2201 * tree.c (array_of_runtime_bound_p): New.
2202 * init.c (throw_bad_array_length): New.
2203 (build_vec_init): Use it.
2204 * parser.c (cp_convert_range_for): When iterating over a VLA,
2205 use it directly rather than bind a reference.
2206 * cp-tree.h: Declare new functions.
2208 2013-05-08 Jason Merrill <jason@redhat.com>
2210 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
2211 variably_modified_type_p.
2212 (expand_start_catch_block): Mark the typeinfo used here.
2213 * semantics.c (finish_handler_parms): Not here.
2215 * error.c (dump_type_suffix): Try harder on VLA length.
2218 * init.c (throw_bad_array_new_length): New.
2219 (build_new_1): Use it. Don't warn about braced-init-list.
2220 (build_vec_init): Use it.
2221 * call.c (build_operator_new_call): Use it.
2224 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
2225 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
2226 * error.c (maybe_warn_cpp0x): s/0x/11/.
2228 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2231 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
2234 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
2236 * typeck.c (cp_build_binary_op): Call save_expr before
2237 build_vector_from_val.
2239 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2242 * decl.c (cp_finish_decl): After do_auto_deduction copy the
2243 qualifers with cp_apply_type_quals_to_decl.
2245 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2247 * pt.c (convert_nontype_argument): Add missing whitespace in
2250 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2253 * decl.c (build_enumerator): Improve error message.
2255 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2258 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
2259 messages for template types and fix column numbers.
2261 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2264 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
2265 c_inhibit_evaluation_warnings around build_x_modify_expr call.
2267 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2270 * semantics.c (finish_decltype_type): Handle instantiated template
2273 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2276 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
2278 2013-04-26 Jakub Jelinek <jakub@redhat.com>
2280 * error.c (cp_print_error_function): Adjust file_name_as_prefix
2283 2013-04-25 Jason Merrill <jason@redhat.com>
2286 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
2289 * init.c (perform_member_init): Call reshape_init.
2291 2013-04-24 Jason Merrill <jason@redhat.com>
2294 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
2296 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2298 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
2299 pedwarn to simply use OPT_Wpointer_arith.
2300 (cp_build_unary_op): Likewise.
2302 2013-04-24 Jason Merrill <jason@redhat.com>
2304 N3648: init-captures are named.
2305 * semantics.c (add_capture): Don't prepend "__" to init-captures.
2306 (build_capture_proxy): Adjust.
2307 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
2309 N3648: Allow braced and parenthesized initializers.
2310 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
2311 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
2312 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
2313 (add_capture): Collapse a parenthesized initializer into a single
2315 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
2317 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2320 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
2321 * semantics.c (finish_qualified_id_expr): Likewise.
2322 (finish_id_expression): Update.
2323 * typeck.c (cp_build_addr_expr_1): Likewise.
2324 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
2325 * cp-tree.h: Update declarations.
2327 2013-04-22 Jason Merrill <jason@redhat.com>
2330 * parser.c (cp_parser_unqualified_id): Handle ~auto.
2331 (cp_parser_pseudo_destructor_name): Likewise.
2332 (cp_parser_postfix_dot_deref_expression): Adjust.
2333 (cp_lexer_nth_token_is_keyword): New.
2334 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
2335 * typeck.c (lookup_destructor): Handle ~auto.
2337 * pt.c (fn_type_unification): Push tinst level around
2338 type_unification_real if we aren't explaining.
2339 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
2340 * error.c (dump_function_decl): Respect it.
2341 (subst_to_string): Pass it.
2344 * rtti.c (get_typeid): Diagnose qualified function type.
2345 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
2347 * error.c (dump_aggr_type): Fix lambda detection.
2348 (dump_simple_decl): Pretty-print capture field.
2351 * cvt.c (build_expr_type_conversion): Two conversions that return
2352 the same type aren't necessarily ambiguous.
2355 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
2356 pedwarn unconditional except in C++1y mode.
2358 * semantics.c (potential_constant_expression_1): Don't crash on
2362 * semantics.c (finish_id_expression): Reject capture of anonymous
2366 * decl2.c (check_default_args): Check for pack expansion.
2368 * mangle.c (write_type): Mangle decltype(auto).
2370 2013-04-19 Jason Merrill <jason@redhat.com>
2372 N3638 changes to return type deduction
2373 * decl.c (undeduced_auto_decl): New.
2374 (require_deduced_type): New.
2375 (fndecl_declared_return_type): New.
2376 (decls_match): Use it.
2377 (duplicate_decls): Don't check for auto return.
2378 (grokdeclarator): Reject virtual auto.
2379 * class.c (resolve_address_of_overloaded_function): Handle
2380 auto function templates.
2381 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
2382 * cp-tree.h: Declare new fns.
2383 * error.c (dump_function_decl): Use fndecl_declared_return_type.
2384 * search.c (check_final_overrider): Likewise.
2385 * pt.c (make_decltype_auto): New.
2386 (do_auto_deduction): Require plain decltype(auto).
2390 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
2391 template specializations.
2393 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
2395 Implement n3599 - Literal operator templates for strings.
2396 * parser.c (make_string_pack (tree value)): New function.
2397 (cp_parser_userdef_string_literal (cp_token *)): Use it
2398 to construct calls to character string literal operator templates.
2399 (cp_parser_template_declaration_after_export): Check for new string
2400 literal operator template parameter form.
2402 2013-04-15 Jason Merrill <jason@redhat.com>
2404 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
2407 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
2408 rather than a destructor name, it isn't an unqualified-name.
2409 (tsubst_copy_and_build): Pass down decltype_flag to operator
2413 * semantics.c (insert_capture_proxy): Just use index 1 in the
2416 2013-04-12 Jakub Jelinek <jakub@redhat.com>
2418 * error.c (cp_print_error_function,
2419 print_instantiation_partial_context_line,
2420 maybe_print_constexpr_context): Colorize locus strings.
2422 2013-04-11 Jason Merrill <jason@redhat.com>
2425 * parser.c (complain_flags): New.
2426 (cp_parser_postfix_expression): Use it.
2427 (cp_parser_unary_expression): Likewise.
2428 (cp_parser_binary_expression): Likewise.
2429 (cp_parser_assignment_expression): Likewise.
2430 (cp_parser_expression): Likewise.
2431 (cp_parser_postfix_open_square_expression): Take decltype_p.
2432 (cp_parser_builtin_offsetof): Adjust.
2433 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
2434 * decl2.c (grok_array_decl): Add decltype_p parm.
2435 * cp-tree.h: Adjust prototype.
2436 * semantics.c (finish_unary_op_expr): Add complain parm.
2438 2013-04-11 Jakub Jelinek <jakub@redhat.com>
2441 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
2442 calling maybe_constant_value for C++98.
2444 2013-04-11 Jason Merrill <jason@redhat.com>
2447 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
2448 Strip references before checking WILDCARD_TYPE_P.
2450 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2452 * call.c (build_conditional_expr_1, build_over_call): Protect
2453 error calls with complain & tf_error.
2454 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
2455 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
2456 build_ptrmemfunc): Likewise.
2457 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
2459 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
2460 (convert_to_reference): Adjust.
2462 2013-04-11 Jason Merrill <jason@redhat.com>
2464 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
2465 local variables, look them up instead.
2466 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
2467 proxies and substitution in unevaluated context.
2468 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
2469 before the iterators.
2472 * pt.c (uses_deducible_template_parms): New.
2473 (deducible_array_bound, deducible_expression): New.
2474 (deducible_template_args): New.
2475 (unify_one_argument): Call uses_deducible_template_parms.
2477 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2480 * typeck2.c (build_m_component_ref): Protect error calls with
2481 (complain & tf_error).
2483 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2486 * parser.c (cp_parser_enum_specifier): Check for empty
2487 anonymous enums and anonymous scoped enums.
2489 2013-04-10 Jakub Jelinek <jakub@redhat.com>
2492 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
2493 first before calling maybe_constant_value for warn_for_div_by_zero
2494 or invalid shift count warning purposes.
2496 2013-04-09 Jason Merrill <jason@redhat.com>
2499 * rtti.c (build_typeid): Check the address of the argument
2500 rather than looking for an INDIRECT_REF.
2502 2013-04-04 Jason Merrill <jason@redhat.com>
2506 * typeck2.c (abstract_virtuals_error_sfinae): Disable
2507 complete_type again.
2509 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2512 * decl.c (validate_constexpr_redeclaration): Allow an explicit
2513 specialization to be different wrt the constexpr specifier.
2515 2013-04-06 Jason Merrill <jason@redhat.com>
2517 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
2520 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
2522 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
2523 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
2525 2013-04-03 Jason Merrill <jason@redhat.com>
2527 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
2528 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
2529 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
2531 * mangle.c (write_type): When writing a function type with
2532 function-cv-quals, don't add the unqualified type as a
2533 substitution candidate.
2535 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
2538 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
2541 2013-04-03 Jakub Jelinek <jakub@redhat.com>
2544 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
2545 from args to new_args.
2546 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
2547 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
2549 2013-04-02 Jason Merrill <jason@redhat.com>
2552 * mangle.c (write_function_type): Mangle ref-qualifier.
2553 (write_nested_name): Likewise.
2554 (canonicalize_for_substitution): Preserve ref-qualifier.
2555 (write_type): Likewise.
2558 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
2560 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
2562 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
2563 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
2564 (for_each_template_parm_r): Use TYPE_TI_ARGS.
2566 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
2568 * cp-tree.h (TAGGED_TYPE_P): Remove.
2569 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
2570 (TYPE_ANONYMOUS_P): Adjust.
2571 * call.c (build_new_op_1): Likewise.
2572 * class.c (find_abi_tags_r): Likewise.
2573 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
2574 type_is_deprecated): Likewise.
2575 * decl2.c (grokfield, min_vis_r): Likewise.
2576 * pt.c (get_template_info): Likewise.
2577 * tree.c (handle_abi_tag_attribute): Likewise.
2579 2013-04-01 Jason Merrill <jason@redhat.com>
2581 * semantics.c (maybe_constant_value): Check
2582 instantiation_dependent_expression_p.
2583 * pt.c (build_non_dependent_expr): Don't check it here.
2586 * init.c (build_new): Don't try to process an array initializer
2587 at template definition time.
2590 * typeck.c (finish_class_member_access_expr): Handle enum scope.
2593 * parser.c (cp_parser_range_for): Don't try to do auto deduction
2594 in a template if the type of the range is incomplete.
2596 * call.c (add_function_candidate): Take the address of 'this' here.
2597 (build_over_call): And here.
2598 (build_new_method_call_1, build_op_call_1): Not here.
2599 (build_user_type_conversion_1): Or here.
2600 (add_candidates): Adjust.
2602 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
2603 * class.c (same_signature_p): Use type_memfn_quals.
2604 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
2605 FUNCTION_OR_METHOD_TYPE_CHECK.
2606 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
2607 * pt.c (unify): Use static_fn_type.
2609 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
2610 Jason Merrill <jason@redhat.com>
2612 Implement N2439 (ref-qualifiers for 'this')
2613 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
2614 (FUNCTION_RVALUE_QUALIFIED): New.
2615 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
2616 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
2617 (cp_ref_qualifier): New enum.
2618 (cp_declarator): Add ref_qualifier.
2619 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
2620 (cp_parser_direct_declarator): Use it.
2621 (make_call_declarator): Adjust.
2622 (cp_parser_lambda_declarator_opt): Adjust.
2623 * call.c (add_function_candidate): Handle ref-qualifier overload
2624 resolution semantics.
2625 (standard_conversion): Adjust.
2626 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
2627 * decl.c (grokdeclarator): Handle ref-qualifiers.
2628 (grokfndecl): Check for invalid ref-qualifiers.
2629 (static_fn_type, revert_static_member_fn): Adjust.
2630 * decl2.c (build_memfn_type): Handle ref-qualifiers.
2631 (check_classfn): Check them.
2632 (cp_reconstruct_complex_type): Retain them.
2633 * error.c (dump_ref_qualifier): New.
2634 (dump_type_suffix, dump_function_decl): Use it.
2635 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
2636 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
2637 (unify): Retain them.
2638 * tree.c (cp_check_qualified_type): New.
2639 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
2640 (build_ref_qualified_type): New.
2641 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
2642 (cp_build_type_attribute_variant): Keep ref-qualifier.
2643 * typeck.c (merge_types): Keep ref-qualifier.
2644 (structural_comptypes): Compare ref-qualifier.
2645 (type_memfn_rqual): New.
2646 (apply_memfn_quals): Take ref-qual argument.
2647 * typeck2.c (build_m_component_ref): Check ref-qualifier.
2649 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2651 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
2652 (DECL_FUNCTION_TEMPLATE_P): Adjust.
2654 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
2655 pp_cxx_qualified_id): Use get_containing_scope.
2656 * parser.c (cp_parser_class_head): Likewise.
2657 * pt.c (push_template_decl_real): Likewise.
2659 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
2660 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
2662 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
2664 * decl2.c (collect_candidates_for_java_method_aliases): Use
2666 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
2667 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
2668 * decl.c (duplicate_decls): Likewise.
2669 * parser.c (cp_parser_template_declaration_after_export): Likewise,
2670 also DECL_DECLARES_TYPE_P.
2671 * pt.c (instantiate_class_template_1): Likewise.
2672 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
2673 (lookup_field_r): Likewise.
2674 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
2675 (lookup_fnfields_slot_nolazy): Likewise.
2676 * semantics.c (finish_member_declaration): Likewise.
2677 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
2679 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
2681 * pt.c (template_parms_to_args): Fix typo in comment.
2683 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2685 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
2687 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2689 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
2690 (build_op_call_1): Likewise.
2691 (build_over_call): Likewise.
2692 (compare_ics): Likewise.
2693 * class.c (build_base_path): Likewise.
2694 (resolve_address_of_overloaded_function): Likewise.
2695 * cp-tree.h: Likewise.
2696 * cvt.c (cp_convert_to_pointer): Likewise.
2697 (convert_to_reference): Likewise.
2698 (ocp_convert): Likewise.
2699 (convert_force): Likewise, tidy.
2700 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
2701 (pp_cxx_ptr_operator): Likewise.
2702 * decl.c (duplicate_decls): Likewise.
2703 (start_decl): Likewise.
2704 (grok_op_properties): Likewise.
2705 (start_preparsed_function): Likewise.
2706 (store_parm_decls): Likewise.
2707 (finish_function): Likewise.
2708 * decl2.c (delete_sanity): Likewise.
2709 (acceptable_java_type): Likewise.
2710 (grokbitfield): Likewise.
2711 (cp_reconstruct_complex_type): Likewise.
2712 * error.c (dump_type_prefix): Likewise.
2713 (dump_expr): Likewise.
2714 * except.c (push_eh_cleanup): Likewise.
2715 (complete_ptr_ref_or_void_ptr_p): Likewise.
2716 (can_convert_eh): Likewise.
2717 * init.c (build_new_1): Likewise.
2718 (build_delete): Likewise.
2719 (build_vec_delete): Likewise.
2720 * mangle.c (write_type): Likewise.
2721 * parser.c (lookup_literal_operator): Likewise.
2722 * pt.c (convert_nontype_argument_function): Likewise.
2723 (convert_nontype_argument): Likewise.
2726 (dependent_type_p_r): Likewise.
2727 * rtti.c (build_headof): Likewise.
2728 (build_typeid): Likewise.
2729 (build_dynamic_cast_1): Likewise.
2730 (target_incomplete_p): Likewise.
2731 (typeinfo_in_lib_p): Likewise.
2732 * semantics.c (finish_omp_for): Likewise.
2733 (cxx_eval_call_expression): Likewise.
2734 (maybe_resolve_dummy): Likewise.
2735 * tree.c (build_target_expr): Likewise.
2736 (cp_build_qualified_type_real): Likewise.
2737 * typeck.c (composite_pointer_type_r): Likewise.
2738 (composite_pointer_type): Likewise.
2739 (comp_except_types): Likewise.
2740 (cxx_sizeof_nowarn): Likewise.
2741 (string_conv_p): Likewise.
2742 (cp_build_array_ref): Likewise.
2743 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
2744 (pointer_diff): Likewise.
2745 (cp_build_addr_expr_1): Likewise.
2746 (cp_build_unary_op): Likewise.
2747 (build_static_cast_1): Likewise.
2748 (cp_build_c_cast): Likewise.
2749 (comp_ptr_ttypes_real): Likewise.
2750 (ptr_reasonably_similar): Likewise.
2751 (comp_ptr_ttypes_const): Likewise.
2752 (casts_away_constness): Likewise.
2753 (check_literal_operator_args): Likewise.
2754 * typeck2.c (build_x_arrow): Likewise.
2755 (add_exception_specifier): Likewise.
2757 2013-03-29 Jason Merrill <jason@redhat.com>
2760 * cp-tree.h (AUTO_IS_DECLTYPE): New.
2761 * parser.c (cp_parser_decltype): Handle decltype(auto).
2762 (cp_parser_type_id_1): Allow auto without a late-specified
2764 (cp_parser_primary_expression): Use the return value of
2765 finish_parenthesized_expr.
2766 (cp_parser_transaction_expression): Likewise.
2767 * semantics.c (force_paren_expr): New.
2768 (finish_parenthesized_expr): Use it.
2769 * call.c (build_conditional_expr_1): Likewise.
2770 * pt.c (do_auto_deduction): Handle decltype(auto).
2771 (tsubst_copy): Handle PAREN_EXPR.
2772 (tsubst_copy_and_build): Likewise.
2773 * error.c (dump_expr): Handle PAREN_EXPR.
2774 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
2775 * mangle.c (write_expression): Ignore PAREN_EXPR.
2777 * parser.c (cp_parser_decltype_expr): Split out...
2778 (cp_parser_decltype): ...from here.
2782 * pt.c (unify_pack_expansion): Fix indexing.
2784 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
2786 * call.c (build_java_interface_fn_ref): Likewise.
2787 (make_temporary_var_for_ref_to_temp): Likewise.
2788 * class.c (check_field_decls): Likewise.
2789 (layout_class_type): Likewise.
2790 (finish_struct_1): Likewise.
2791 (fixed_type_or_null): Likewise.
2792 (get_vtbl_decl_for_binfo): Likewise.
2793 * cp-gimplify.c (omp_var_to_track): Likewise.
2794 (cp_genericize_r): Likewise.
2795 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
2796 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
2797 (DECL_DISCRIMINATOR_P): Likewise.
2798 * decl.c (poplevel): Likewise.
2799 (decls_match): Likewise.
2800 (duplicate_decls): Likewise.
2801 (decl_jump_unsafe): Likewise.
2802 (start_decl): Likewise.
2803 (check_for_uninitialized_const_var): Likewise.
2804 (make_rtl_for_nonlocal_decl): Likewise.
2805 (cp_finish_decl): Likewise.
2806 (expand_static_init): Likewise.
2807 (local_variable_p): Likewise.
2808 (maybe_register_incomplete_var): Likewise.
2809 * decl2.c (grokfield): Likewise.
2810 (comdat_linkage): Likewise.
2811 (determine_visibility): Likewise.
2812 (import_export_decl): Likewise.
2813 (prune_vars_needing_no_initialization): Likewise.
2814 (decl_maybe_constant_var_p): Likewise.
2815 * error.c (dump_simple_decl): Likewise.
2816 (dump_template_decl): Likewise.
2817 (cp_printer): Likewise.
2818 * except.c (build_throw): Likewise.
2819 * init.c (build_vtbl_address): Likewise.
2820 (member_init_ok_or_else): Likewise.
2821 (build_aggr_init): Likewise.
2822 (expand_aggr_init_1): Likewise.
2823 (build_offset_ref): Likewise.
2824 (constant_value_1): Likewise.
2825 * mangle.c (write_mangled_name): Likewise.
2826 (write_prefix): Likewise.
2827 * name-lookup.c (supplement_binding_1): Likewise.
2828 (add_decl_to_level): Likewise.
2829 (pushdecl_maybe_friend_1): Likewise.
2830 (check_for_out_of_scope_variable): Likewise.
2831 (validate_nonmember_using_decl): Likewise.
2832 (lookup_name_innermost_nonclass_level_1): Likewise.
2833 (lookup_arg_dependent_1): Likewise.
2834 * parser.c (cp_parser_lambda_introducer): Likewise.
2835 (cp_parser_template_argument): Likewise.
2836 (cp_parser_single_declaration): Likewise.
2837 * pt.c (convert_nontype_argument): Likewise.
2838 (instantiate_class_template_1): Likewise.
2839 (tsubst_decl): Likewise.
2840 (tsubst_expr): Likewise.
2841 (do_decl_instantiation): Likewise.
2842 (do_type_instantiation): Likewise.
2843 (regenerate_decl_from_template): Likewise.
2844 (always_instantiate_p): Likewise.
2845 (instantiate_decl): Likewise.
2846 (type_dependent_expression_p): Likewise.
2847 (build_non_dependent_expr): Likewise.
2848 * repo.c (repo_emit_p): Likewise.
2849 * rtti.c (build_dynamic_cast_1): Likewise.
2850 * search.c (shared_member_p): Likewise.
2851 * semantics.c (outer_var_p): Likewise.
2852 (finish_id_expression): Likewise.
2853 (finish_omp_clauses): Likewise.
2854 (finish_decltype_type): Likewise.
2855 (ensure_literal_type_for_constexpr_object): Likewise.
2856 * tree.c (lvalue_kind): Likewise.
2857 (bot_replace): Likewise.
2858 (cp_tree_equal): Likewise.
2859 (handle_init_priority_attribute): Likewise.
2860 (decl_storage_duration): Likewise.
2861 * typeck.c (cxx_sizeof_expr): Likewise.
2862 (cxx_alignof_expr): Likewise.
2863 (decay_conversion): Likewise.
2864 (build_class_member_access_expr): Likewise.
2865 (cp_build_array_ref): Likewise.
2866 (cxx_mark_addressable): Likewise.
2867 (maybe_warn_about_returning_address_of_local): Likewise.
2868 (check_return_expr): Likewise.
2869 * typeck2.c (cxx_readonly_error): Likewise.
2870 (abstract_virtuals_error_sfinae): Likewise.
2871 (cxx_incomplete_type_diagnostic): Likewise.
2873 2013-03-28 Lawrence Crowl <crowl@google.com>
2876 (CXX_PARSER_H): Add header dependence.
2878 (extern debug (cp_binding_level &)): New.
2879 (extern debug (cp_binding_level *)): New.
2881 (debug (cp_binding_level &)): New.
2882 (debug (cp_binding_level *)): New.
2884 (debug (cp_parser &)): New.
2885 (debug (cp_parser *)): New.
2886 (debug (cp_token &)): New.
2887 (debug (cp_token *)): New.
2888 (debug (vec<cp_token, va_gc> &)): New.
2889 (debug (vec<cp_token, va_gc> *)): New.
2890 * parser.c: Add header dependence.
2891 (extern debug (cp_parser &)): New.
2892 (extern debug (cp_parser *)): New.
2893 (extern debug (cp_token &)): New.
2894 (extern debug (cp_token *)): New.
2895 (extern debug (vec<cp_token, va_gc> &)): New.
2896 (extern debug (vec<cp_token, va_gc> *)): New.
2898 2013-03-28 Jason Merrill <jason@redhat.com>
2902 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
2903 the type if tf_decltype is set.
2904 * pt.c (fn_type_unification): Add decltype_p parm.
2905 (get_bindings): Adjust.
2906 * cp-tree.h: Adjust.
2907 * class.c (resolve_address_of_overloaded_function): Adjust.
2908 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
2911 * parser.c (cp_parser_sizeof_pack): Split out from...
2912 (cp_parser_sizeof_operand): ...here. Require (id).
2915 * semantics.c (finish_this_expr): 'this' is an rvalue.
2916 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
2919 * semantics.c (finish_member_declaration): Don't push closure
2922 * name-lookup.c (pushdecl_maybe_friend_1): Use
2923 nonlambda_method_basetype and current_nonlambda_class_type.
2926 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
2927 conversion from integer to pointer.
2928 (cxx_eval_constant_expression): Likewise.
2929 (cxx_eval_indirect_ref): Use the folded operand if we still think
2930 this might be constant.
2932 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
2933 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2936 * call.c (convert_like_real): Change series of two permerrors
2937 to permerror + inform (and likewise for two errors).
2938 (build_new_method_call_1): Likewise.
2939 * typeck.c (convert_for_initialization): Change additional
2940 warning or error to inform.
2942 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2944 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
2945 (first_aggr_init_expr): Likewise.
2946 (more_aggr_init_expr_args_p): Likewise.
2947 (type_of_this_parm): Likewise.
2948 (class_of_this_parm): Likewise.
2949 * name-lookup.h (get_global_value_if_present): Likewise.
2950 (is_typename_at_global_scope): Likewise.
2952 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
2954 * call.c (joust): Don't call inform for a permerror returning false.
2955 * parser.c (cp_parser_check_class_key): Likewise.
2956 * pt.c (tsubst_copy_and_build): Likewise.
2958 2013-03-27 Jason Merrill <jason@redhat.com>
2961 * semantics.c (finish_qualified_id_expr): Return early
2964 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
2966 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
2967 * cvt.c (convert_to_void): Likewise.
2968 * error.c (dump_expr): Likewise.
2969 * mangle.c (write_expression): Likewise.
2970 * parser.c (cp_parser_template_argument): Likewise.
2971 * pt.c (convert_nontype_argument): Likewise.
2972 (tsubst_copy_and_build): Likewise.
2973 * rtti.c (build_typeid): Likewise.
2974 * semantics.c (finish_call_expr): Likewise.
2975 (finish_decltype_type): Likewise.
2976 (build_data_member_initialization): Likewise.
2977 * tree.c (is_dummy_object): Likewise.
2978 * typeck.c (decay_conversion): Likewise.
2979 (build_class_member_access_expr): Likewise.
2980 (cp_build_addr_expr_1): Likewise.
2981 (unary_complex_lvalue): Likewise.
2982 (check_return_expr): Likewise.
2983 * typeck2.c (cxx_readonly_error): Likewise.
2985 2013-03-26 Jason Merrill <jason@redhat.com>
2988 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
2989 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
2990 * cp-tree.h: Adjust prototype.
2993 * typeck2.c (build_m_component_ref): Handle prvalue object.
2995 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
2997 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
2998 * decl.c (duplicate_decls): Likewise.
2999 (cp_finish_decl): Likewise.
3000 (check_class_member_definition_namespace): Likewise.
3001 * decl2.c (grokfield): Likewise.
3002 (decl_needed_p): Likewise.
3003 (import_export_decl): Likewise.
3004 (mark_used): Likewise.
3005 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
3006 * pt.c (push_access_scope): Likewise.
3007 (instantiate_decl): Likewise.
3008 * ptree.c (cxx_print_decl): Likewise.
3009 * repo.c (repo_emit_p): Likewise.
3010 * semantics.c (note_decl_for_pch): Likewise.
3011 * tree.c (decl_linkage): Likewise.
3013 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3016 * decl.c (check_array_designated_initializer): Handle CONST_DECL
3019 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3021 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
3024 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
3026 2013-03-25 Jason Merrill <jason@redhat.com>
3029 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
3030 class is derived from the type of the object.
3033 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
3034 unevaluated context.
3036 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
3039 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
3040 DECL_TEMPLATE_INSTANTIATION.
3042 2013-03-22 Jason Merrill <jason@redhat.com>
3045 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
3048 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
3050 * cp-tree.h (identifier_p): New.
3051 * call.c: Throughout, call identifier_p insstead of direct
3052 comparaison of TREE_CODE against IDENTIFIER_NODE.
3053 * decl.c: Likewisse.
3054 * decl2.c: Likewise.
3056 * mangle.c: Likewise.
3057 * name-lookup.c: Likewise.
3058 * parser.c: Likewise.
3060 * search.c: Likewise.
3061 * semantics.c: Likewise.
3063 * typeck.c: Likewise.
3064 * typeck2.c: Likewise.
3066 2013-03-21 Jakub Jelinek <jakub@redhat.com>
3069 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
3070 * call.c (build_temp): Likewise.
3071 * method.c (synthesize_method): Likewise.
3072 * typeck.c (convert_for_initialization): Likewise.
3074 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
3076 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
3078 2013-03-21 Richard Biener <rguenther@suse.de>
3080 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
3081 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
3083 2013-03-20 Jason Merrill <jason@redhat.com>
3086 * parser.c (cp_parser_late_return_type_opt): Save and restore
3087 current_class_ptr/ref.
3090 * expr.c (cplus_expand_constant): Do nothing if the class is
3092 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
3093 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
3094 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
3095 (complete_vars): Likewise.
3097 * name-lookup.c (get_anonymous_namespace_name): Never use
3098 get_file_function_name.
3100 * pt.c (retrieve_specialization): Handle null tmpl argument.
3104 * pt.c (tsubst_decl): Check return value of register_specialization.
3105 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
3108 2013-03-17 Jason Merrill <jason@redhat.com>
3112 * parser.c (cp_parser_direct_declarator): Bail if we see a
3113 qualified-id not at namespace scope.
3117 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
3120 2013-03-16 Jason Merrill <jason@redhat.com>
3122 * decl.c (grokdeclarator): Assert that we won't see a pointer to
3126 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
3127 (MAYBE_CLASS_TYPE_P): ...here.
3128 * semantics.c (lambda_capture_field_type): Only build a
3129 magic decltype for wildcard types.
3130 (lambda_proxy_type): Likewise.
3131 (finish_non_static_data_member): Get the quals from
3135 * parser.c (cp_parser_template_argument): Don't
3136 fold_non_dependent_expr.
3138 * parser.c (cp_parser_lambda_declarator_opt): Use
3139 cp_parser_trailing_type_id.
3142 * parser.c (cp_parser_template_id): Don't forget access checks.
3145 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
3149 * name-lookup.h (tag_scope): Add ts_lambda.
3150 * semantics.c (begin_lambda_type): Use it.
3151 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
3152 * pt.c (check_default_tmpl_args): Ignore lambdas.
3153 (push_template_decl_real): Handle lambdas.
3154 * tree.c (no_linkage_check): Adjust lambda check.
3157 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
3160 * parser.c (cp_parser_direct_declarator): Fix late return
3161 for out-of-class defn of member function.
3164 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
3165 parms to avoid duplicate -Wshadow warnings.
3167 * search.c (lookup_base): Handle NULL_TREE.
3170 * semantics.c (potential_constant_expression_1): Use of 'this' in
3171 a non-constexpr function makes the expression not potentially
3176 * cp-tree.h (tsubst_flags): Add tf_decltype.
3177 * call.c (build_cxx_call): Don't build a temporary if it's set.
3178 (build_over_call): Make sure it's only passed to build_cxx_call.
3179 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
3180 (cp_parser_unary_expression): Likewise.
3181 (cp_parser_cast_expression): Likewise.
3182 (cp_parser_binary_expression): Likewise.
3183 (cp_parser_assignment_expression): Likewise.
3184 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
3185 (cp_parser_expression): Add decltype_p. Force a
3186 temporary for a call on the LHS of a comma.
3187 (cp_parser_decltype): Pass true to decltype_p parms.
3188 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
3189 (tsubst_copy_and_build): Pass tf_decltype down only for
3190 CALL_EXPR and the RHS of COMPOUND_EXPR.
3191 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
3193 * cp-tree.h (abstract_class_use): New enum.
3194 * typeck2.c (pending_abstract_type): Add use field.
3195 (abstract_virtuals_error_sfinae): Add overloads taking
3196 abstract_class_use instead of tree.
3197 * typeck.c (build_static_cast_1): Call it.
3198 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
3199 * pt.c: Adjust calls.
3200 * decl.c (cp_finish_decl): Don't handle functions specially.
3201 (grokdeclarator): Always check return type.
3202 * init.c (build_new_1): Adjust call.
3206 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
3207 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
3210 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
3211 (tsubst_arg_types): Likewise.
3215 * call.c (convert_like_real): Check for explicit constructors
3216 even for value-initialization.
3219 * pt.c (convert_nontype_argument): Handle invalid pointer.
3221 * parser.c (cp_parser_lambda_expression): Use nreverse.
3225 * pt.c (instantiate_class_template_1): Instantiate lambda capture
3227 (tsubst_copy_and_build): Not here.
3230 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
3233 * parser.c (parsing_nsdmi): New.
3234 * semantics.c (outer_automatic_var_p): Check it.
3235 (finish_id_expression): Likewise.
3236 * cp-tree.h: Declare it.
3239 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
3241 * parser.c (lookup_literal_operator): Correct parm/arg naming
3245 * pt.c (fold_non_dependent_expr_sfinae): Check
3246 instantiation_dependent_expression_p.
3249 * class.c (resolve_address_of_overloaded_function): Accept a
3250 reference to function for target_type.
3251 (instantiate_type): Likewise.
3252 * pt.c (convert_nontype_argument): Pass it to
3253 convert_nontype_argument_function.
3255 2013-03-16 Jakub Jelinek <jakub@redhat.com>
3257 * tree.c (cp_tree_equal): Fix a pasto.
3260 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
3261 pass op1 through maybe_constant_value first.
3263 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
3266 * semantics.c (cxx_eval_array_reference): Check for negative index.
3268 2013-03-14 Jason Merrill <jason@redhat.com>
3271 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
3274 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
3275 dso_handle parm on targets without __cxa_atexit.
3277 2013-03-11 Jason Merrill <jason@redhat.com>
3280 * typeck.c (check_return_expr): Disallow returning init list here.
3281 * semantics.c (apply_deduced_return_type): Not here.
3283 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
3286 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
3287 * error.c (dump_expr): Likewise.
3289 2013-03-08 Jason Merrill <jason@redhat.com>
3292 * class.c (modify_all_vtables): Mangle the vtable name before
3295 * semantics.c (lambda_expr_this_capture): In unevaluated context,
3296 just return the nearest 'this'.
3301 * tree.c (maybe_dummy_object): Don't capture 'this'.
3302 * semantics.c (maybe_resolve_dummy): New.
3303 (finish_non_static_data_member): Use it.
3304 (finish_qualified_id_expr): Don't test is_dummy_object.
3305 * cp-tree.h: Declare maybe_resolve_dummy.
3306 * call.c (build_new_method_call_1): Use it.
3309 * semantics.c (apply_deduced_return_type): Don't allow returning
3310 std::initializer_list.
3312 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
3315 * parser.c (cp_parser_elaborated_type_specifier): Don't call
3316 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
3317 * decl.c (check_elaborated_type_specifier): Tidy.
3319 2013-03-06 Jakub Jelinek <jakub@redhat.com>
3322 * tree.c (strip_typedefs): Don't copy args if they are NULL.
3324 2013-03-05 Jakub Jelinek <jakub@redhat.com>
3326 * parser.c (cp_parser_braced_list): For {} initialize
3327 *non_constant_p to false.
3329 2013-03-04 Jason Merrill <jason@redhat.com>
3333 * semantics.c (lambda_expr_this_capture): Handle NSDMI
3334 and non-class scopes.
3336 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
3338 * decl.c (grokdeclarator): Remove dead code.
3340 2013-02-28 Jason Merrill <jason@redhat.com>
3343 * semantics.c (potential_constant_expression_1): Use
3344 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
3347 * call.c (build_over_call): Avoid virtual lookup in a template.
3349 2013-02-27 Jason Merrill <jason@redhat.com>
3353 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
3354 of the base name for inheriting ctors.
3355 (push_class_level_binding_1): Remove inheriting ctor handling.
3356 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3357 * class.c (add_implicitly_declared_members): Adjust.
3359 2013-02-26 David Binderman <dcb314@hotmail.com>
3362 * decl.c (grokdeclarator): Tidy publicp assignment.
3364 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
3367 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
3368 (build_transaction_expr): Same.
3370 2013-02-25 Jason Merrill <jason@redhat.com>
3373 * pt.c (fn_type_unification): Wait to call push_tinst_level until
3374 we know what args we're looking at.
3377 * semantics.c (potential_constant_expression_1): In C++98, a cast
3378 to non-integral type can't be a constant expression.
3380 2013-02-24 Jakub Jelinek <jakub@redhat.com>
3383 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
3386 2013-02-22 Jason Merrill <jason@redhat.com>
3389 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
3390 if we got the wrong number of template parms.
3393 * pt.c (fn_type_unification): Use explicit args in template
3394 instantiation context.
3397 * call.c (can_convert_arg): Discard access checks.
3400 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
3403 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
3406 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
3407 * cvt.c (ocp_convert): Use the latter.
3408 (cp_convert_to_pointer): Likewise.
3409 * decl.c (check_default_argument): Likewise.
3410 * typeck.c (cp_build_binary_op): Likewise.
3411 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
3413 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
3414 Paolo Carlini <paolo.carlini@oracle.com>
3417 * decl2.c (grokbitfield): Allow scoped enumeration types.
3419 2013-02-15 Jason Merrill <jason@redhat.com>
3422 * semantics.c (finish_id_expression): Also return the identifier
3423 for an outer local static.
3426 * class.c (check_bases_and_members): Deduce noexcept after
3430 * semantics.c (finish_id_expression): In a template, return
3431 the identifier for a constant variable.
3433 2013-02-14 Jason Merrill <jason@redhat.com>
3436 * semantics.c (build_anon_member_initialization): New.
3437 (build_data_member_initialization): Use it.
3440 * decl.c (cp_finish_decl): Force instantiation of an
3441 auto static data member.
3444 * pt.c (unify): A pack expansion that is not the last template
3445 argument makes the entire template argument list non-deduced.
3448 * name-lookup.c (do_class_using_decl): Handle typedefs with
3449 inheriting constructors.
3450 (push_class_level_binding_1): Allow inheriting from template
3451 template parameter, too.
3452 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3455 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
3456 default argument scope.
3457 * mangle.c (write_name): Likewise.
3460 * error.c (find_typenames_r): Don't walk into a pack expansion.
3462 2013-02-13 Jason Merrill <jason@redhat.com>
3465 * parser.c (cp_parser_member_declaration): Check the declarator
3466 form when detecting a function declaration via typedef.
3469 * pt.c (maybe_process_partial_specialization): A lambda
3470 isn't what's being specialized.
3473 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
3477 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
3480 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
3481 non-zero offsets, too.
3484 * decl.c (build_enumerator): Always convert the value to a
3485 fixed underlying type.
3488 * pt.c (tsubst_copy_and_build): Don't forget any new
3489 captures that arose from use of dependent names.
3491 2013-02-13 Jakub Jelinek <jakub@redhat.com>
3494 * semantics.c (finish_asm_stmt): If input constraints allow
3495 neither register nor memory, try maybe_constant_value to get
3496 a constant if possible.
3498 2013-02-12 Jason Merrill <jason@redhat.com>
3501 * method.c (add_one_base_init): Handle base constructor
3502 taking rvalue reference parm.
3505 * semantics.c (sort_constexpr_mem_initializers): Handle
3508 2013-02-09 Jason Merrill <jason@redhat.com>
3511 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
3512 maybe_instantiate_noexcept.
3515 * pt.c (eq_specializations): Set comparing_specializations.
3516 * tree.c (cp_tree_equal): Check it.
3517 * cp-tree.h: Declare it.
3519 * decl.c (decls_match): Check versions later.
3522 * pt.c (build_non_dependent_expr): Don't try to fold
3523 instantiation-dependent expressions.
3524 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
3525 [BIND_EXPR]: Treat as dependent.
3527 2013-02-07 Jakub Jelinek <jakub@redhat.com>
3530 * init.c (build_vec_init): Don't append NULL values into new_vec.
3531 (build_zero_init_1): Don't push anything into v if recursive call
3533 (build_value_init_noctor): Don't push anything into v if
3534 build_value_init call returned NULL_TREE.
3537 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
3538 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
3539 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
3540 return true only if 2nd token isn't CPP_CLOSE_PAREN.
3541 (cp_parser_cast_expression): Adjust caller.
3544 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
3545 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
3546 DECL_LANG_SPECIFIC (t).
3548 2013-02-07 Jason Merrill <jason@redhat.com>
3551 * method.c (do_build_copy_constructor): Don't bother turning
3552 scalars from lvalues to xvalues.
3553 (do_build_copy_assign): Likewise.
3555 2013-02-06 Jason Merrill <jason@redhat.com>
3557 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
3559 2013-02-05 Jason Merrill <jason@redhat.com>
3562 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
3566 * decl.c (start_preparsed_function): Update restype if we change
3570 * pt.c (fn_type_unification): Discard any access checks from
3571 substituting explicit args.
3573 2013-01-31 Jason Merrill <jason@redhat.com>
3577 * typeck.c (get_member_function_from_ptrfunc): Fix
3578 ptrmemfunc_vbit_in_delta case.
3580 2013-01-29 Jason Merrill <jason@redhat.com>
3583 * class.c (build_ctor_vtbl_group): Give construction vtables
3586 2013-01-25 Jason Merrill <jason@redhat.com>
3589 * pt.c (convert_nontype_argument_function): Handle invalid input.
3590 (convert_nontype_argument): Likewise.
3593 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
3594 dynamic type has no virtual functions.
3596 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
3599 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
3600 on TARGET_EXPR nodes.
3602 2013-01-22 Jason Merrill <jason@redhat.com>
3605 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
3607 2013-01-22 Dodji Seketeli <dodji@redhat.com>
3610 * pt.c (argument_pack_element_is_expansion_p)
3611 (make_argument_pack_select, use_pack_expansion_extra_args_p)
3612 (gen_elem_of_pack_expansion_instantiation): New static functions.
3613 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
3614 look through the possibly resulting pack expansion as well.
3615 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
3616 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
3617 Use gen_elem_of_pack_expansion_instantiation to build the
3618 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
3619 as gen_elem_of_pack_expansion_instantiation and the change in
3620 tsubst above generalize this particular case.
3621 (arg_from_parm_pack_p): Remove this for it's not used by
3622 tsubst_pack_expansion anymore.
3624 2013-01-21 Jason Merrill <jason@redhat.com>
3627 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
3628 template args count.
3630 2013-01-18 Jason Merrill <jason@redhat.com>
3633 * decl2.c (get_local_tls_init_fn): New.
3634 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
3635 with aliases for internal variables. Don't use weakrefs if
3636 the variable needs destruction.
3637 (generate_tls_wrapper): Mark the wrapper as const if no
3638 initialization is needed.
3639 (handle_tls_init): Don't require aliases.
3641 2013-01-15 Dodji Seketeli <dodji@redhat.com>
3644 * pt.c (coerce_innermost_template_parms): New static function.
3645 (instantiate_alias_template): Use it here.
3647 2013-01-09 Jason Merrill <jason@redhat.com>
3650 * rtti.c (build_typeid, get_typeid): Add complain parm.
3651 (get_tinfo_decl_dynamic): Likewise.
3652 * cp-tree.h, parser.c, pt.c: Adjust.
3655 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
3658 2013-01-09 Jakub Jelinek <jakub@redhat.com>
3661 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
3662 call maybe_constant_value for the negative or too big shift
3665 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
3668 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
3669 of the argument is true.
3671 2013-01-08 Joel Brobecker <brobecker@adacore.com>
3673 * parser.c (cp_parser_initializer_list): Move declaration
3674 of variable non_const to start of lexical block.
3676 2013-01-07 Jason Merrill <jason@redhat.com>
3679 * tree.c (build_aggr_init_expr): Do nothing in a template.
3680 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
3681 a FUNCTION_DECL before tsubsting.
3683 2013-01-04 Dodji Seketeli <dodji@redhat.com>
3686 * pt.c (check_instantiated_arg): Allow type template arguments.
3688 2013-01-04 Jason Merrill <jason@redhat.com>
3691 * decl.c (reset_type_linkage, bt_reset_linkage): New.
3692 (grokdeclarator): Use reset_type_linkage.
3693 * name-lookup.c (binding_table_foreach): Handle null table.
3694 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
3696 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3698 PR c++/54526 (again)
3699 * parser.c (cp_parser_template_id): Revert core of previous change
3700 (keep adjusted inform message).
3702 2013-01-03 Jason Merrill <jason@redhat.com>
3706 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
3710 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
3713 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
3716 * call.c (type_has_extended_temps): New.
3717 * cp-tree.h: Declare it.
3718 * decl.c (check_initializer): Use build_aggr_init for arrays
3720 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
3722 2013-01-02 Jason Merrill <jason@redhat.com>
3725 * call.c (build_new_method_call_1): Don't use build_value_init for
3726 user-provided default constructors.
3728 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
3732 * tree.c (build_cplus_array_type): Copy layout information
3733 to main variant if necessary.
3735 Copyright (C) 2013 Free Software Foundation, Inc.
3737 Copying and distribution of this file, with or without modification,
3738 are permitted in any medium without royalty provided the copyright
3739 notice and this notice are preserved.