1 2017-02-13 Nathan Sidwell <nathan@acm.org>
3 PR c++/79296 - ICE mangling localized template instantiation
4 * decl2.c (determine_visibility): Use template fn context for
5 local class instantiations.
7 2017-02-11 Jason Merrill <jason@redhat.com>
9 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
10 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
11 (build_new_1): Use replace_placeholders.
12 * tree.c (replace_placeholders_t): Also track whether we've seen a
14 (replace_placeholders, replace_placeholders_r): Adjust.
17 PR c++/77790 - ICE with auto function in C++11 mode
18 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
19 (require_deduced_type): Add complain parm, return bool.
21 * decl2.c (mark_used): Use require_deduced_type.
23 2017-02-10 Jason Merrill <jason@redhat.com>
25 PR c++/78908 - template ops and bitfields
26 * tree.c (build_min_non_dep): Use unlowered_expr_type.
28 PR c++/78897 - constexpr union
29 * constexpr.c (cxx_eval_store_expression): A store to a union member
30 erases a previous store to another member.
32 PR c++/71285 - member of fold-expression
33 * semantics.c (finish_unary_fold_expr)
34 (finish_binary_fold_expr): Use null type for fold-expressions.
36 PR c++/79401 - protected inherited constructor
37 * call.c (enforce_access): For inheriting constructor, find a base
38 binfo in the path we already have.
40 2017-02-10 Marek Polacek <polacek@redhat.com>
43 * pt.c (type_dependent_expression_p): Check if the expression type
47 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
48 if warnings shouldn't be given.
50 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
53 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
54 an error_mark_node as type.
56 2017-02-09 Jakub Jelinek <jakub@redhat.com>
57 Jason Merrill <jason@redhat.com>
60 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
63 2017-02-09 Jason Merrill <jason@redhat.com>
65 PR c++/79316 - default argument in deduction guide
66 PR c++/79350 - explicit deduction guide
67 * parser.c (cp_parser_constructor_declarator_p)
68 (cp_parser_direct_declarator): Parse deduction guides more like
70 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
71 * tree.c (special_function_p): Return it.
72 * decl.c (check_special_function_return_type): Handle it.
73 (grokdeclarator, grokfndecl): Adjust.
74 (cp_finish_decl): Pass flags to do_auto_deduction.
75 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
76 * pt.c (dguide_name_p): Take a const_tree.
77 (do_class_deduction): Handle explicit.
78 (do_auto_deduction): Pass flags through.
79 (build_deduction_guide): Copy explicit flag.
81 2017-02-09 Jakub Jelinek <jakub@redhat.com>
84 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
85 non-pragma_compound context here.
86 (cp_parser_omp_target): Likewise.
87 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
88 parsing for ordered and target omp pragmas in non-pragma_stmt
89 non-pragma_compound contexts.
92 * parser.c (cp_parser_oacc_declare): Formatting fix.
93 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
96 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
97 Chung-Lin Tang <cltang@codesourcery.com>
99 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
100 parsing. Parse constant expression. Remove semantic checking.
101 (cp_parser_omp_clause_collapse): Disallow tile.
102 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
103 error about missing for after already emitting one. Use more
104 conventional for idiom for unbounded loop.
105 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
106 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
107 (finish_omp_for): Deal with tile clause.
109 2017-02-07 Nathan Sidwell <nathan@acm.org>
111 * method.c (synthesized_method_base_walk): New. Broken out of ...
112 (synthesized_method_walk): ... here. Call it. Cleanup
115 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
118 * typeck2.c (process_init_constructor_union): Consider only
119 FIELD_DECLs when looking for an NSDMI.
121 2017-02-06 Jason Merrill <jason@redhat.com>
123 PR c++/71193 - incomplete types in templates
124 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
125 handle incomplete type by pedwarning and then treating as dependent.
127 2017-02-06 Jakub Jelinek <jakub@redhat.com>
130 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
131 (potential_constant_expression_1): Likewise.
134 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
135 allow one fewer than expected arguments if flag_permissive.
138 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
139 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
140 with error_mark_node type.
142 2017-02-03 Jason Merrill <jason@redhat.com>
144 PR c++/78689 - ICE on constructor with label
145 * optimize.c (maybe_clone_body): Replace omitted parameters with
147 * class.c (build_clone): Fix logic for omitting inherited parms.
149 PR c++/12245 - excessive memory use
150 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
151 back in. Don't cache constants.
152 (maybe_constant_init): Don't cache constants.
154 PR c++/79294 - ICE with invalid template argument
155 * pt.c (convert_nontype_argument_function): Check value-dependence.
156 (convert_nontype_argument): Don't check it here for function ptrs.
158 2017-02-02 Richard Biener <rguenther@suse.de>
161 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
162 it lazily on the first changed element only and copy it
163 fully upfront, only storing changed elements.
165 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
168 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
171 2017-01-31 Jakub Jelinek <jakub@redhat.com>
174 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
177 2017-01-31 David Malcolm <dmalcolm@redhat.com>
180 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
181 any namespace aliases.
183 2017-01-31 Nathan Sidwell <nathan@acm.org>
186 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
190 * pt.c: (instantiate_decl): Push to top level when current
191 function scope doesn't match. Only push lmabda scope stack when
194 * cp-tree.h (instantiate_decl): Make defer_ok bool.
195 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
196 (instantiate_decl): Simplify and reorder state saving and restoration.
199 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
200 * semantics.c (finish_member_declaration): Assert class is being
203 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
205 Introduce C++ support in libcc1.
206 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
207 (ansi_opname): Rename to...
208 (cp_operator_id): ... this. Adjust all callers.
209 (ansi_assopname): Rename to...
210 (cp_assignment_operator_id): ... this. Adjust all callers.
211 (cp_literal_operator_id): Declare.
212 (set_global_friend): Declare.
213 (is_global_friend): Declare.
214 (enum cp_oracle_request): New type.
215 (cp_binding_oracle_function): New type.
216 (cp_binding_oracle): Declare.
217 (cp_finish_injected_record_type): Declare.
218 * friend.c (global_friend): New var.
219 (set_global_friend): New fn.
220 (is_global_friend): New fn.
221 (is_friend): Call is_global_friend.
222 * name-lookup.c (cp_binding_oracle): New var.
223 (query_oracle): New fn.
224 (qualified_lookup_using_namespace): Call query_oracle.
225 (lookup_name_real_1): Likewise.
226 * parser.c (cp_literal_operator_id): Drop static.
227 * search.c (friend_accessible_p): Call is_global_friend.
228 * semantics.c (is_this_parameter): Accept a variable if the
229 binding oracle is enabled.
231 2017-01-27 Jason Merrill <jason@redhat.com>
233 PR c++/78771 - ICE with inherited constructor.
234 * call.c (build_over_call): Call deduce_inheriting_ctor here.
235 * pt.c (tsubst_decl): Not here.
236 * class.c (add_method): Or here.
237 * method.c (deduce_inheriting_ctor): Handle clones.
238 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
240 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
243 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
245 * cp/cp-tree.h: Declare it.
246 * cp/semantics.c (finish_id_expression): Resolve names within a default
247 capturing generic lambda defined within a template prior to
248 instantiation to allow for captures to be added to the closure type.
250 2017-01-26 Jakub Jelinek <jakub@redhat.com>
253 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
254 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
255 * parser.c (cp_parser_builtin_offsetof): Pass result of
256 build_static_cast of null_pointer_node to finish_offsetof.
257 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
258 it for -Winvalid-offsetof pedwarn instead of trying to guess
259 original offsetof type from EXPR. Save OBJECT_PTR as a new
260 second operand to OFFSETOF_EXPR.
261 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
262 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
265 2017-01-26 Jason Merrill <jason@redhat.com>
267 * name-lookup.c (parse_using_directive): Deprecate strong using.
269 PR c++/79176 - lambda ICE with -flto -Os
270 * decl2.c (vague_linkage_p): Handle decloned 'tors.
271 * tree.c (decl_linkage): Likewise.
273 2017-01-25 Martin Sebor <msebor@redhat.com>
275 * decl.c (grokdeclarator): Fix a typo in a comment.
277 2017-01-25 Jakub Jelinek <jakub@redhat.com>
280 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
284 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
285 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
287 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
290 * decl.c (cxx_init_decl_processing): Pass main_input_filename
291 to build_translation_unit_decl.
293 2017-01-24 Jakub Jelinek <jakub@redhat.com>
296 * cp-gimplify.c (cp_genericize_r): Add result of
297 convert_from_reference on invisiref parm to p_set.
299 2017-01-24 Nathan Sidwell <nathan@acm.org>
301 PR c++/78469 - defaulted ctor and inaccessible dtor
302 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
303 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
304 * tree.c (build_target_expr): Check tf_no_cleanup.
306 PR c++/79118 - anon-members and constexpr
307 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
308 ctor decl. Recursively check anonymous members.
309 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
311 (explain_invalid_constexpr_fn): Likewise.
313 2017-01-23 Nathan Sidwell <nathan@acm.org>
315 PR c++/71710 - template using directive of field
316 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
319 PR c++/71406 - ICE with scope-ref'd template id exprs
321 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
322 before breaking up TEMPLATE_ID_EXPR.
324 2017-01-20 Nathan Sidwell <nathan@acm.org>
326 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
327 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
329 2017-01-20 David Malcolm <dmalcolm@redhat.com>
333 * cp-tree.h (suggest_alternatives_for): Add bool param.
334 (suggest_alternative_in_explicit_scope): New decl.
335 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
336 that isn't the global one, call new function
337 suggest_alternative_in_explicit_scope, only calling
338 suggest_alternatives_for if it fails, and disabling near match
339 searches fort that case. When SCOPE is the global namespace,
340 pass true for new param to suggest_alternatives_for to allow for
342 * lex.c (unqualified_name_lookup_error): Pass true for new param
343 to suggest_alternatives_for.
344 * name-lookup.c (consider_binding_level): Add forward decl.
345 (suggest_alternatives_for): Add "suggest_misspellings" param,
346 using it to conditionalize the fuzzy name-lookup code.
347 (suggest_alternative_in_explicit_scope): New function.
348 * parser.c (cp_parser_primary_expression): When calling
349 finish_id_expression, pass location of id_expression rather
350 than that of id_expr_token.
351 (cp_parser_id_expression): Convert local "unqualified_id" from
352 tree to cp_expr to avoid implicitly dropping location information.
354 2017-01-20 Marek Polacek <polacek@redhat.com>
357 * call.c (build_conditional_expr_1): Warn about duplicated branches.
358 * semantics.c (finish_expr_stmt): Build statement using the proper
361 2017-01-19 Jason Merrill <jason@redhat.com>
363 US 20 - forwarding references and class template argument deduction
364 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
365 * pt.c (push_template_decl_real): Set it.
366 (maybe_adjust_types_for_deduction): Check it.
367 (rewrite_template_parm): Copy it.
369 US 19 - deduction guides and constructors
370 * call.c (joust): Prefer deduction guides to constructors.
371 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
372 (deduction_guide_p): Check DECL_P.
374 * decl.c (check_initializer): Always use build_aggr_init for array
377 PR c++/79130 - decomposition and direct-initialization
378 * init.c (build_aggr_init): Communicate direct-initialization to
380 (build_vec_init): Check for array copy sooner.
381 * parser.c (cp_parser_decomposition_declaration): Remove call to
382 build_x_compound_expr_from_list.
384 2017-01-18 Jason Merrill <jason@redhat.com>
386 PR c++/68666 - member variable template-id
387 * typeck.c (finish_class_member_access_expr): Handle variable
389 * pt.c (lookup_and_finish_template_variable): No longer static.
390 * cp-tree.h: Declare it.
392 2017-01-18 Nathan Sidwell <nathan@acm.org>
395 * call.c (build_over_call): When checking ellipsis conversions for
396 an inherited ctor, make sure there is at least one conversion.
398 2017-01-18 Jason Merrill <jason@redhat.com>
400 PR c++/78894 - ICE with class deduction and default arg
401 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
403 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
406 * mangle.c (write_discriminator): Reorganize abi warning check.
408 2017-01-18 Nathan Sidwell <nathan@acm.org>
410 * cp-tree.h: Clarify exception spec node comment.
411 * except.c (nothrow_spec_p): Simplify by checking node-equality.
414 * mangle.c (write_exception_spec): Check nothrow explicitly.
415 (write_encoding): Don't increment processing_template_decl around
418 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
421 * mangle.c (write_template_args): Add "on" for operator names.
423 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
426 * mangle.c (write_discriminator): Handle discriminator >= 10.
428 2017-01-17 Nathan Sidwell <nathan@acm.org>
431 * cp-tree.h (maybe_generic_this_capture): Declare.
432 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
433 (maybe_resolve_dummy): ... here. Call it.
434 (maybe_generic_this_capture): New.
435 * parser.c (cp_parser_postfix_expression): Speculatively capture
436 this in generic lambda in unresolved member function call.
437 * pt.c (tsubst_copy_and_build): Force hard error from failed
438 member function lookup in generic lambda.
440 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
443 * cp-array-notation.c (expand_array_notation_exprs): Handle
446 2017-01-11 Jason Merrill <jason@redhat.com>
448 PR c++/78337 - ICE on invalid with generic lambda
449 * semantics.c (process_outer_var_ref): Check if containing_function
450 is null. Move inform call under complain test.
452 2017-01-11 Nathan Sidwell <nathan@acm.org>
455 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
458 2017-01-11 Nathan Sidwell <nathan@acm.org>
460 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
462 2017-01-11 Jakub Jelinek <jakub@redhat.com>
465 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
466 assertion. Formatting fix.
469 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
472 2017-01-10 David Malcolm <dmalcolm@redhat.com>
475 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
476 a missing semicolon if we have a valid insertion location for
479 2017-01-10 Jason Merrill <jason@redhat.com>
481 FI 20, decomposition declaration with parenthesized initializer.
482 * parser.c (cp_parser_decomposition_declaration): Use
483 cp_parser_initializer.
485 2017-01-09 Jason Merrill <jason@redhat.com>
487 Implement P0195R2, C++17 variadic using.
488 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
489 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
490 * error.c (dump_decl): Likewise.
492 2017-01-09 Jakub Jelinek <jakub@redhat.com>
496 * semantics.c (finish_omp_clauses): Add missing whitespace to
497 translatable strings.
498 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
500 2017-01-07 Jason Merrill <jason@redhat.com>
502 PR c++/78948 - instantiation from discarded statement
503 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
504 * cp-tree.h (in_discarded_stmt): Declare it.
505 (struct saved_scope): Add discarded_stmt bitfield.
506 (in_discarded_stmt): New macro.
507 * decl2.c (mark_used): Check it.
508 * parser.c (cp_parser_selection_statement): Adjust.
509 (cp_parser_jump_statement): Adjust.
511 2017-01-05 Jakub Jelinek <jakub@redhat.com>
514 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
515 REFERENCE_REF_P, set tt to its operand.
518 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
519 unions even for C++11 and later.
521 2017-01-05 Nathan Sidwell <nathan@acm.org>
524 * pt.c (convert_nontype_argument): Don't try and see if integral
525 or enum expressions are constants prematurely.
527 2017-01-04 Marek Polacek <polacek@redhat.com>
530 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
531 a zero character literal.
533 2017-01-04 Jakub Jelinek <jakub@redhat.com>
536 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
540 * parser.c (cp_parser_simple_declaration): Only complain about
541 inconsistent auto deduction if auto_result doesn't use auto.
543 * parser.c (cp_parser_simple_declaration): Diagnose function
544 declaration among more than one init-declarators with auto
548 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
549 assertion, as lexer->buffer may be NULL.
551 2017-01-04 Marek Polacek <polacek@redhat.com>
555 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
557 2017-01-04 Nathan Sidwell <nathan@acm.org>
560 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
561 (lambda_capture_field_type): Update prototype.
562 * lambda.c (lambda_capture_field_type): Add is_reference parm.
563 Add referenceness here.
564 (add_capture): Adjust lambda_capture_field_type call, refactor
566 * pt.c (tsubst): Adjust lambda_capture_field_type call.
568 2017-01-01 Jakub Jelinek <jakub@redhat.com>
570 Update copyright years.
572 Copyright (C) 2017 Free Software Foundation, Inc.
574 Copying and distribution of this file, with or without modification,
575 are permitted in any medium without royalty provided the copyright
576 notice and this notice are preserved.