From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB9B83858D33; Sat, 13 Feb 2021 06:12:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB9B83858D33 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96926] [9/10/11 Regression] Tuple element w/ member reference to incomplete template type rejected Date: Sat, 13 Feb 2021 06:12:40 +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: 10.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 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: Sat, 13 Feb 2021 06:12:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96926 --- Comment #6 from Jason Merrill --- So, for the second example, the compiler's process is test() initializes the tuple member looks for tuple(Test) ctor considers tuple(tuple&&) looks for conversion from Test to tuple considers _ImplicitCtor instantiates __is_implicitly_constructible instantiates is_constructible, const DependsOnT&> considers DependsOnT(Test&) tries to convert to Test lazily declares Test copy ctor looks for tuple(tuple) ctor considers _ExplicitCtor instantiates __is_explicitly_constructible instantiates is_constructible, const DependsOnT&> fails So, another problem with trying unsuitable candidates when declaring a copy constructor. I wonder what rule other compilers are using to break this recursive dependency. I'm going to try something that zygoloid suggested G= CC already did: if we see a non-template perfect match, don't consider any templates.=