This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/69300, ICE with self-referential noexcept
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Jun 2017 23:11:05 +0200 (CEST)
- Subject: Re: C++ PATCH for c++/69300, ICE with self-referential noexcept
- Authentication-results: sourceware.org; auth=none
- References: <CADzB+2kfHWBvbKquv7bXP=s2sG0OhFJNaS4vhn5dpDaUrao0VA@mail.gmail.com>
- Reply-to: gcc-patches List <gcc-patches at gcc dot gnu dot org>
On Wed, 28 Jun 2017, Jason Merrill wrote:
In the testcase we SEGV due to infinite recursion because the
noexcept-specifier of f depends on itself. Fixed by keeping track of
which functions we're currently trying to instantiate noexcept for.
Hello,
in the testcase, it makes sense that this is an error. In some other
cases, say for instance
int fact(int n) noexcept(auto) { return (n>1)?n*f(n-1):1; }
(yes, I know we still do not have noexcept(auto))
it would make sense to pretend that the recursive call does not throw for
the purpose of determining that fact is indeed noexcept. Then we get into
solving the same thing as IPA already does... And the standard does not
require implementations to be clever there. Still, it could have been nice
:-/
--
Marc Glisse