Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread Patrick Palka
t; > > > > > > > and > > > > > > > > > > > > > only issue a generic error upon instantiation of the > > > > > > > > > > > > > erroneous > > > > > > > > > > > >

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread David Malcolm
> > > > > > > > of the > > > > > > > > > > > > > erroneous > > > > > > > > > > > > > template. > > > > > > > > > > > > > > > > > > > > > > > > ... or d

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread Jason Merrill
that. On that note it just occurred to me that we don't need to abort instantiation after the "instantiating erroneous template" error -- for sake of error recovery we can proceed to instantiate as if we issued a hard error at parse time. Agreed. Jason -- >8 -- Subject:

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread Patrick Palka
; > > > > > > > > > > > Yes. > > > > > > > > > > > > > > > > > > > IMHO I'm not sure that'd be worth the extra noise since the > > > > > > > > > > vast > > > > > >

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread Jason Merrill
diagnostics in the -Wno-template-body testcase a bit lacking since there's three instantiated templates with one logical error each, but only the first error is diagnosed. But I don't particularly mind that. On that note it just occurred to me that we don't need to abort ins

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread Patrick Palka
t; for > > > > > > > how > > > > > > > to make it compile, as with other permerrors. > > > > > > > > > > > > > > > And on second thought I'm not sure what extra value a new > > > > > >

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-06 Thread Jason Merrill
On 8/5/24 6:09 PM, Patrick Palka wrote: On Mon, 5 Aug 2024, Jason Merrill wrote: On 8/5/24 3:47 PM, Patrick Palka wrote: On Mon, 5 Aug 2024, Jason Merrill wrote: On 8/5/24 1:14 PM, Patrick Palka wrote: On Mon, 5 Aug 2024, Jason Merrill wrote: On 8/2/24 4:18 PM, Patrick Palka wrote: On Fr

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-05 Thread Patrick Palka
out > > > > > -fpermissive, like with the various permerror_opt cases. > > > > > > > > Since compiling legacy/unmaintained code is the only plausible use case, > > > > why have a dedicated warning flag instead of just recommending > >

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-05 Thread Jason Merrill
On 8/5/24 3:47 PM, Patrick Palka wrote: On Mon, 5 Aug 2024, Jason Merrill wrote: On 8/5/24 1:14 PM, Patrick Palka wrote: On Mon, 5 Aug 2024, Jason Merrill wrote: On 8/2/24 4:18 PM, Patrick Palka wrote: On Fri, 2 Aug 2024, Patrick Palka wrote: On Fri, 2 Aug 2024, Jason Merrill wrote: On

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-05 Thread Patrick Palka
es. > > > > Since compiling legacy/unmaintained code is the only plausible use case, > > why have a dedicated warning flag instead of just recommending -fpermissive > > when compiling legacy code? I don't quite understand the motivation for > > adding a new perm

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-05 Thread Jason Merrill
On 8/5/24 1:14 PM, Patrick Palka wrote: On Mon, 5 Aug 2024, Jason Merrill wrote: On 8/2/24 4:18 PM, Patrick Palka wrote: On Fri, 2 Aug 2024, Patrick Palka wrote: On Fri, 2 Aug 2024, Jason Merrill wrote: On 8/1/24 2:52 PM, Patrick Palka wrote: In recent versions of GCC we've been diagnosin

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-05 Thread Patrick Palka
On Mon, 5 Aug 2024, Jason Merrill wrote: > On 8/2/24 4:18 PM, Patrick Palka wrote: > > On Fri, 2 Aug 2024, Patrick Palka wrote: > > > > > On Fri, 2 Aug 2024, Jason Merrill wrote: > > > > > > > On 8/1/24 2:52 PM, Patrick Palka wrote: > > > > > In recent versions of GCC we've been diagnosing more

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-05 Thread Jason Merrill
On 8/2/24 4:18 PM, Patrick Palka wrote: On Fri, 2 Aug 2024, Patrick Palka wrote: On Fri, 2 Aug 2024, Jason Merrill wrote: On 8/1/24 2:52 PM, Patrick Palka wrote: In recent versions of GCC we've been diagnosing more and more kinds of errors inside a template ahead of time. This is a largely

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-02 Thread Patrick Palka
> > > m_warn_system_headers = false; > > > m_max_errors = 0; > > > m_internal_error = nullptr; > > > + m_adjust_diagnostic_info = nullptr; > > > m_text_callbacks.m_begin_diagnostic = default_diagnostic_starter; > > > m_text

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-02 Thread Patrick Palka
finalizer; > > @@ -1409,6 +1410,9 @@ diagnostic_context::report_diagnostic (diagnostic_info > > *diagnostic) > >flush diagnostics with on_end_group when the topmost group is ended. > > */ > > gcc_assert (m_diagnostic_groups.m_nesting_depth > 0); > &

Re: [PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-02 Thread Jason Merrill
On 8/1/24 2:52 PM, Patrick Palka wrote: In recent versions of GCC we've been diagnosing more and more kinds of errors inside a template ahead of time. This is a largely good thing because it catches bugs, typos, dead code etc sooner. But if the template never gets instantiated then such errors

[PATCH] c++: permit errors inside uninstantiated templates [PR116064]

2024-08-01 Thread Patrick Palka
In recent versions of GCC we've been diagnosing more and more kinds of errors inside a template ahead of time. This is a largely good thing because it catches bugs, typos, dead code etc sooner. But if the template never gets instantiated then such errors are harmless, and can be inconvenient to w