Commit 7c619247 authored by Brad King's avatar Brad King
Browse files

LexerParser: Suppress -Wused-but-marked-unused warning in cmExprParser

parent 6f64300a
......@@ -113,8 +113,13 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message);
#if defined(__GNUC__) && __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wconversion"
#endif
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wused-but-marked-unused")
# pragma clang diagnostic ignored "-Wused-but-marked-unused"
# endif
#endif
#line 118 "cmExprParser.cxx"
#line 123 "cmExprParser.cxx"
# ifndef YY_CAST
# ifdef __cplusplus
......@@ -538,9 +543,9 @@ static const yytype_int8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 75, 75, 80, 83, 88, 91, 96, 99, 104,
107, 110, 115, 118, 121, 126, 129, 132, 138, 143,
146, 149, 152, 157, 160
0, 80, 80, 85, 88, 93, 96, 101, 104, 109,
112, 115, 120, 123, 126, 131, 134, 137, 143, 148,
151, 154, 157, 162, 165
};
#endif
......@@ -1415,194 +1420,194 @@ yyreduce:
switch (yyn)
{
case 2: /* start: exp */
#line 75 "cmExprParser.y"
#line 80 "cmExprParser.y"
{
cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number));
}
#line 1423 "cmExprParser.cxx"
#line 1428 "cmExprParser.cxx"
break;
case 3: /* exp: bitwiseor */
#line 80 "cmExprParser.y"
#line 85 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1431 "cmExprParser.cxx"
#line 1436 "cmExprParser.cxx"
break;
case 4: /* exp: exp exp_OR bitwiseor */
#line 83 "cmExprParser.y"
#line 88 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number);
}
#line 1439 "cmExprParser.cxx"
#line 1444 "cmExprParser.cxx"
break;
case 5: /* bitwiseor: bitwisexor */
#line 88 "cmExprParser.y"
#line 93 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1447 "cmExprParser.cxx"
#line 1452 "cmExprParser.cxx"
break;
case 6: /* bitwiseor: bitwiseor exp_XOR bitwisexor */
#line 91 "cmExprParser.y"
#line 96 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number);
}
#line 1455 "cmExprParser.cxx"
#line 1460 "cmExprParser.cxx"
break;
case 7: /* bitwisexor: bitwiseand */
#line 96 "cmExprParser.y"
#line 101 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1463 "cmExprParser.cxx"
#line 1468 "cmExprParser.cxx"
break;
case 8: /* bitwisexor: bitwisexor exp_AND bitwiseand */
#line 99 "cmExprParser.y"
#line 104 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number);
}
#line 1471 "cmExprParser.cxx"
#line 1476 "cmExprParser.cxx"
break;
case 9: /* bitwiseand: shift */
#line 104 "cmExprParser.y"
#line 109 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1479 "cmExprParser.cxx"
#line 1484 "cmExprParser.cxx"
break;
case 10: /* bitwiseand: bitwiseand exp_SHIFTLEFT shift */
#line 107 "cmExprParser.y"
#line 112 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) << (yyvsp[0].Number);
}
#line 1487 "cmExprParser.cxx"
#line 1492 "cmExprParser.cxx"
break;
case 11: /* bitwiseand: bitwiseand exp_SHIFTRIGHT shift */
#line 110 "cmExprParser.y"
#line 115 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) >> (yyvsp[0].Number);
}
#line 1495 "cmExprParser.cxx"
#line 1500 "cmExprParser.cxx"
break;
case 12: /* shift: term */
#line 115 "cmExprParser.y"
#line 120 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1503 "cmExprParser.cxx"
#line 1508 "cmExprParser.cxx"
break;
case 13: /* shift: shift exp_PLUS term */
#line 118 "cmExprParser.y"
#line 123 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) + (yyvsp[0].Number);
}
#line 1511 "cmExprParser.cxx"
#line 1516 "cmExprParser.cxx"
break;
case 14: /* shift: shift exp_MINUS term */
#line 121 "cmExprParser.y"
#line 126 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) - (yyvsp[0].Number);
}
#line 1519 "cmExprParser.cxx"
#line 1524 "cmExprParser.cxx"
break;
case 15: /* term: unary */
#line 126 "cmExprParser.y"
#line 131 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1527 "cmExprParser.cxx"
#line 1532 "cmExprParser.cxx"
break;
case 16: /* term: term exp_TIMES unary */
#line 129 "cmExprParser.y"
#line 134 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) * (yyvsp[0].Number);
}
#line 1535 "cmExprParser.cxx"
#line 1540 "cmExprParser.cxx"
break;
case 17: /* term: term exp_DIVIDE unary */
#line 132 "cmExprParser.y"
#line 137 "cmExprParser.y"
{
if (yyvsp[0].Number == 0) {
throw std::overflow_error("divide by zero");
}
(yyval.Number) = (yyvsp[-2].Number) / (yyvsp[0].Number);
}
#line 1546 "cmExprParser.cxx"
#line 1551 "cmExprParser.cxx"
break;
case 18: /* term: term exp_MOD unary */
#line 138 "cmExprParser.y"
#line 143 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-2].Number) % (yyvsp[0].Number);
}
#line 1554 "cmExprParser.cxx"
#line 1559 "cmExprParser.cxx"
break;
case 19: /* unary: factor */
#line 143 "cmExprParser.y"
#line 148 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1562 "cmExprParser.cxx"
#line 1567 "cmExprParser.cxx"
break;
case 20: /* unary: exp_PLUS unary */
#line 146 "cmExprParser.y"
#line 151 "cmExprParser.y"
{
(yyval.Number) = + (yyvsp[0].Number);
}
#line 1570 "cmExprParser.cxx"
#line 1575 "cmExprParser.cxx"
break;
case 21: /* unary: exp_MINUS unary */
#line 149 "cmExprParser.y"
#line 154 "cmExprParser.y"
{
(yyval.Number) = - (yyvsp[0].Number);
}
#line 1578 "cmExprParser.cxx"
#line 1583 "cmExprParser.cxx"
break;
case 22: /* unary: exp_NOT unary */
#line 152 "cmExprParser.y"
#line 157 "cmExprParser.y"
{
(yyval.Number) = ~ (yyvsp[0].Number);
}
#line 1586 "cmExprParser.cxx"
#line 1591 "cmExprParser.cxx"
break;
case 23: /* factor: exp_NUMBER */
#line 157 "cmExprParser.y"
#line 162 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[0].Number);
}
#line 1594 "cmExprParser.cxx"
#line 1599 "cmExprParser.cxx"
break;
case 24: /* factor: exp_OPENPARENT exp exp_CLOSEPARENT */
#line 160 "cmExprParser.y"
#line 165 "cmExprParser.y"
{
(yyval.Number) = (yyvsp[-1].Number);
}
#line 1602 "cmExprParser.cxx"
#line 1607 "cmExprParser.cxx"
break;
#line 1606 "cmExprParser.cxx"
#line 1611 "cmExprParser.cxx"
default: break;
}
......@@ -1827,7 +1832,7 @@ yyreturn:
return yyresult;
}
#line 165 "cmExprParser.y"
#line 170 "cmExprParser.y"
/* End of grammar */
......
......@@ -38,6 +38,11 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message);
#if defined(__GNUC__) && __GNUC__ >= 8
# pragma GCC diagnostic ignored "-Wconversion"
#endif
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wused-but-marked-unused")
# pragma clang diagnostic ignored "-Wused-but-marked-unused"
# endif
#endif
%}
/* Generate a reentrant parser object. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment