public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "boris at kolpackov dot net" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-99000-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99000 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 import" error: cat <<EOF >hello.hxx #pragma once #include <string_view> namespace hello { void say_hello (const std::string_view& name); } EOF cat <<EOF >hello.cxx import "hello.hxx"; #include <iostream> namespace hello { void say_hello (const std::string_view& n) { std::cout << "Hello, " << n << '!' << std::endl; } } EOF g++ -std=c++2a -fmodules-ts -fmodule-header -x c++-header hello.hxx g++ -std=c++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/bits/locale_facets.h:48, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/bits/basic_ios.h:37, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/ios:44, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/ostream:38, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/iostream:39, from hello.cxx:3: /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/bits/streambuf_iterator.h:367:72: error: declaration ‘template<bool _IsMove, class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_CharT>::__value, _CharT*>::__type std::__copy_move_a2(std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >, _CharT*)’ conflicts with import 367 | istreambuf_iterator<_CharT> __last, _CharT* __result) | ^ In file included from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/bits/char_traits.h:39, from /home/boris/work/build2/tests/modules/gcc2/gcc-install/include/c++/11.0.0/string_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/bits/stl_algobase.h:471:5: note: import declared ‘template<bool _IsMove, class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_CharT>::__value, _CharT*>::__type std::__copy_move_a2(std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >, _CharT*)’ 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.
next reply other threads:[~2021-02-08 11:08 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-08 11:08 boris at kolpackov dot net [this message] 2021-02-08 20:24 ` [Bug c++/99000] " nathan at gcc dot gnu.org 2021-02-09 14:27 ` boris at kolpackov dot net 2024-03-13 17:53 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-99000-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).