Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C

raw
1 // PR c++/88095
2 // Test class non-type template parameters for literal operator templates.
3 // Validate that non-literal class types are rejected.
4 // { dg-do compile { target c++20 } }
5
6 struct non_literal_class {
7 constexpr non_literal_class(...) { }
8 ~non_literal_class() {}
9 // auto operator<=> (const non_literal_fixed_string&) = default;
10 };
11
12 template <non_literal_class> // { dg-error "11:is not a valid type for a template non-type parameter because it is not structural" "" { target { ! implicit_constexpr } } }
13 int operator ""_udl(); // { dg-error "5:literal operator template .int operator\"\"_udl\\(\\). has invalid parameter list" "" { target { ! implicit_constexpr } } }