https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101224
Bug ID: 101224 Summary: Problem with interaction of modules and std::unique_ptr Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: p.cross13 at yahoo dot com Target Milestone: --- Created attachment 51063 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51063&action=edit main program file with two module files included in comments, plus compiler output and compiler version in comments Code that compiles without modules, and uses std::unique_ptr, has a problem when parts of the code are moved to modules $ /d/gcc11/bin/g++ -std=c++20 -fmodules-ts FmtMain.cpp In file included from d:\gcc11\include\c++\11.1.0\memory:76, from FmtMain.cpp:1: d:\gcc11\include\c++\11.1.0\bits\unique_ptr.h: In instantiation of 'void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Fmt1@Fmt1]': d:\gcc11\include\c++\11.1.0\bits\unique_ptr.h:361:17: required from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Fmt1@Fmt1; _Dp = std::default_delete<Fmt1@Fmt1>]' FmtMain.cpp:24:24: required from here d:\gcc11\include\c++\11.1.0\bits\unique_ptr.h:85:9: error: array subscript is not an integer 85 | delete __ptr; | ^~~~~~~~~~~~