From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7578F3858D38; Wed, 12 Aug 2020 16:15:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7578F3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597248958; bh=GcJTo4kVDjroqdaT9mKd5hDRUaZ/sVarTdFilTGNqSc=; h=From:To:Subject:Date:From; b=iY9//qxOxtbjgHaxTnOb3hniwo8sI1377gJ5RKzAPzu7nQWH9SK6nvkhyZzqGTBoE Xz0kAq11Yyn1zmfib+QUgkTog1VlFjLBdlHp6o1g5FhO/1GbAWnvnNtfZ2VQGXav2/ /ot/YjEIUEazekSkO3J94p6UFFlg36/F45dcWojQ= From: "cuzdav at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96592] New: Tuple element w/ member reference to incomplete template type rejected Date: Wed, 12 Aug 2020 16:15:58 +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.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cuzdav 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 target_milestone attachments.created 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: Wed, 12 Aug 2020 16:15:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96592 Bug ID: 96592 Summary: Tuple element w/ member reference to incomplete template type rejected Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: cuzdav at gmail dot com Target Milestone: --- Created attachment 49049 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49049&action=3Dedit source as shown in preview, g++10.2 preprocessed code, and the error messag= es This code seems a regression introduced in g++ 10.1, is still in 10.2 and remains in the trunk. It works on 9.x and as far back as g++ 6, plus all versions of clang since 6, icc, msvc, etc. There are many independent changes that can make it work, including:=20 * making SomeQuery constructor a template constructor (on SessionU) * changing the reference to a pointer * explicitly declaring Session as an incomplete type and not using templates #include template struct SomeQuery { SessionT& session_; SomeQuery(SessionT& session) : session_(session) {} }; template struct Handler { std::tuple> queries_; Handler(SessionT& session) : queries_(session) {} }; struct Session { Handler handler_; Session() : handler_{*this} {} }; int main() { Session session; } It looks like the tuple class is doing some concept checking that isn't qui= te working, but I haven't dug deeply enough to determine if it's a library or underlying compiler issue. Live example on Compiler Explorer https://godbolt.org/z/7naPMx=