From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 95A183858D20; Thu, 9 Mar 2023 19:23:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95A183858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678389830; bh=np0mMZfFokxoVgaLn2+6yFGJtivtoDWZFJdyHMxnyfc=; h=From:To:Subject:Date:From; b=wCnVqw6fzrh53yuYu9O6QwHbZhTKTQYLZskMx4n1z87GnaWe/Zlxg621HaHirCWZ4 7PGmD6iKVhyCl/LXnGGO5v8b5oqN+h3RctUjsAYWnPMN7dmlcuJp32pZeBmqu3R/aK 1iYFX7olIEO81af6gsTMU0bMiiqrvDXbeeHhHi8Q= From: "markus-t314 at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109083] New: Incorrect static_assert shown in diagnostics Date: Thu, 09 Mar 2023 19:23:50 +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: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: markus-t314 at gmx dot de 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=3D109083 Bug ID: 109083 Summary: Incorrect static_assert shown in diagnostics Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: markus-t314 at gmx dot de Target Milestone: --- Code: #include template void unused_function() { static_assert(std::is_member_function_pointer::value, "Line 6"); } template void fail_here() { static_assert(std::is_member_function_pointer::value, "Line 12"); } int main() { fail_here(); } This fails correctly, but the wrong static assertion is given in diagnostic= s: main.cpp: In instantiation of =E2=80=98void fail_here() [with T =3D int]=E2= =80=99: main.cpp:17:19: required from here main.cpp:6:60: error: =E2=80=98foo=E2=80=99 is not a member of =E2=80=98int= =E2=80=99 6 |=20=20=20=20 static_assert(std::is_member_function_pointer::value, "L= ine 6"); | https://godbolt.org/z/6Yrc9x6Ws Might be related to bug 66968=