This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79994] Concepts technical specification
- From: "ensadc at mailnesia dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 21 Oct 2017 07:41:47 +0000
- Subject: [Bug c++/79994] Concepts technical specification
- Auto-submitted: auto-generated
- References: <bug-79994-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79994
ensadc at mailnesia dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ensadc at mailnesia dot com
--- Comment #1 from ensadc at mailnesia dot com ---
Simplified:
----
template <typename G>
concept bool Graph = requires (G& g) {
add(g);
};
template <Graph T>
void add(T& g) {
};
class Directed_Graph_impl {};
int main() {
Directed_Graph_impl t;
add(t);
}
----
The problem seems to be that the instantiation of `add` requires the
instantiation of `Graph` concept, but the latter, in turn, requires the former.
This leads to an infinite recursion and eventually causes segfault.