[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Locals out of context with other locals defined in next try block
From: |
Mike Morgan |
Subject: |
Locals out of context with other locals defined in next try block |
Date: |
Wed, 20 Jun 2001 16:32:33 -0400 |
Hi,
I'm seeing a bug with gdb 5.0 under Linux with scope and
exceptions. If a variable is declared in a try block following a catch
(ret), the locals in the previous catch are not within scope.
Does anyone have a fix for this? The problem seems to exist in 4.18
as well.
int main()
{
int a = 0;
try {
throw 42;
} catch(int x) {
a = x; // gdb says 'No symbol "x" in current context.
}
try {
int ret = 0; // existance of this causes 'x' to be out of
scope above
} catch(int) {
}
return 0;
}
Thanks,
Mike Morgan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Locals out of context with other locals defined in next try block,
Mike Morgan <=