[Bug c++/115720] New: module symbol collision
unlvsur at live dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 1 00:25:19 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115720
Bug ID: 115720
Summary: module symbol collision
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: unlvsur at live dot com
Target Milestone: ---
//mymodule.cppm
module;
#include<cstdint>
#include<type_traits>
export module mymodule;
export namespace test
{
enum class dll_mode: ::std::uint_least32_t
{};
inline constexpr dll_mode operator&=(dll_mode x, dll_mode y) noexcept
{
using utype = typename ::std::underlying_type<dll_mode>::type;
return static_cast<dll_mode>(static_cast<utype>(x) &
static_cast<utype>(y));
}
}
//main.cc
import mymodule;
#include<type_traits>
int main(){}
g++ -c mymodule.cppm -Ofast -std=c++26 -fmodules-ts
g++ -o main main.cc mymodule.o -Ofast -std=c++26 -fmodules-ts
In file included from main.cc:2:
D:/toolchains/gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/15.0.0/type_traits:2511:42:
error: default argument for template parameter for class enclosing 'using
std::__underlying_type_impl<_Tp, <anonymous> >::type = __underlying_type(_Tp)'
2511 | using type = __underlying_type(_Tp);
| ^
D:/toolchains/gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/15.0.0/type_traits:2511:42:
error: template definition of non-template 'using
std::__underlying_type_impl<_Tp, <anonymous> >::type = __underlying_type(_Tp)'
D:/toolchains/gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/15.0.0/type_traits:2515:12:
error: redefinition of
struct std::__underlying_type_impl<_Tp, false>'
2515 | struct __underlying_type_impl<_Tp, false>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mymodule.cppm:3,
of module mymodule, imported at main.cc:1:
D:/toolchains/gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/15.0.0/type_traits:2515:12:
note: previous definition of 'struct std::__underlying_type_impl<_Tp, false>'
2515 | struct __underlying_type_impl<_Tp, false>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/toolchains/gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/15.0.0/type_traits:2522:40:
error: wrong number of template arguments (1, should be 2)
2522 | : public __underlying_type_impl<_Tp>
| ^
D:/toolchains/gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/15.0.0/type_traits:2509:12:
note: provided for 'template<class _Tp, bool <anonymous> > struct
std::__underlying_type_impl'
2509 | struct __underlying_type_impl
| ^~~~~~~~~~~~~~~~~~~~~~
More information about the Gcc-bugs
mailing list