When we use concept in modules, we would meet a curious error. For example:
C++ // foo.h #ifndef FOO_H #define FOO_H template< class T > concept Range = requires(T& t) { t.begin(); }; namespace workspace { struct A { public: template <Range T> using range_type = T; }; } #endif // A.cppm module; #include "foo.h" export module A; // B.cppm module; #include "foo.h" export module B; import A;
The compiler would tell us that the definition of workspace::A::range_type in B.cppm is not the same with the one in A.cppm!
The reason here is that the implementation would judge two concepts is same by their addresses. However, when we use modules, the addresses wouldn't be the same all the time since one is parsed in their TU and another is imported in another TU.
This patch fixes this by using isSameEntity to judge the two concepts. I think it should be a good fix.
Test Plan: check-all