Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)
> > + if (tmpl) > > + push_tinst_level (tmpl); > > Actually, why not pass 't' here? I thought it would matter if 't' was a non-template. Turns out it doesn't. Updated and committed.
Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)
On 11/18/19 10:18 AM, Andrew Sutton wrote: I forgot to mention a somewhat odd test included in the patch: concepts-recursive-sat3.C does not recurse. Code follows: template concept Fooable = requires(T t) { foo(t); }; template void foo(T t) { } void test() { foo(0); // { dg-error "unsatisfied constraints" } } It doesn't crash, but it doesn't diagnose also doesn't fail as a result of recursive instantiation. The recursive-sat2.C test is the same except that it instantiates foo with a class type. This seems like it might be related to ADL, but entirely certain. Yes; since 0 has non-class type, we don't do ADL to find a declaration of foo, and there were no declarations of foo before the call in Fooable, so the call fails. Jason
Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)
On 11/18/19 10:13 AM, Andrew Sutton wrote: This applies on top of the patch here: https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01034.html Wrap satisfaction with push/pop_tinst_level to force termination on recursion. + if (tmpl) + push_tinst_level (tmpl); Actually, why not pass 't' here? Jason
Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)
On 11/18/19 10:13 AM, Andrew Sutton wrote: This applies on top of the patch here: https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01034.html Wrap satisfaction with push/pop_tinst_level to force termination on recursion. Andrew Sutton OK.
Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)
I forgot to mention a somewhat odd test included in the patch: concepts-recursive-sat3.C does not recurse. Code follows: template concept Fooable = requires(T t) { foo(t); }; template void foo(T t) { } void test() { foo(0); // { dg-error "unsatisfied constraints" } } It doesn't crash, but it doesn't diagnose also doesn't fail as a result of recursive instantiation. The recursive-sat2.C test is the same except that it instantiates foo with a class type. This seems like it might be related to ADL, but entirely certain. Andrew Sutton On Mon, Nov 18, 2019 at 10:13 AM Andrew Sutton wrote: > > This applies on top of the patch here: > https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01034.html > > Wrap satisfaction with push/pop_tinst_level to force termination on recursion. > > Andrew Sutton
[PATCH] Prevent recursive satisfaction (PR c++/88395)
This applies on top of the patch here: https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01034.html Wrap satisfaction with push/pop_tinst_level to force termination on recursion. Andrew Sutton 0001-Prevent-recursive-satisfaction-PR-c-88395.patch Description: Binary data