mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-02 23:21:45 +01:00
CI linux: add clang++-11 C++20 (with LLVM libc++) build
* find-package-test fixed by passing CXX_FLAGS, i.e. -stdlib=libc++ * std::array usage in compile-test.cc replaced with plain array, because <array> header was not included
This commit is contained in:
committed by
Victor Zverovich
parent
1dbadb6527
commit
b441532396
@@ -203,6 +203,7 @@ if (FMT_PEDANTIC AND NOT WIN32)
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-options
|
||||
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
|
||||
"-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
|
||||
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
|
||||
"-DFMT_DIR=${PROJECT_BINARY_DIR}"
|
||||
"-DPEDANTIC_COMPILE_FLAGS=${PEDANTIC_COMPILE_FLAGS}"
|
||||
|
||||
@@ -323,15 +323,15 @@ TEST(CompileTest, CompileFormatStringLiteral) {
|
||||
(__cplusplus >= 201709L && FMT_GCC_VERSION >= 1002)
|
||||
template <size_t max_string_length, typename Char = char> struct test_string {
|
||||
template <typename T> constexpr bool operator==(const T& rhs) const noexcept {
|
||||
return fmt::basic_string_view<Char>(rhs).compare(buffer.data()) == 0;
|
||||
return fmt::basic_string_view<Char>(rhs).compare(buffer) == 0;
|
||||
}
|
||||
std::array<Char, max_string_length> buffer{};
|
||||
Char buffer[max_string_length]{};
|
||||
};
|
||||
|
||||
template <size_t max_string_length, typename Char = char, typename... Args>
|
||||
consteval auto test_format(auto format, const Args&... args) {
|
||||
test_string<max_string_length, Char> string{};
|
||||
fmt::format_to(string.buffer.data(), format, args...);
|
||||
fmt::format_to(string.buffer, format, args...);
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user