This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83345] c++1z produces an infinite recursion (c++1y works fine).
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Dec 2017 16:16:40 +0000
- Subject: [Bug c++/83345] c++1z produces an infinite recursion (c++1y works fine).
- Auto-submitted: auto-generated
- References: <bug-83345-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83345
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think that's the expected behaviour in C++17. The return statement in the
conversion operator no longer constructs an object in C++17, it calls the
conversion operator again.
This will fix it:
operator ref_proxy_t( void )
{
return ref_proxy_t( static_cast<ICondition&>(*this) );
}