On 8/10/23 16:40, Patrick Palka wrote:
On Thu, 10 Aug 2023, Jason Merrill wrote:

On 8/10/23 12:09, Patrick Palka wrote:
Booststrapped and regtested on x86_64-pc-linux-gnu, does this look OK for
trunk and perhaps 13?

-- >8 --

We shouldn't issue a "declared static but never defined" warning
for a deduction guide (declared in an anonymous namespace).

        PR c++/106604

gcc/cp/ChangeLog:

        * decl.cc (wrapup_namespace_globals): Don't issue a
        -Wunused-function warning for a deduction guide.

Maybe instead of special casing this here we could set DECL_INITIAL on
deduction guides so they look defined?

That seems to work, but it requires some tweaks in duplicate_decls to keep
saying "declared" instead of "defined" when diagnosing a deduction guide
redeclaration.  I'm not sure which approach is preferable?

I'm not sure it matters which we say; the restriction that you can't repeat a deduction guide makes it more like a definition anyway (even if [basic.def] disagrees). Is the diagnostic worse apart from that word?

Jason

Reply via email to