Debian Codegraph @

gcc/testsuite/g++.dg/torture/pr86816.C

raw
1 // { dg-do compile }
2
3 class Signal
4 {
5 public:
6 int m_Mode;
7 };
8
9 class Ctx
10 {
11 public:
12 bool m_Invert;
13
14 void DoSomething();
15 };
16
17 class Test
18 {
19 void TestIce( Ctx& ctx, Signal* sig);
20 };
21
22 void Test::TestIce( Ctx& ctx, Signal* sig)
23 {
24 int invert = false;
25
26 if( ! ctx.m_Invert)
27 invert = ! invert;
28
29 switch( sig->m_Mode)
30 {
31 case 1:
32 invert = ! invert;
33 break;
34
35 case 2:
36 invert = true;
37 break;
38 }
39
40 if( invert)
41 ctx.DoSomething();
42 }