From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AAFF53858D3C; Sun, 4 Feb 2024 09:38:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AAFF53858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707039489; bh=krEAMua/bZBTSOZbXMAoP3ozggfoh8cYMkqboRxqq9M=; h=From:To:Subject:Date:From; b=uAQfNcEQAi+YpmOwyuYD7+EwoJoXon3SiX+M51MsuneMTCY1CsPdasFT3RNVn9RR1 xRZOITh1E9XRLeRLIspxB/d4MEJNsNMSXkHhu8X6p08fbrq6sfkXAKZwBjpvGASJEc d6sWKIFdltSbsMuCQwa2yKD0GCQasUkaNsRYMd9I= From: "milasudril at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113754] New: GCC complains when using a type that depends on lambda Date: Sun, 04 Feb 2024 09:38:08 +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: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: milasudril 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 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=3D113754 Bug ID: 113754 Summary: GCC complains when using a type that depends on lambda Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: milasudril at gmail dot com Target Milestone: --- I tried to use=20 template using unique_ptr_deleter =3D std::unique_ptr; As described by https://andreasfertig.blog/2022/08/cpp-insights-lambdas-in-unevaluated-cont= exts/ It works well as long as I do not try define it in a header file. If gcc detects a from a header file that uses unique_ptr_deleter, I get the warnin= g=20 lib/array_classes/./memory_block.hpp:12:8: error: 'memory_block' has a field 'unique_ptr_deleter terraformer::memory_block::m_pointer' whose type has internal linkage [-Werror=3Dsubobject-linkage] Clang do generate any warnings. Stand-alone snippet to reproduce the issue: #include #include # 7 "lib/array_classes/./memory_block.hpp" template using unique_ptr_deleter =3D std::unique_ptr; class memory_block { public: private: unique_ptr_deleter m_pointer; }; # 4 "lib/array_classes/memory_block.test.cpp"=