@@ -920,19 +920,20 @@ bool Parser::rStaticAssert(cpp_static_assertt &cpp_static_assert)
920
920
if (lex.get_token (tk)!=TOK_STATIC_ASSERT)
921
921
return false ;
922
922
923
- cpp_static_assert=cpp_static_assertt ();
924
- set_location (cpp_static_assert, tk);
925
-
926
923
if (lex.get_token (tk)!=' (' )
927
924
return false ;
928
925
929
- if (!rExpression (cpp_static_assert.cond (), false ))
926
+ exprt cond;
927
+
928
+ if (!rExpression (cond, false ))
930
929
return false ;
931
930
932
931
if (lex.get_token (tk)!=' ,' )
933
932
return false ;
934
933
935
- if (!rExpression (cpp_static_assert.description (), false ))
934
+ exprt description;
935
+
936
+ if (!rExpression (description, false ))
936
937
return false ;
937
938
938
939
if (lex.get_token (tk)!=' )' )
@@ -941,6 +942,10 @@ bool Parser::rStaticAssert(cpp_static_assertt &cpp_static_assert)
941
942
if (lex.get_token (tk)!=' ;' )
942
943
return false ;
943
944
945
+ cpp_static_assert =
946
+ cpp_static_assertt (std::move (cond), std::move (description));
947
+ set_location (cpp_static_assert, tk);
948
+
944
949
return true ;
945
950
}
946
951
@@ -7505,7 +7510,7 @@ optionalt<codet> Parser::rStatement()
7505
7510
7506
7511
case TOK_STATIC_ASSERT:
7507
7512
{
7508
- cpp_static_assertt cpp_static_assert;
7513
+ cpp_static_assertt cpp_static_assert{ nil_exprt (), nil_exprt ()} ;
7509
7514
7510
7515
if (!rStaticAssert (cpp_static_assert))
7511
7516
return {};
0 commit comments