ut icon indicating copy to clipboard operation
ut copied to clipboard

declaration of 'something' with internal linkage cannot be exported

Open TheRustifyer opened this issue 2 years ago • 1 comments

Expected Behavior

ut being precompiled as a module

Actual Behavior

header isn't being precompiled as a prebuilt module unit

./zero/tests/deps/ut.hpp:379:23: error: declaration of 'is_container_v' with internal linkage cannot be exported
static constexpr auto is_container_v =
                      ^
./zero/tests/deps/ut.hpp:383:23: error: declaration of 'has_user_print' with internal linkage cannot be exported
static constexpr auto has_user_print = is_valid<T>(
                      ^
./zero/tests/deps/ut.hpp:423:23: error: declaration of 'is_convertible_v' with internal linkage cannot be exported
static constexpr auto is_convertible_v = __is_convertible_to(From, To);
                      ^
./zero/tests/deps/ut.hpp:383:23: error: declaration of 'has_user_print<char>' with internal linkage cannot be exported
static constexpr auto has_user_print = is_valid<T>(
                      ^
./zero/tests/deps/ut.hpp:379:23: error: declaration of 'is_container_v<char>' with internal linkage cannot be exported
static constexpr auto is_container_v =
                      ^
./zero/tests/deps/ut.hpp:383:23: error: declaration of 'has_user_print<const char *>' with internal linkage cannot be exported
static constexpr auto has_user_print = is_valid<T>(
                      ^
./zero/tests/deps/ut.hpp:379:23: error: declaration of 'is_container_v<const char *>' with internal linkage cannot be exported
static constexpr auto is_container_v =
                      ^
./zero/tests/deps/ut.hpp:379:23: error: declaration of 'is_container_v<std::__wrap_iter<const std::string_view *> &>' with internal linkage cannot be exported

Steps to Reproduce the Problem

  1. clang++ -stdlib=libc++ -std=c++20 -D__cpp_modules -fmodules --precompile -x c++-module ./zero/tests/deps/ut.hpp -o ./zero/tests/deps/ut.pcm

Specifications

  • Version: 1.1.9
  • Platform: Linux
  • Subsystem: Arch/Manjaro
  • Compiler version: Clang 15.0.2 - gnu-linux

EDIT

Also, using new bash profiles on wandbox produces another kind of errors. Permalink on the doc it's ok, but newer versions contains clang incompatiblities with ut

https://wandbox.org/permlink/NZyBkZddbKTEktGV

TheRustifyer avatar Oct 16 '22 22:10 TheRustifyer

#568 should fix most of these issues, expect for the static_asserts.

mordante avatar Jun 14 '23 16:06 mordante