Closed
Description
Given the following valid set of translation units:
module;
template<typename = void>
struct s {
};
template<typename>
concept c = requires { s{}; };
export module a;
module;
template<typename = void>
struct s {
};
template<typename>
concept c = requires { s{}; };
export module b;
import a;
And compiling with
clang++ -std=c++20 -x c++-module a.cpp --precompile -o a.pcm
clang++ -std=c++20 -x c++-module b.cpp --precompile -o b.pcm -fmodule-file=a.pcm
Causes Clang to fail with
b.cpp:8:9: error: redefinition of concept 'c' with different template parameters or requirements
concept c = requires { s{}; };
^
a.cpp:8:9: note: previous definition is here
concept c = requires { s{}; };
^
1 error generated.
The practical effect of this bug is that #include <ranges>
fails when used in two modules with libstdc++.