1 // { dg-do compile }
2 // { dg-options "-std=c++2a" }
3 
bar(int i)4 consteval int bar (int i) { if (i != 1) throw 1; return 0; }	// { dg-error "is not a constant expression" }
5 
6 template <int N>
foo()7 void foo ()
8 {
9   int a = bar (N);
10 }
11 
12 template <int N>
qux()13 void qux ()
14 {
15   int a = bar (N);	// { dg-message "in 'constexpr' expansion of 'bar\\(2\\)'" }
16 }
17 
18 template <int N>
quux()19 void quux ()
20 {
21   int a = bar (5);	// { dg-message "in 'constexpr' expansion of 'bar\\(5\\)'" }
22 }
23 
24 void
baz()25 baz ()
26 {
27   foo<1> ();
28   qux<2> ();
29 }
30 
31 int a = bar (2);	// { dg-message "in 'constexpr' expansion of 'bar\\(2\\)'" }
32