public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98770] New: [modules] including certain stdlib headers in the global module fragment of different modules causes conflicting global module declarations
@ 2021-01-20 14:36 pilarlatiesa at gmail dot com
  2021-01-28 12:57 ` [Bug c++/98770] " cvs-commit at gcc dot gnu.org
  2021-01-28 12:58 ` nathan at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pilarlatiesa at gmail dot com @ 2021-01-20 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98770
           Summary: [modules] including certain stdlib headers in the
                    global module fragment of different modules causes
                    conflicting global module declarations
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pilarlatiesa at gmail dot com
  Target Milestone: ---

$ /home/pililatiesa/GCC-11/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/pililatiesa/GCC-11/bin/g++
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-master/configure --prefix=($HOME)/GCC-11
--enable-languages=c++ --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20210115 (experimental) (GCC)

$ cat Tensor.ixx

module;

#include <cstddef>
#include <iostream>

export module VF.Tensor;

namespace VF
{
export
template<std::size_t d, std::size_t r1>
struct TTensor
{
private:
  std::istream
  inline &Read(std::istream &is)
    { return is; }
};

export
template<std::size_t d>
using TVector = TTensor<d, 1u>;
} // VF


$ cat Mesh.ixx

module;

#include <cstddef>
#include <type_traits>

export module VF.Mesh;

import VF.Tensor;

namespace VF
{
template <std::size_t d>
class TPoint final : public TVector<d> {};
}


$ /home/pililatiesa/GCC-11/bin/g++ -fmodules-ts -x c++ -std=c++20 -I../ -I./
Tensor.ixx Mesh.ixx -o foo
In file included from
/home/pililatiesa/GCC-11/include/c++/11.0.0/bits/move.h:57,
                 from
/home/pililatiesa/GCC-11/include/c++/11.0.0/bits/nested_exception.h:40,
                 from
/home/pililatiesa/GCC-11/include/c++/11.0.0/exception:148,
                 from /home/pililatiesa/GCC-11/include/c++/11.0.0/ios:39,
                 from /home/pililatiesa/GCC-11/include/c++/11.0.0/ostream:38,
                 from /home/pililatiesa/GCC-11/include/c++/11.0.0/iostream:39,
                 from Tensor.ixx:5,
of module VF.Tensor, imported at Mesh.ixx:9:
/home/pililatiesa/GCC-11/include/c++/11.0.0/type_traits:634:31: error:
conflicting global module declaration ‘template<class ...> using __void_t =
void’
  634 |   template<typename...> using __void_t = void;
      |                               ^~~~~~~~
In file included from Mesh.ixx:5:
/home/pililatiesa/GCC-11/include/c++/11.0.0/type_traits:634:31: note: existing
declaration ‘template<class ...> using __void_t = void’
  634 |   template<typename...> using __void_t = void;
      |                               ^~~~~~~~
Mesh.ixx:14:29: note: during load of binding ‘VF::TVector@VF.Tensor’
   14 | class TPoint final : public TVector<d> {};
      |                             ^~~~~~~
Mesh.ixx:7:8: warning: not writing module ‘VF.Mesh’ due to errors
    7 | export module VF.Mesh;
      |

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

end of thread, other threads:[~2021-01-28 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 14:36 [Bug c++/98770] New: [modules] including certain stdlib headers in the global module fragment of different modules causes conflicting global module declarations pilarlatiesa at gmail dot com
2021-01-28 12:57 ` [Bug c++/98770] " cvs-commit at gcc dot gnu.org
2021-01-28 12:58 ` nathan 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).