summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/std/format/format_string.cc
blob: 1dd6ca8f12581b15715524e4f0b95d3432b2d97e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// { dg-options "-std=gnu++20" }
// { dg-do compile { target c++20 } }

#include <format>

struct Str
{
  consteval operator std::string_view() const { return ""; }
  operator std::string_view() = delete;
};

// PR libstdc++/108024
static_assert( std::is_constructible_v<std::format_string<>, const Str&> );
static_assert( std::is_convertible_v<const Str&, std::format_string<>> );

constinit std::format_string<> s = Str();