Changeset 553f032f for tests/exceptions
- Timestamp:
- Sep 8, 2023, 5:15:41 PM (16 months ago)
- Branches:
- master
- Children:
- 5cfb8b1
- Parents:
- 2fa0237
- Location:
- tests/exceptions
- Files:
-
- 1 added
- 1 deleted
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/try-ctrl-flow.cfa
r2fa0237 r553f032f 1 // All of these should be caught as long as the check remains in the same2 // pass. (Although not even all of the checks are in place yet.)1 // Check all the local control flow structures that are "sealed" by some the 2 // try statement clauses; where structured programming is stricter. 3 3 4 4 void break_in_finally() { … … 151 151 } 152 152 153 // Now just use return to test the other try control flow interactions. 154 155 exception nil_exception {}; 156 157 void return_in_try_with_catch() { 158 try { 159 return; 160 } catch (nil_exception *) { 161 ; 162 } 163 } 164 165 // Allowed. 166 void return_in_try_with_catchReturn() { 167 try { 168 return; 169 } catchResume (nil_exception *) { 170 ; 171 } 172 } 173 174 // Allowed. 175 void return_in_try_with_finally() { 176 try { 177 return; 178 } finally { 179 ; 180 } 181 } 182 183 void return_in_catch() { 184 try { 185 ; 186 } catch (nil_exception *) { 187 return; 188 } 189 } 190 191 void return_in_catchResume() { 192 try { 193 ; 194 } catchResume (nil_exception *) { 195 return; 196 } 197 } 198 153 199 void main() { 154 200 // Should not compile.
Note: See TracChangeset
for help on using the changeset viewer.