From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E38903858D39; Wed, 28 Dec 2022 19:35:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E38903858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672256154; bh=BCupIwHKLdU0n3/Vhs2WouktpLLkJx0IigEPOL5ZmBI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KyOQVH1aOA2BuZKc1Yvir8CmIsZ0DDR2YDfa1yFxkD8bzwjxwFlSaaaQL5fZsr0Pf Hm/goFSrzIt2aGsLiTwZxtHoTQbi3LvlaRJjsDOTDbdDxTfqbS2fIIBKgxIxoual4k u4GCZYScEbapTXA4f8Fj0BmIzolJ0eFeY0R2J7eA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108234] GCC accepts invalid program involving nontype template parameter of auto with non constexpr variable Date: Wed, 28 Dec 2022 19:35:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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_status resolution Message-ID: In-Reply-To: References: 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 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #2 from Andrew Pinski --- https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0127r2.html Looks like clang does not implement this paper correctly for reference types ... Modified testcase from that paper using reference types, C++17 should reject this while c++14 will accept it: template struct A; template int foo(A *) =3D delete; void foo(void *); constexpr int t =3D 1; void bar(A *p) { foo(p); // ill-formed; previously well-formed }=