public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99000] New: [modules] declaration std::__copy_move_a2 conflicts with import
@ 2021-02-08 11:08 boris at kolpackov dot net
  2021-02-08 20:24 ` [Bug c++/99000] " nathan at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: boris at kolpackov dot net @ 2021-02-08 11:08 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/99000] [modules] declaration std::__copy_move_a2 conflicts with import
  2021-02-08 11:08 [Bug c++/99000] New: [modules] declaration std::__copy_move_a2 conflicts with import boris at kolpackov dot net
@ 2021-02-08 20:24 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-08 20:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99000

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2021-02-08
     Ever confirmed|0                           |1

--- Comment #1 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
You're hitting this:


@emph{G++'s modules support is not complete.}  Other than bugs, the
known missing pieces are:

....

@item Textual merging of reachable GM entities
Entities may be multiply defined across different header-units.
These must be de-duplicated, and this is implemented across imports,
or when an import redefines a textually-defined entity.  However the
reverse is not implemented---textually redefining an entity that has
been defined in an imported header-unit.  A redefinition error is
emitted.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/99000] [modules] declaration std::__copy_move_a2 conflicts with import
  2021-02-08 11:08 [Bug c++/99000] New: [modules] declaration std::__copy_move_a2 conflicts with import boris at kolpackov dot net
  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
  2 siblings, 0 replies; 4+ messages in thread
From: boris at kolpackov dot net @ 2021-02-09 14:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99000

--- Comment #2 from Boris Kolpackov <boris at kolpackov dot net> ---
Thanks for pointing this out. Am I correct in interpreting the SUSPENDED status
as unlikely to be fixed for GCC 11?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/99000] [modules] declaration std::__copy_move_a2 conflicts with import
  2021-02-08 11:08 [Bug c++/99000] New: [modules] declaration std::__copy_move_a2 conflicts with import boris at kolpackov dot net
  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
  2 siblings, 0 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-13 17:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99000

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 110447 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-13 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 11:08 [Bug c++/99000] New: [modules] declaration std::__copy_move_a2 conflicts with import boris at kolpackov dot net
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

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).