From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CEB993858D39; Sat, 20 Jan 2024 11:52:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEB993858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705751571; bh=VyjPWcW7hlpV3w7b74RW+K6R1W+Nb0YxwAR0WXijiOo=; h=From:To:Subject:Date:From; b=s0jUTZ3swm1xpA5+YpTfZzm2nH83WRoes0QW3tt5A3evcx6GBElrEsWHtGJYKFOnQ UaBnlXWMg1AmJJcxrqiqt85y0wm6Xna4eyj6XMwdRwb+14wzXpOwrZ56pMzaK0t/Li 3M0Vx0g9WwJNDJfDR8J5ycKU9rinSFDoei0/2CD4= From: "fchelnokov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113523] New: A conversion function template can have a deduced return type Date: Sat, 20 Jan 2024 11:52:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fchelnokov at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113523 Bug ID: 113523 Summary: A conversion function template can have a deduced return type Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- Contrary to https://timsong-cpp.github.io/cppwp/n4861/class.conv.fct#6, GCC allows a conversion function template with a deduced return type: struct A { template constexpr operator auto() const { return 1; } }; constexpr int f() { return A{}.template operator auto(); } static_assert( f() =3D=3D 1 ); Online demo: https://godbolt.org/z/s8oK6rnPY In addition, the diagnostics "warning: use of 'auto' in member template conversion operator can never be deduced" seems wrong.=