[all-commits] [llvm/llvm-project] 42f87b: [Sema] Return primary merged decl as canonical for...
Ilya Biryukov via All-commits
all-commits at lists.llvm.org
Wed Jul 27 03:31:51 PDT 2022
Author: Ilya Biryukov <ibiryukov at google.com>
Date: 2022-07-27 (Wed, 27 Jul 2022)
[Sema] Return primary merged decl as canonical for concepts
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
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
More information about the All-commits