ned14 / status-code

Proposed SG14 status_code for the C++ standard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libc++ seems to have removed is_literal_type in C++20 mode on MacOSX

BurningEnlightenment opened this issue · comments

The main.cpp test compilation fails with homebrew llvm 15 due to the fact that std::is_literal_type can't be resolved:

  /usr/local/opt/llvm@15/bin/clang++  -I/Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/include -fsized-deallocation -O3 -DNDEBUG -std=gnu++20 -arch x86_64 -isysroot /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -MD -MT CMakeFiles/test-status-code-noexcept.dir/test/main.cpp.o -MF CMakeFiles/test-status-code-noexcept.dir/test/main.cpp.o.d -o CMakeFiles/test-status-code-noexcept.dir/test/main.cpp.o -c /Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/test/main.cpp
  Error: /Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/test/main.cpp:62:33: error: no template named 'is_literal_type' in namespace 'std'; did you mean '::is_literal_type'?
    static constexpr bool value = std::is_literal_type<T>::value;
                                  ^~~~~~~~~~~~~~~~~~~~
                                  ::is_literal_type
  /Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/test/main.cpp:60:27: note: '::is_literal_type' declared here
  template <class T> struct is_literal_type
                            ^
  Error: /Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/test/main.cpp:62:25: error: constexpr variable 'value' must be initialized by a constant expression
    static constexpr bool value = std::is_literal_type<T>::value;
                          ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/test/main.cpp:429:46: note: in instantiation of static data member 'is_literal_type<system_error2::status_code<Code_domain_impl>>::value' requested here
    static_assert(is_literal_type<StatusCode>::value, "StatusCode is not a literal type!");
                                               ^
  /Users/runner/work/concrete/concrete/build/vcpkg/buildtrees/status-code/src/b744096220-dab9a059c2.clean/test/main.cpp:62:33: note: read of object outside its lifetime is not allowed in a constant expression
    static constexpr bool value = std::is_literal_type<T>::value;
                                  ^

https://github.com/deeplex/concrete/actions/runs/6949733915/job/18908449178#step:5:81

There is some work around code at https://github.com/ned14/status-code/blob/master/test/main.cpp#L57, I assume it just needs updating for latest Mac OS.