From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BCDD9385DC04; Tue, 14 Apr 2020 08:59:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCDD9385DC04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586854774; bh=72+egmeUsXt3Lq/ArDxi0Rl2uPx555eE4lZ6SMHkIk4=; h=From:To:Subject:Date:From; b=jE42o0/tb2ikg+AMeK4MyVbhlDB4VbJCCf8zJOkDxMwMsnf/09dm7rDBGBUVROiA+ 8sKSQ+aMhEu/CX4wx0xAqE2F1Dm4tg7VAimx/4tSsriZw7uvaHce5y4wdUGPLDIybt JLQNablRdsXKBxsHUMjj/icS8MyQN++Zj3nEtdis= From: "dangelog at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94590] New: Incorrectly accepts invalid C++11 braced initialisation of double from long double if sizeof(long double)==sizeof(double) Date: Tue, 14 Apr 2020 08:59:34 +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: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dangelog 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 cc 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 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: Tue, 14 Apr 2020 08:59:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94590 Bug ID: 94590 Summary: Incorrectly accepts invalid C++11 braced initialisation of double from long double if sizeof(long double)=3D=3Dsizeof(double) Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dangelog at gmail dot com CC: dangelog at gmail dot com, marc at kdab dot com, unassigned at gcc dot gnu.org Target Milestone: --- +++ This bug was initially created as a clone of Bug #92856 +++ (Sorry, couldn't find a way to reopen _that_ bug, so creating a new one) Hi, When using list-initialization from a long double to double, GCC warns (and rejects the code in SFINAE contexts) only on platforms where sizeof(long double) > sizeof(double). This is OK, and documented. However: on platforms where long double is the same as double, GCC incorrec= tly accepts the code without emitting warnings, and affecting SFINAE. For instance * On ARM: https://godbolt.org/z/SRg3fr * On X86-64 also passing -mlong-double-64: https://godbolt.org/z/GnRkHC SFINAE contexts are affected as well: https://godbolt.org/z/icMA3k Clang, MSVC reject the code.=