Bug 2456 – "cannot put catch statement inside finally block", missing line number

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2008-11-15T08:51:00Z
Last change time
2015-06-09T05:11:52Z
Keywords
diagnostic, pull, rejects-valid
Assigned to
nobody
Creator
fvbommel

Comments

Comment #0 by fvbommel — 2008-11-15T08:51:35Z
I get an error ("cannot put catch statement inside finally block") on the following code: ---- module test; extern(C) int printf(char*, ...); void verify() {} void main() { scope(success) { scope(failure) printf("Verification failed!\n"); verify(); } } ---- (GDC allows this without complaining) Also, this error doesn't print a source location.
Comment #1 by acehreli — 2011-11-03T14:29:20Z
I hit the same problem with dmd 2.056. Here is a simpler code: void main() { scope(exit) try{} catch {} } Notes: 1) In this case the line number is printed correctly in the error message. 2) It is the same issue with scope(success)
Comment #2 by acehreli — 2011-11-03T14:31:47Z
Please disregard my previous comment. I am talking about something else.
Comment #3 by clugdbug — 2012-09-26T01:30:46Z
Applies also to D2.060. Has no line number in the error message in D1 or D2.
Comment #4 by k.hara.pg — 2014-05-21T13:55:42Z
Comment #5 by github-bugzilla — 2014-05-24T20:48:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3819ceeeecbe6d7daab94a3ab27d84c7eab6e372 fix Issue 2456 - "cannot put catch statement inside finally block", missing line number https://github.com/D-Programming-Language/dmd/commit/75950518c1a448c85aa7e9db2033b09f4c377380 Merge pull request #3564 from 9rnsr/fix_onscope Issue 6889 & 2456 - Fix diagnostic messages for OnScomeStatement