From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 951B53861019; Mon, 17 Aug 2020 14:21:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 951B53861019 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597674116; bh=KdiGh79OlltIFrqvzHgujakNTS0MrTvhr4nLxyTSi7Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=K5Eg8EFW1YZLYPYzyhqeNI/SdhxdirgekYge0g5FufDIJAlRUZvSyRhXbSD7Uwa8K MD/tab6ryhLXyif5Q7sJZd5YVITP/GFQBNqTgmPjn8uIfIa9kxM98mO2oYBAsG/Zrv /ttaMNjj/O463UQ+LHPrli3hpl36XL++YMjw/v9Y= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96645] [9/10/11 Regression] std::variant default constructor Date: Mon, 17 Aug 2020 14:21:56 +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.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed short_desc cf_reconfirmed_on bug_status cf_known_to_fail component cf_known_to_work cc keywords 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: Mon, 17 Aug 2020 14:21:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96645 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Summary|std::variant default |[9/10/11 Regression] |constructor |std::variant default | |constructor Last reconfirmed| |2020-08-17 Status|UNCONFIRMED |NEW Known to fail| |10.2.0, 11.0, 9.3.0 Component|libstdc++ |c++ Known to work| |8.4.0 CC| |jason at gcc dot gnu.org Keywords| |rejects-valid --- Comment #1 from Jonathan Wakely --- This is not a bug in std::variant: template struct bool_constant { static constexpr bool value =3D B; using type =3D bool_constant; }; using true_type =3D bool_constant; template struct is_default_constructible : bool_constant<__is_constructible(T)> { }; void testVarStruct() { struct DataWithStruct { struct A { int number =3D 5; // compiles, if remove initialization }; is_default_constructible::type t =3D true_type{}; }; } v.C: In function 'void testVarStruct()': v.C:22:47: error: could not convert 'true_type{}' from 'bool_constant= ' to 'bool_constant' 22 | is_default_constructible::type t =3D true_type{}; | ^~~~~~~~~~~ | | | bool_constant This stopped working with r269032 which changed the result of the __is_constructible built-in. Clang also rejects this, for the same reason, but EDG accepts it.=