From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 945EF3858CD1; Thu, 28 Dec 2023 18:44:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 945EF3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703789096; bh=ZU+T1biWkbyLU4bLhjdgYZ7R7cLR8ztEHr9ZiuoZnMU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x+ilXameTA2c14n5EsfsO0tImxNFSH1xNhWOAjYX1WtkFSVxlt7mU00gsxFDov3nP JildZifV2KNP8+4vLXWzbYY+LBDAKWMKHAAsXLeJYe3tWV2tHqhL2zLaEv8kK7VLnK lqT1ze9bAYA0samsYWO9GCoMkL8vsyqYM/gOS6Fw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113160] Const valarray (g)slice and indirect_array fail to match valarray in template functions Date: Thu, 28 Dec 2023 18:44:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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: 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=3D113160 --- Comment #3 from Jonathan Wakely --- > Any function returning a valarray is permitted to return an object > of another type, provided all the const member functions of valarray > are also applicable to this type.=20 This means you can do v[0] on the type, it doesn't mean you can convert it = to a const valarray&=