From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A9423858425; Wed, 8 Mar 2023 13:17:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A9423858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678281441; bh=UD/NhgdKd/1L9uUwLWccyhtCPIr13sgDHpjYJ2Nl7Tg=; h=From:To:Subject:Date:From; b=ixrvBqrzR0jZmZTmlb7P6cb0mzsT2/IQuo0elZQ64KKpFwpF8oAuFmHJCZC82fnku b8N0Gdjyz+GN8HA0V4uQIzzrqc2hIsUJL3jmHenvYoiXzOWQN9/Vmt7F5nDIt6l8Pd gRT28sQaUKDCKv7zbphEf15ycacwcE8HCNvyCCGw= From: "marcel.jacobse at ewetel dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109065] New: [11/12/13 Regression] Type alias combination erroneously fails with "incomplete type" Date: Wed, 08 Mar 2023 13:17:20 +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: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marcel.jacobse at ewetel dot net 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 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109065 Bug ID: 109065 Summary: [11/12/13 Regression] Type alias combination erroneously fails with "incomplete type" Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marcel.jacobse at ewetel dot net Target Milestone: --- Starting with gcc 11.1, the code template using DataAlias =3D int; template struct MyUniquePtr {}; template struct Test { using Data =3D DataAlias; MyUniquePtr d; }; Test test; fails to compile with : In instantiation of 'struct Test': :8:11: required from here :6:25: error: 'Test::d' has incomplete type 6 | MyUniquePtr d; | ^ :2:27: note: declaration of 'struct MyUniquePtr' 2 | template struct MyUniquePtr {}; | ^~~~~~~~~~~ See for example: https://godbolt.org/z/oq9TjqKrW I believe this to be valid C++11 through C++20 and it seems to compile just fine with clang, MSVC and any gcc <=3D 10.4 that supports C++11. A range of minor changes make it compile again, for example: * Make DataAlias actually use T in any way, e.g. https://godbolt.org/z/cb9dW1E6s * Don't use an array type for d, i.e. https://godbolt.org/z/MGKPcjEz3 * Don't use the second alias level for d, i.e. https://godbolt.org/z/KaWq9P= fq8=