Otherwise we get invalid results for ODR checks. See changed test for an example: despite the fact that we merge the first concept, its **uses** were considered different by `Profile`, leading to redefinition errors. After this change, canonical decl for a concept can come from a different module and may not be visible. This behavior looks suspicious, but does not break any tests. We might want to add a mechanism to make the canonical concept declaration visible if we find code that relies on this invariant. Additionally make sure we always merge with the canonical declaration to avoid chains of merged concepts being reported as redefinitions. An example was added to the test. Also change the order of includes in the test. Importing a moduralized header before its textual part causes the include guard macro to be exported and the corresponding `#include` becomes a no-op. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D130585
1.4 KiB
1.4 KiB