https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104615
Bug ID: 104615
Summary: [Concepts] ICE in explicit instantiation when multiple
candidates are valid (CWG2421)
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: roi.jacobson1 at gmail dot com
Target Milestone: ---
#include <concepts>
template<class T>
struct B {
int f() requires (!std::same_as<T, char>) {
return 0;
}
int f() requires (!std::same_as<T, char> && !std::same_as<T, float>) {
return 1;
}
};
template struct B<int>;
This crashes GCC with "<source>:12:23: error: Two symbols with same
comdat_group are not linked by the same_comdat_group list." as both functions
are compiled and have the same mangling.
Also, CWG2421 is still open about what the actual behavior should be in this
case.