1 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
3 consteval
int Fun() { return; } // expected-error {{non-void consteval function 'Fun' should return a value}}
5 template <typename T
> consteval
int FunT1() { return; } // expected-error {{non-void consteval function 'FunT1' should return a value}}
6 template <typename T
> consteval
int FunT2() { return 0; }
7 template <> consteval
int FunT2
<double>() { return 0; }
8 template <> consteval
int FunT2
<int>() { return; } // expected-error {{non-void consteval function 'FunT2<int>' should return a value}}
12 constexpr E
operator+(E
,E
) { return; } // expected-error {{non-void constexpr function 'operator+' should return a value}}
13 consteval E
operator-(E
,E
) { return; } // expected-error {{non-void consteval function 'operator-' should return a value}}
14 template <typename T
> constexpr E
operator+(E
,E
) { return; } // expected-error {{non-void constexpr function 'operator+' should return a value}}
15 template <typename T
> consteval E
operator-(E
,E
) { return; } // expected-error {{non-void consteval function 'operator-' should return a value}}
17 template <typename T
> constexpr E
operator*(E
,E
);
18 template <typename T
> consteval E
operator/(E
,E
);
19 template <> constexpr E
operator*<int>(E
,E
) { return; } // expected-error {{non-void constexpr function 'operator*<int>' should return a value}}
20 template <> consteval E
operator/<int>(E
,E
) { return; } // expected-error {{non-void consteval function 'operator/<int>' should return a value}}
22 consteval
void no_return() {}
23 consteval
void with_return() { return; }
24 consteval
void with_return_void() { return void(); }