This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/89612 - ICE with member friend template with noexcept
- From: Jason Merrill <jason at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Mar 2019 16:22:41 -0400
- Subject: Re: C++ PATCH for c++/89612 - ICE with member friend template with noexcept
- References: <20190307215255.GI26967@redhat.com>
On 3/7/19 4:52 PM, Marek Polacek wrote:
This was one of those PRs where the more you poke, the more ICEs turn up.
This patch fixes the ones I could find. The original problem was that
maybe_instantiate_noexcept got a TEMPLATE_DECL created for the member
friend template in do_friend. Its noexcept-specification was deferred,
so we went to the block with push_access_scope, but that crashes on a
TEMPLATE_DECL. One approach could be to somehow not defer noexcept-specs
for friend templates, I guess, but I didn't want to do that.
How does it make sense to instantiate the noexcept-specifier of a
template? We should only get there for fully-instantiated function decls.
Lastly, I found an invalid testcase that was breaking because a template code
leaked to constexpr functions. This I fixed similarly to the recent explicit
PR fix (r269131).
This spot should probably also use build_converted_constant_expr.
Jason