|
| 1 | +2024-12-20 Jakub Jelinek < [email protected]> |
| 2 | + |
| 3 | + PR c++/110345 |
| 4 | + * tree.cc (handle_maybe_unused_attribute): New function. |
| 5 | + (std_attributes): Use handle_maybe_unused_attribute instead |
| 6 | + of handle_unused_attribute for maybe_unused attribute. |
| 7 | + |
| 8 | +2024-12-20 Jakub Jelinek < [email protected]> |
| 9 | + |
| 10 | + PR c++/110345 |
| 11 | + * parser.cc (cp_parser_std_attribute): Don't transform |
| 12 | + [[deprecated]] into [[gnu::deprecated]]. |
| 13 | + * tree.cc (handle_std_deprecated_attribute): New function. |
| 14 | + (std_attributes): Add deprecated entry. |
| 15 | + |
| 16 | +2024-12-20 Nathaniel Shead < [email protected]> |
| 17 | + |
| 18 | + PR c++/116401 |
| 19 | + * decl.cc (grokfndecl): Mark deduction guides as 'inline'. |
| 20 | + * module.cc (check_module_decl_linkage): Implement checks for |
| 21 | + non-inline external linkage definitions in headers. |
| 22 | + |
| 23 | +2024-12-20 Nathaniel Shead < [email protected]> |
| 24 | + |
| 25 | + * cp-tree.h (check_module_decl_linkage): Declare. |
| 26 | + * decl2.cc (finish_static_data_member_decl): Check linkage. |
| 27 | + * module.cc (set_originating_module): Adjust comment. |
| 28 | + (check_module_decl_linkage): New function. |
| 29 | + * name-lookup.cc (do_namespace_alias): Build alias with |
| 30 | + specified location, check linkage. |
| 31 | + (pushtag): Check linkage. |
| 32 | + (push_namespace): Slightly clarify error message. |
| 33 | + * name-lookup.h (do_namespace_alias): Add location parameter. |
| 34 | + * parser.cc (cp_parser_namespace_alias_definition): Pass |
| 35 | + identifier location to do_namespace_alias. |
| 36 | + (cp_parser_alias_declaration): Check linkage. |
| 37 | + (cp_parser_init_declarator): Check linkage. |
| 38 | + (cp_parser_function_definition_after_declarator): Check linkage. |
| 39 | + (cp_parser_save_member_function_body): Check linkage. |
| 40 | + * pt.cc (finish_concept_definition): Mark as public, check |
| 41 | + linkage. |
| 42 | + |
| 43 | +2024-12-20 Nathaniel Shead < [email protected]> |
| 44 | + |
| 45 | + * module.cc (depset::hash::add_binding_entity): Also walk |
| 46 | + unnamed namespaces. |
| 47 | + (module_state::write_namespaces): Adjust assertion. |
| 48 | + * name-lookup.cc (push_namespace): Move anon using-directive |
| 49 | + handling to... |
| 50 | + (make_namespace_finish): ...here. |
| 51 | + |
| 52 | +2024-12-20 Nathaniel Shead < [email protected]> |
| 53 | + |
| 54 | + * cp-objcp-common.cc (cp_tree_size): Add TU_LOCAL_ENTITY. |
| 55 | + * cp-tree.def (TU_LOCAL_ENTITY): New tree code. |
| 56 | + * cp-tree.h (DECL_TEMPLATE_INSTANTIATIONS): Update comment. |
| 57 | + (struct tree_tu_local_entity): New type. |
| 58 | + (TU_LOCAL_ENTITY_NAME): New accessor. |
| 59 | + (TU_LOCAL_ENTITY_LOCATION): New accessor. |
| 60 | + (enum cp_tree_node_structure_enum): Add TS_CP_TU_LOCAL_ENTITY. |
| 61 | + (union GTY): Add tu_local_entity field. |
| 62 | + * module.cc (enum tree_tag): New flag DB_REFS_TU_LOCAL_BIT. |
| 63 | + (depset::has_defn): Override for TU-local entities. |
| 64 | + (depset::refs_tu_local): New accessor. |
| 65 | + (depset::hash::ignore_tu_local): New field. |
| 66 | + (depset::hash::hash): Initialize it. |
| 67 | + (trees_out::tree_tag::tt_tu_local): New flag. |
| 68 | + (trees_out::writing_local_entities): New field. |
| 69 | + (trees_out::is_initial_scan): New function. |
| 70 | + (trees_out::tu_local_count): New counter. |
| 71 | + (trees_out::trees_out): Initialize writing_local_entities. |
| 72 | + (dumper::impl::nested_name): Handle TU_LOCAL_ENTITY. |
| 73 | + (trees_out::instrument): Report TU-local entity counts. |
| 74 | + (trees_out::decl_value): Early exit for TU-local entities. |
| 75 | + (trees_in::decl_value): Handle typedefs of TU-local entities. |
| 76 | + (trees_out::decl_node): Adjust assertion to cope with early exit |
| 77 | + of TU-local deps. Always write TU-local entities by value. |
| 78 | + (trees_out::type_node): Handle TU-local types. |
| 79 | + (trees_out::has_tu_local_dep): New function. |
| 80 | + (trees_out::find_tu_local_decl): New function. |
| 81 | + (trees_out::tree_node): Intercept TU-local entities and write |
| 82 | + placeholder values for them instead of normal streaming. |
| 83 | + (trees_in::tree_node): Handle TU-local entities and TU-local |
| 84 | + template results. |
| 85 | + (trees_out::write_function_def): Ignore exposures in non-inline |
| 86 | + function bodies. |
| 87 | + (trees_out::write_var_def): Ignore exposures in initializers. |
| 88 | + (trees_out::write_class_def): Ignore exposures in friend decls. |
| 89 | + (trees_in::read_class_def): Skip TU-local friends. |
| 90 | + (trees_out::write_definition): Record whether we're writing a |
| 91 | + decl which refers to TU-local entities. |
| 92 | + (depset::hash::add_dependency): Only mark as exposure if we're not |
| 93 | + ignoring TU-local entities. |
| 94 | + (depset::hash::find_dependencies): Use depset's own is_key_order |
| 95 | + function rather than delegating via walker. Pass whether the |
| 96 | + decl has ignored TU-local entities in its definition. |
| 97 | + (template_has_explicit_inst): New function. |
| 98 | + (depset::hash::finalize_dependencies): Implement new warning |
| 99 | + Wtemplate-names-tu-local. |
| 100 | + (module_state::intercluster_seed): Don't seed TU-local deps. |
| 101 | + (module_state::write_cluster): Pass whether the decl has ignored |
| 102 | + TU-local entities in its definition. |
| 103 | + * pt.cc (register_specialization): Always register in a module. |
| 104 | + (complain_about_tu_local_entity): New function. |
| 105 | + (expr_contains_tu_local_entity): New function. |
| 106 | + (function_contains_tu_local_entity): New function. |
| 107 | + (instantiate_class_template): Skip TU-local friends. |
| 108 | + (tsubst_decl): Handle typedefs of TU-local entities. |
| 109 | + (tsubst): Complain about TU-local entities. |
| 110 | + (dependent_operand_p): Early exit for TU-local entities so we |
| 111 | + don't attempt to constant-evaluate them. |
| 112 | + (tsubst_expr): Detect and complain about TU-local entities. |
| 113 | + |
| 114 | +2024-12-20 Nathaniel Shead < [email protected]> |
| 115 | + |
| 116 | + * tree.cc (decl_linkage): Treat DECL_SELF_REFERENCE_P like |
| 117 | + DECL_IMPLICIT_TYPEDEF_P. |
| 118 | + * name-lookup.cc (do_namespace_alias): Fix linkage. |
| 119 | + * module.cc (DB_IS_INTERNAL_BIT): Rename to... |
| 120 | + (DB_TU_LOCAL_BIT): ...this. |
| 121 | + (DB_REFS_INTERNAL_BIT): Rename to... |
| 122 | + (DB_EXPOSURE_BIT): ...this. |
| 123 | + (depset::hash::is_internal): Rename to... |
| 124 | + (depset::hash::is_tu_local): ...this. |
| 125 | + (depset::hash::refs_internal): Rename to... |
| 126 | + (depset::hash::is_exposure): ...this. |
| 127 | + (depset::hash::is_tu_local_entity): New function. |
| 128 | + (depset::hash::has_tu_local_tmpl_arg): New function. |
| 129 | + (depset::hash::is_tu_local_value): New function. |
| 130 | + (depset::hash::make_dependency): Check for TU-local entities. |
| 131 | + (depset::hash::add_dependency): Make current an exposure |
| 132 | + whenever it references a TU-local entity. |
| 133 | + (depset::hash::add_binding_entity): Don't create bindings for |
| 134 | + any TU-local entity. |
| 135 | + (depset::hash::finalize_dependencies): Rename flags and adjust |
| 136 | + diagnostic messages to report exposures of TU-local entities. |
| 137 | + (depset::tarjan::connect): Don't include any TU-local depsets. |
| 138 | + (depset::hash::connect): Likewise. |
| 139 | + |
1 | 140 | 2024-12-19 Patrick Palka < [email protected]> |
2 | 141 |
|
3 | 142 | PR c++/118069 |
|
0 commit comments