aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp.C
blob: b753d7dcc099d51255807a969ac19d631651cd7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate basic support.
// { dg-do compile { target c++20 } }

struct literal_class {
  constexpr literal_class(...) { }
  // auto operator<=> (const fixed_string&) = default;
};

template <literal_class>
constexpr int operator ""_udl() {
  return 1;
}

static_assert("test"_udl == 1);