From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A0B03858D35; Tue, 27 Dec 2022 13:54:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A0B03858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672149276; bh=NYcd2Zjm6skXWZJ+eKIygcp4AV57iTGwDrGZWJpWGlg=; h=From:To:Subject:Date:From; b=t6ax2GDOSEepl/RyTyDccnIW+IwJQD87FxC80FkksCiqT73rDP0bSadJ90zt6IKwo YkGLcxtWeyJ7BpoDDxuSKpxsvv6m8PPnGNekg7P0n15sIdzKYgPGPewIWIYAvdjq00 TWpKnlRArk0l17PJA4zhLLqRAYsuzPpJxiXder50= From: "jlame646 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108234] New: GCC accepts invalid program involving nontype template parameter of auto with non constexpr variable Date: Tue, 27 Dec 2022 13:54:36 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jlame646 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=3D108234 Bug ID: 108234 Summary: GCC accepts invalid program involving nontype template parameter of auto with non constexpr variable Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jlame646 at gmail dot com Target Milestone: --- GCC trunk accepts the following invalid program: https://godbolt.org/z/h5q7589Tr ``` template struct X{}; template int func(X) { return 1; } int i; int main() { return func(X{}); } ``` Clang rejects the above program while gcc and msvc accepts it.=