[PATCH] D129748: [C++20] [Modules] Warn for the use of preferred_name in modules

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 02:58:45 PDT 2022


ChuanqiXu added a comment.

In D129748#3666511 <https://reviews.llvm.org/D129748#3666511>, @tahonermann wrote:

> I can imagine several ways in which things may be going wrong. Perhaps (de)serialization is switching to a canonical declaration when it should not be (e.g., reading/writing a definition when only a declaration should be). Perhaps, for implicitly instantiated declarations (at least for ones for which `__preferred_name__` is attached), separate non-defining and defining declarations should be (de)serialized (in the dumps above, there appears to only be a single address associated with the `basic_string_view<char>` specialization). Perhaps `ClassTemplateSpecializationDecl` should be (de)serialized such that a (valid) non-defining declaration is created before attempting to load anything else that might lead to recursion to the same declaration (the intent being that an early return when recursion is detected still yields a valid incomplete declaration).

I feel like the problem may come in the process of instantiation. For example, if we add the attribute for  `CXXRecordDecl` at `0x7913a18` in this specific case, it would be fine. Although it **may** be OK to address the problem in serialization/deserialization side too, I just feel like it might not be worhy now..


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129748/new/

https://reviews.llvm.org/D129748



More information about the cfe-commits mailing list