Re: [PATCH] c++: avoid name lookup during mangling

2024-02-09 Thread Patrick Palka
On Fri, 9 Feb 2024, Jason Merrill wrote: > On 2/9/24 11:55, Patrick Palka wrote: > > On Fri, 9 Feb 2024, Jason Merrill wrote: > > > > > On 2/9/24 10:51, Patrick Palka wrote: > > > > It turns out that with modules we can call mangle_decl recursively, > > > > which is a problem because the global m

Re: [PATCH] c++: avoid name lookup during mangling

2024-02-09 Thread Jason Merrill
On 2/9/24 11:55, Patrick Palka wrote: On Fri, 9 Feb 2024, Jason Merrill wrote: On 2/9/24 10:51, Patrick Palka wrote: It turns out that with modules we can call mangle_decl recursively, which is a problem because the global mangling state isn't recursion aware. The recursion happens from write

Re: [PATCH] c++: avoid name lookup during mangling

2024-02-09 Thread Patrick Palka
On Fri, 9 Feb 2024, Jason Merrill wrote: > On 2/9/24 10:51, Patrick Palka wrote: > > It turns out that with modules we can call mangle_decl recursively, > > which is a problem because the global mangling state isn't recursion > > aware. The recursion happens from write_closure_type_name, which ca

Re: [PATCH] c++: avoid name lookup during mangling

2024-02-09 Thread Jason Merrill
On 2/9/24 10:51, Patrick Palka wrote: It turns out that with modules we can call mangle_decl recursively, which is a problem because the global mangling state isn't recursion aware. The recursion happens from write_closure_type_name, which calls lambda function, which performs name lookup, which

[PATCH] c++: avoid name lookup during mangling

2024-02-09 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look reasonable? -- >8 -- It turns out that with modules we can call mangle_decl recursively, which is a problem because the global mangling state isn't recursion aware. The recursion happens from write_closure_type_name, which calls l