File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,18 @@ template <ct_string S> CONSTEVAL auto operator""_cts() { return S; }
124
124
} // namespace ct_string_literals
125
125
} // namespace literals
126
126
127
+ struct ct_check_value {};
128
+
127
129
template <bool B> struct ct_check_t {
128
130
template <ct_string S> constexpr static bool diagnostic = false ;
129
131
template <ct_string S>
130
- constexpr static auto emit () -> void
132
+ constexpr static auto emit () -> ct_check_value
131
133
requires diagnostic<S>;
132
134
};
133
135
template <> struct ct_check_t <true > {
134
- template <ct_string S> constexpr static auto emit () -> void {}
136
+ template <ct_string S> constexpr static auto emit () -> ct_check_value {
137
+ return {};
138
+ }
135
139
};
136
140
template <bool B> constexpr auto ct_check = ct_check_t <B>{};
137
141
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ constexpr auto msg =
6
6
stdx::ct_string{" 01234567890123456789012345678901234567890123456789" };
7
7
8
8
auto main () -> int {
9
- stdx::ct_check<true >.emit <" not emitted" >();
9
+ [[maybe_unused]] auto x = stdx::ct_check<true >.emit <" not emitted" >();
10
10
stdx::ct_check<false >.emit <msg>();
11
11
}
You can’t perform that action at this time.
0 commit comments