From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DED913857003; Tue, 13 Oct 2020 09:58:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DED913857003 From: "renlin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97399] New: g++ 9.3 cannot compile SFINAE code with separated declaration and definition, g++ 7.3 compiles Date: Tue, 13 Oct 2020 09:58:14 +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: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: renlin at gcc dot gnu.org 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 attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 09:58:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97399 Bug ID: 97399 Summary: g++ 9.3 cannot compile SFINAE code with separated declaration and definition, g++ 7.3 compiles Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: renlin at gcc dot gnu.org Target Milestone: --- Created attachment 49362 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49362&action=3Dedit test case 1 For gcc_1.c++ gcc 7.3 compiles for this code clang 7 compiles for this code gcc 9.3 fails to compile with following message Not sure if this is gcc's issue or clang. ``` :29:16: error: no declaration matches 'constexpr enable_if_t<((tmp*)this)->is_integral(), bool> tmp::func(E, E) const' 29 | constexpr auto tmp::func(E f_lhs, E f_rhs) | ^~~ :18:27: note: candidate is: 'template static constexpr enable_if_t<((tmp*)this)->is_integral(), bool> tmp::func(E, E)' 18 | static constexpr auto func(E f_lhs, E f_rhs) | ^~~~ :12:8: note: 'struct tmp' defined here 12 | struct tmp ``` Meanwhile for gcc_2.c++ gcc compiles without any issue. clang gives the following error message ``` :27:28: error: template parameter redefines default argument template (), bool>> ^ :17:32: note: previous default template argument defined here template (), bool>> ``` It seems this is not an new issue, and might be duplicated.=