From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 583093943545; Thu, 12 Mar 2020 23:02:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 583093943545 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584054120; bh=mWndlbG2UJZ6U/1iz3KjA08xxwiTm83KaYSKdKsTqGE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pK1PAKuiBCsE2/h7leemzDRCqcIdpwBvaAKvyhXDci9129jF1cG41v1N/RNPpA8E0 sIul+01RX2H0U6FGzukAORIcnj9jXO8tW+uE/GQwETTr4lNjhiN4u6i3cKsyQGcMsV 3zk51oz6GYEA6HGeYyphif0VS6DqCjlWTAnqLSc4= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/92010] [8/9/10 Regression] gcc internal error since 8x on warning write-strings Date: Thu, 12 Mar 2020 23:02:00 +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: 9.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 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: Thu, 12 Mar 2020 23:02:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D92010 --- Comment #6 from Patrick Palka --- (In reply to Patrick Palka from comment #5) > The ICE seems to be revealing a latent issue: In the following example > (which GCC accepts), according to the static_assert labelled (1), the type > of t is const int*, but according to the static_assert labelled (2), the > type of t is int *const. >=20 >=20 >=20 > template > void foo(const T t) > { > static_assert(__is_same(decltype(t), const int*)); // (1) > } >=20 > static_assert(__is_same(decltype(foo), void(int *))); // (2) >=20 > int > main() > { > foo(nullptr); > } So the question becomes, what should the type of t be here? According to https://eel.is/c++draft/temp#deduct-3: "A top-level qualifier in a function parameter declaration does not affect = the function type but still affects the type of the function parameter variable within the function." The above suggests that the type of foo should be the same regardles= s of where the parameter t is const-qualified. Going by this then, it appears t= hat the static_assert (2) is right and (1) is wrong. Can anyone confirm? (On the other hand, Clang thinks (1) is right and (2) is wrong.)=