[Bug c++/101677] [11/12 Regression] Concept with use of incomplete type succeeds on GCC 10.3.0, fails on GCC 11 onward

joeloser93 at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jul 30 15:50:14 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101677

--- Comment #2 from Joe Loser <joeloser93 at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> >This bug can be worked around by using a complete type instead when defining the concept. 
> 
> It does not even have to be complete type; just defined before.
> So adding:
> class S;
> at the begining causes GCC to accept the code.

Yep, you're right. That's actually what I use in my codebase as a workaround. I
misspoke in the description -- sorry about that. Updated Godbolt link is at
https://godbolt.org/z/KGq48WYq4


More information about the Gcc-bugs mailing list