32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
+
-
+
-
+
|
const auto& context = p.resolver()->context();
auto converted = ConvertValueToType( context, *condVal, GetValueType< bool >() );
if( holds_alternative< ValUnifyError >( converted ) )
{
switch( get< ValUnifyError >( converted ) )
{
case ValUnifyError::NoSolution:
cout << "#if condition doesn't evaluate to a bool constant1.\n";
cout << "#if condition doesn't evaluate to a bool constant.\n";
break;
case ValUnifyError::Ambiguous:
cout << "ambiguous #if condition bool conversion.\n";
break;
}
return false;
}
auto condBool = get< Value >( converted );
if( !condBool.isConstant() )
{
cout << "#if condition doesn't evaluate to a bool constant2.";
cout << "#if condition doesn't evaluate to a bool constant.";
return false;
}
auto cond = FromValue< bool >( condBool );
if( !cond )
{
cout << "#if condition doesn't evaluate to a bool constant3.";
cout << "#if condition doesn't evaluate to a bool constant.";
return false;
}
auto next = p.resolver()->lookAheadUnresolved();
if( !next )
{
cout << "#if: brace block expected.\n";
|