From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9CDCC3893648; Mon, 8 Feb 2021 11:08:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CDCC3893648 From: "boris at kolpackov dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99000] New: [modules] declaration std::__copy_move_a2 conflicts with import Date: Mon, 08 Feb 2021 11:08:52 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: boris at kolpackov 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 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: Mon, 08 Feb 2021 11:08:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99000 Bug ID: 99000 Summary: [modules] declaration std::__copy_move_a2 conflicts with import Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris at kolpackov dot net Target Milestone: --- The following header unit import causes the "declaration conflicts with imp= ort" error: cat <hello.hxx #pragma once #include namespace hello { void say_hello (const std::string_view& name); } EOF cat <hello.cxx import "hello.hxx"; #include namespace hello { void say_hello (const std::string_view& n) { std::cout << "Hello, " << n << '!' << std::endl; } } EOF g++ -std=3Dc++2a -fmodules-ts -fmodule-header -x c++-header hello.hxx g++ -std=3Dc++2a -fmodules-ts x c++ -c hello.cxx In file included from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/b= its/locale_facets.h:48, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/b= its/basic_ios.h:37, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/i= os:44, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/o= stream:38, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/i= ostream:39, from hello.cxx:3: /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/b= its/streambuf_iterator.h:367:72: error: declaration =E2=80=98template typename __gnu_cxx::__enable_if::__value, _CharT*>::__type std::__copy_move_a2(std::istreambuf_iterator<_CharT, std::char_traits<_Char= T> >, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >, _CharT*)=E2= =80=99 conflicts with import 367 | istreambuf_iterator<_CharT> __last, _CharT* __result) |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ^ In file included from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/b= its/char_traits.h:39, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/s= tring_view:41, from hello.hxx:3, of module ./hello.hxx, imported at hello.cxx:1: /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/b= its/stl_algobase.h:471:5: note: import declared =E2=80=98template typename __gnu_cxx::__enable_if::__value, _CharT*>::__type std::__copy_move_a2(std::istreambuf_iterator<_CharT, std::char_traits<_Char= T> >, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >, _CharT*)=E2= =80=99 here 471 | __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> = >, | ^~~~~~~~~~~~~~ Interestingly, if we change the #include and import order in hello.cxx, then the error goes away.=