1 2017-02-15 Martin Sebor <msebor@redhat.com>
4 * init.c (maybe_reject_flexarray_init): New function.
5 (perform_member_init): Call it.
7 2017-02-15 Jakub Jelinek <jakub@redhat.com>
10 * parser.c (cp_parser_std_attribute): Don't pedwarn about
11 [[deprecated]] with -std=c++11 and [[fallthrough]] with
12 -std=c++11 and -std=c++14.
15 * decl.c (grokdeclarator): For static data members, handle thread_p
16 only after handling inline.
18 2017-02-14 Marek Polacek <polacek@redhat.com>
22 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
23 clobbering if the postfix expression isn't an EXPR_P.
25 2017-02-13 Jason Merrill <jason@redhat.com>
27 PR c++/79461 - ICE with lambda in constexpr constructor
28 * constexpr.c (build_data_member_initialization): Ignore
29 initialization of a local variable.
31 2017-02-13 Jakub Jelinek <jakub@redhat.com>
33 * init.c (warn_placement_new_too_small): Add missing space in
35 * parser.c (cp_parser_oacc_declare): Likewise.
36 * mangle.c (maybe_check_abi_tags): Likewise.
39 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
40 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
41 in the rightmost operand.
43 2017-02-13 Nathan Sidwell <nathan@acm.org>
45 PR c++/79296 - ICE mangling localized template instantiation
46 * decl2.c (determine_visibility): Use template fn context for
47 local class instantiations.
49 2017-02-11 Jason Merrill <jason@redhat.com>
51 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
52 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
53 (build_new_1): Use replace_placeholders.
54 * tree.c (replace_placeholders_t): Also track whether we've seen a
56 (replace_placeholders, replace_placeholders_r): Adjust.
59 PR c++/77790 - ICE with auto function in C++11 mode
60 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
61 (require_deduced_type): Add complain parm, return bool.
63 * decl2.c (mark_used): Use require_deduced_type.
65 2017-02-10 Jason Merrill <jason@redhat.com>
67 PR c++/78908 - template ops and bitfields
68 * tree.c (build_min_non_dep): Use unlowered_expr_type.
70 PR c++/78897 - constexpr union
71 * constexpr.c (cxx_eval_store_expression): A store to a union member
72 erases a previous store to another member.
74 PR c++/71285 - member of fold-expression
75 * semantics.c (finish_unary_fold_expr)
76 (finish_binary_fold_expr): Use null type for fold-expressions.
78 PR c++/79401 - protected inherited constructor
79 * call.c (enforce_access): For inheriting constructor, find a base
80 binfo in the path we already have.
82 2017-02-10 Marek Polacek <polacek@redhat.com>
85 * pt.c (type_dependent_expression_p): Check if the expression type
89 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
90 if warnings shouldn't be given.
92 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
95 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
96 an error_mark_node as type.
98 2017-02-09 Jakub Jelinek <jakub@redhat.com>
99 Jason Merrill <jason@redhat.com>
102 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
103 from pattern to type.
105 2017-02-09 Jason Merrill <jason@redhat.com>
107 PR c++/79316 - default argument in deduction guide
108 PR c++/79350 - explicit deduction guide
109 * parser.c (cp_parser_constructor_declarator_p)
110 (cp_parser_direct_declarator): Parse deduction guides more like
112 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
113 * tree.c (special_function_p): Return it.
114 * decl.c (check_special_function_return_type): Handle it.
115 (grokdeclarator, grokfndecl): Adjust.
116 (cp_finish_decl): Pass flags to do_auto_deduction.
117 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
118 * pt.c (dguide_name_p): Take a const_tree.
119 (do_class_deduction): Handle explicit.
120 (do_auto_deduction): Pass flags through.
121 (build_deduction_guide): Copy explicit flag.
123 2017-02-09 Jakub Jelinek <jakub@redhat.com>
126 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
127 non-pragma_compound context here.
128 (cp_parser_omp_target): Likewise.
129 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
130 parsing for ordered and target omp pragmas in non-pragma_stmt
131 non-pragma_compound contexts.
134 * parser.c (cp_parser_oacc_declare): Formatting fix.
135 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
138 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
139 Chung-Lin Tang <cltang@codesourcery.com>
141 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
142 parsing. Parse constant expression. Remove semantic checking.
143 (cp_parser_omp_clause_collapse): Disallow tile.
144 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
145 error about missing for after already emitting one. Use more
146 conventional for idiom for unbounded loop.
147 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
148 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
149 (finish_omp_for): Deal with tile clause.
151 2017-02-07 Nathan Sidwell <nathan@acm.org>
153 * method.c (synthesized_method_base_walk): New. Broken out of ...
154 (synthesized_method_walk): ... here. Call it. Cleanup
157 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
160 * typeck2.c (process_init_constructor_union): Consider only
161 FIELD_DECLs when looking for an NSDMI.
163 2017-02-06 Jason Merrill <jason@redhat.com>
165 PR c++/71193 - incomplete types in templates
166 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
167 handle incomplete type by pedwarning and then treating as dependent.
169 2017-02-06 Jakub Jelinek <jakub@redhat.com>
172 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
173 (potential_constant_expression_1): Likewise.
176 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
177 allow one fewer than expected arguments if flag_permissive.
180 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
181 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
182 with error_mark_node type.
184 2017-02-03 Jason Merrill <jason@redhat.com>
186 PR c++/78689 - ICE on constructor with label
187 * optimize.c (maybe_clone_body): Replace omitted parameters with
189 * class.c (build_clone): Fix logic for omitting inherited parms.
191 PR c++/12245 - excessive memory use
192 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
193 back in. Don't cache constants.
194 (maybe_constant_init): Don't cache constants.
196 PR c++/79294 - ICE with invalid template argument
197 * pt.c (convert_nontype_argument_function): Check value-dependence.
198 (convert_nontype_argument): Don't check it here for function ptrs.
200 2017-02-02 Richard Biener <rguenther@suse.de>
203 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
204 it lazily on the first changed element only and copy it
205 fully upfront, only storing changed elements.
207 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
210 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
213 2017-01-31 Jakub Jelinek <jakub@redhat.com>
216 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
219 2017-01-31 David Malcolm <dmalcolm@redhat.com>
222 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
223 any namespace aliases.
225 2017-01-31 Nathan Sidwell <nathan@acm.org>
228 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
232 * pt.c: (instantiate_decl): Push to top level when current
233 function scope doesn't match. Only push lmabda scope stack when
236 * cp-tree.h (instantiate_decl): Make defer_ok bool.
237 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
238 (instantiate_decl): Simplify and reorder state saving and restoration.
241 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
242 * semantics.c (finish_member_declaration): Assert class is being
245 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
247 Introduce C++ support in libcc1.
248 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
249 (ansi_opname): Rename to...
250 (cp_operator_id): ... this. Adjust all callers.
251 (ansi_assopname): Rename to...
252 (cp_assignment_operator_id): ... this. Adjust all callers.
253 (cp_literal_operator_id): Declare.
254 (set_global_friend): Declare.
255 (is_global_friend): Declare.
256 (enum cp_oracle_request): New type.
257 (cp_binding_oracle_function): New type.
258 (cp_binding_oracle): Declare.
259 (cp_finish_injected_record_type): Declare.
260 * friend.c (global_friend): New var.
261 (set_global_friend): New fn.
262 (is_global_friend): New fn.
263 (is_friend): Call is_global_friend.
264 * name-lookup.c (cp_binding_oracle): New var.
265 (query_oracle): New fn.
266 (qualified_lookup_using_namespace): Call query_oracle.
267 (lookup_name_real_1): Likewise.
268 * parser.c (cp_literal_operator_id): Drop static.
269 * search.c (friend_accessible_p): Call is_global_friend.
270 * semantics.c (is_this_parameter): Accept a variable if the
271 binding oracle is enabled.
273 2017-01-27 Jason Merrill <jason@redhat.com>
275 PR c++/78771 - ICE with inherited constructor.
276 * call.c (build_over_call): Call deduce_inheriting_ctor here.
277 * pt.c (tsubst_decl): Not here.
278 * class.c (add_method): Or here.
279 * method.c (deduce_inheriting_ctor): Handle clones.
280 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
282 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
285 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
287 * cp/cp-tree.h: Declare it.
288 * cp/semantics.c (finish_id_expression): Resolve names within a default
289 capturing generic lambda defined within a template prior to
290 instantiation to allow for captures to be added to the closure type.
292 2017-01-26 Jakub Jelinek <jakub@redhat.com>
295 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
296 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
297 * parser.c (cp_parser_builtin_offsetof): Pass result of
298 build_static_cast of null_pointer_node to finish_offsetof.
299 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
300 it for -Winvalid-offsetof pedwarn instead of trying to guess
301 original offsetof type from EXPR. Save OBJECT_PTR as a new
302 second operand to OFFSETOF_EXPR.
303 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
304 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
307 2017-01-26 Jason Merrill <jason@redhat.com>
309 * name-lookup.c (parse_using_directive): Deprecate strong using.
311 PR c++/79176 - lambda ICE with -flto -Os
312 * decl2.c (vague_linkage_p): Handle decloned 'tors.
313 * tree.c (decl_linkage): Likewise.
315 2017-01-25 Martin Sebor <msebor@redhat.com>
317 * decl.c (grokdeclarator): Fix a typo in a comment.
319 2017-01-25 Jakub Jelinek <jakub@redhat.com>
322 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
326 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
327 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
329 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
332 * decl.c (cxx_init_decl_processing): Pass main_input_filename
333 to build_translation_unit_decl.
335 2017-01-24 Jakub Jelinek <jakub@redhat.com>
338 * cp-gimplify.c (cp_genericize_r): Add result of
339 convert_from_reference on invisiref parm to p_set.
341 2017-01-24 Nathan Sidwell <nathan@acm.org>
343 PR c++/78469 - defaulted ctor and inaccessible dtor
344 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
345 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
346 * tree.c (build_target_expr): Check tf_no_cleanup.
348 PR c++/79118 - anon-members and constexpr
349 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
350 ctor decl. Recursively check anonymous members.
351 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
353 (explain_invalid_constexpr_fn): Likewise.
355 2017-01-23 Nathan Sidwell <nathan@acm.org>
357 PR c++/71710 - template using directive of field
358 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
361 PR c++/71406 - ICE with scope-ref'd template id exprs
363 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
364 before breaking up TEMPLATE_ID_EXPR.
366 2017-01-20 Nathan Sidwell <nathan@acm.org>
368 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
369 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
371 2017-01-20 David Malcolm <dmalcolm@redhat.com>
375 * cp-tree.h (suggest_alternatives_for): Add bool param.
376 (suggest_alternative_in_explicit_scope): New decl.
377 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
378 that isn't the global one, call new function
379 suggest_alternative_in_explicit_scope, only calling
380 suggest_alternatives_for if it fails, and disabling near match
381 searches fort that case. When SCOPE is the global namespace,
382 pass true for new param to suggest_alternatives_for to allow for
384 * lex.c (unqualified_name_lookup_error): Pass true for new param
385 to suggest_alternatives_for.
386 * name-lookup.c (consider_binding_level): Add forward decl.
387 (suggest_alternatives_for): Add "suggest_misspellings" param,
388 using it to conditionalize the fuzzy name-lookup code.
389 (suggest_alternative_in_explicit_scope): New function.
390 * parser.c (cp_parser_primary_expression): When calling
391 finish_id_expression, pass location of id_expression rather
392 than that of id_expr_token.
393 (cp_parser_id_expression): Convert local "unqualified_id" from
394 tree to cp_expr to avoid implicitly dropping location information.
396 2017-01-20 Marek Polacek <polacek@redhat.com>
399 * call.c (build_conditional_expr_1): Warn about duplicated branches.
400 * semantics.c (finish_expr_stmt): Build statement using the proper
403 2017-01-19 Jason Merrill <jason@redhat.com>
405 US 20 - forwarding references and class template argument deduction
406 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
407 * pt.c (push_template_decl_real): Set it.
408 (maybe_adjust_types_for_deduction): Check it.
409 (rewrite_template_parm): Copy it.
411 US 19 - deduction guides and constructors
412 * call.c (joust): Prefer deduction guides to constructors.
413 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
414 (deduction_guide_p): Check DECL_P.
416 * decl.c (check_initializer): Always use build_aggr_init for array
419 PR c++/79130 - decomposition and direct-initialization
420 * init.c (build_aggr_init): Communicate direct-initialization to
422 (build_vec_init): Check for array copy sooner.
423 * parser.c (cp_parser_decomposition_declaration): Remove call to
424 build_x_compound_expr_from_list.
426 2017-01-18 Jason Merrill <jason@redhat.com>
428 PR c++/68666 - member variable template-id
429 * typeck.c (finish_class_member_access_expr): Handle variable
431 * pt.c (lookup_and_finish_template_variable): No longer static.
432 * cp-tree.h: Declare it.
434 2017-01-18 Nathan Sidwell <nathan@acm.org>
437 * call.c (build_over_call): When checking ellipsis conversions for
438 an inherited ctor, make sure there is at least one conversion.
440 2017-01-18 Jason Merrill <jason@redhat.com>
442 PR c++/78894 - ICE with class deduction and default arg
443 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
445 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
448 * mangle.c (write_discriminator): Reorganize abi warning check.
450 2017-01-18 Nathan Sidwell <nathan@acm.org>
452 * cp-tree.h: Clarify exception spec node comment.
453 * except.c (nothrow_spec_p): Simplify by checking node-equality.
456 * mangle.c (write_exception_spec): Check nothrow explicitly.
457 (write_encoding): Don't increment processing_template_decl around
460 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
463 * mangle.c (write_template_args): Add "on" for operator names.
465 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
468 * mangle.c (write_discriminator): Handle discriminator >= 10.
470 2017-01-17 Nathan Sidwell <nathan@acm.org>
473 * cp-tree.h (maybe_generic_this_capture): Declare.
474 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
475 (maybe_resolve_dummy): ... here. Call it.
476 (maybe_generic_this_capture): New.
477 * parser.c (cp_parser_postfix_expression): Speculatively capture
478 this in generic lambda in unresolved member function call.
479 * pt.c (tsubst_copy_and_build): Force hard error from failed
480 member function lookup in generic lambda.
482 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
485 * cp-array-notation.c (expand_array_notation_exprs): Handle
488 2017-01-11 Jason Merrill <jason@redhat.com>
490 PR c++/78337 - ICE on invalid with generic lambda
491 * semantics.c (process_outer_var_ref): Check if containing_function
492 is null. Move inform call under complain test.
494 2017-01-11 Nathan Sidwell <nathan@acm.org>
497 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
500 2017-01-11 Nathan Sidwell <nathan@acm.org>
502 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
504 2017-01-11 Jakub Jelinek <jakub@redhat.com>
507 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
508 assertion. Formatting fix.
511 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
514 2017-01-10 David Malcolm <dmalcolm@redhat.com>
517 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
518 a missing semicolon if we have a valid insertion location for
521 2017-01-10 Jason Merrill <jason@redhat.com>
523 FI 20, decomposition declaration with parenthesized initializer.
524 * parser.c (cp_parser_decomposition_declaration): Use
525 cp_parser_initializer.
527 2017-01-09 Jason Merrill <jason@redhat.com>
529 Implement P0195R2, C++17 variadic using.
530 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
531 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
532 * error.c (dump_decl): Likewise.
534 2017-01-09 Jakub Jelinek <jakub@redhat.com>
538 * semantics.c (finish_omp_clauses): Add missing whitespace to
539 translatable strings.
540 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
542 2017-01-07 Jason Merrill <jason@redhat.com>
544 PR c++/78948 - instantiation from discarded statement
545 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
546 * cp-tree.h (in_discarded_stmt): Declare it.
547 (struct saved_scope): Add discarded_stmt bitfield.
548 (in_discarded_stmt): New macro.
549 * decl2.c (mark_used): Check it.
550 * parser.c (cp_parser_selection_statement): Adjust.
551 (cp_parser_jump_statement): Adjust.
553 2017-01-05 Jakub Jelinek <jakub@redhat.com>
556 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
557 REFERENCE_REF_P, set tt to its operand.
560 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
561 unions even for C++11 and later.
563 2017-01-05 Nathan Sidwell <nathan@acm.org>
566 * pt.c (convert_nontype_argument): Don't try and see if integral
567 or enum expressions are constants prematurely.
569 2017-01-04 Marek Polacek <polacek@redhat.com>
572 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
573 a zero character literal.
575 2017-01-04 Jakub Jelinek <jakub@redhat.com>
578 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
582 * parser.c (cp_parser_simple_declaration): Only complain about
583 inconsistent auto deduction if auto_result doesn't use auto.
585 * parser.c (cp_parser_simple_declaration): Diagnose function
586 declaration among more than one init-declarators with auto
590 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
591 assertion, as lexer->buffer may be NULL.
593 2017-01-04 Marek Polacek <polacek@redhat.com>
597 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
599 2017-01-04 Nathan Sidwell <nathan@acm.org>
602 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
603 (lambda_capture_field_type): Update prototype.
604 * lambda.c (lambda_capture_field_type): Add is_reference parm.
605 Add referenceness here.
606 (add_capture): Adjust lambda_capture_field_type call, refactor
608 * pt.c (tsubst): Adjust lambda_capture_field_type call.
610 2017-01-01 Jakub Jelinek <jakub@redhat.com>
612 Update copyright years.
614 Copyright (C) 2017 Free Software Foundation, Inc.
616 Copying and distribution of this file, with or without modification,
617 are permitted in any medium without royalty provided the copyright
618 notice and this notice are preserved.