1 // RUN: %clang_cc1 -std=c++23 -verify %s
5 if consteval
{ return 0; }
6 if !consteval
{ return 0.0; } // expected-error {{'auto' in return type deduced as 'double' here but deduced as 'int' in earlier return statement}}
10 if !consteval
{ return 0; }
11 if consteval
{ return 0.0; } // expected-error {{'auto' in return type deduced as 'double' here but deduced as 'int' in earlier return statement}}
15 if consteval
{ return 0; }
16 if !consteval
{ return 0; } // okay
21 if consteval
{ // expected-warning {{consteval if is always true in an immediate context}}
26 return 1.0; // expected-error {{'auto' in return type deduced as 'double' here but deduced as 'int' in earlier return statement}}
32 constexpr auto y1
= f();
35 constexpr auto y2
= g();
38 constexpr auto y3
= h();
41 constexpr auto y4
= i();
43 } // namespace PR52206
45 consteval
int *make() { return new int; }
47 if constexpr (false) {
49 // Immediate function context, so call to `make()` is valid.
50 // Discarded statement context, so `return 0;` is valid too.