This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/79994] Concepts technical specification


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]