File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
regression/cbmc/gcc_conditional_expr1 Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
13int g , k ;
24
5+ // See https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html
36int main ()
47{
58 int r1 , r2 ;
@@ -14,4 +17,10 @@ int main()
1417 assert (r2 == 1 );
1518 assert (g == 2 );
1619 assert (k == 0 );
20+
21+ int in_decl = g ++ ?: 0 ;
22+ assert (in_decl == 2 );
23+ assert (g == 3 );
24+
25+ return 0 ;
1726}
Original file line number Diff line number Diff line change @@ -758,7 +758,8 @@ void goto_convertt::convert_assign(
758758 (rhs.get (ID_statement) == ID_assign ||
759759 rhs.get (ID_statement) == ID_postincrement ||
760760 rhs.get (ID_statement) == ID_preincrement ||
761- rhs.get (ID_statement) == ID_statement_expression))
761+ rhs.get (ID_statement) == ID_statement_expression ||
762+ rhs.get (ID_statement) == ID_gcc_conditional_expression))
762763 {
763764 // handle above side effects
764765 clean_expr (rhs, dest, mode);
You can’t perform that action at this time.
0 commit comments