aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/consteval-if4.C
blob: 2760c1c2d9732ab921c18d0b96b6be187878b582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// { dg-do compile { target c++20 } }
// { dg-options "-w" }

void f()
{
  goto l;			// { dg-message "from here" }
  if consteval			// { dg-message "enters 'consteval if'" }
    {
    l:;				// { dg-error "jump to label" }
    }
}

void g()
{
  goto l;			// { dg-message "from here" }
  if not consteval		// { dg-message "enters 'consteval if'" }
    {
    l:;				// { dg-error "jump to label" }
    }
}

void h()
{
  goto l;			// { dg-message "from here" }
  if consteval			// { dg-message "enters 'consteval if'" }
    {
    }
  else
    {
    l:;				// { dg-error "jump to label" }
    }
}

void i()
{
  goto l;			// { dg-message "from here" }
  if not consteval		// { dg-message "enters 'consteval if'" }
    {
    }
  else
    {
    l:;				// { dg-error "jump to label" }
    }
}