Thread View: comp.std.c++
1 messages
1 total messages
Started by Don Cameron
Mon, 25 Mar 1996 17:59
Can a type be defined in a catch argument?
Author: Don Cameron
Date: Mon, 25 Mar 1996 17:59
Date: Mon, 25 Mar 1996 17:59
33 lines
1845 bytes
1845 bytes
Is the following legal?
try {
// ...
}
catch ( class X { // ... } y )
{
// ...
}
This would seem to be nonsensical (how can a thrown object's type
match X according to the throw/catch matching rules?), but I can't find
where it's disallowed by the Jan. 96 WP, either in the grammar or in
Section 15.
15.4.6 on exception specifications states
Types shall not be defined in exception-specifications.
Isn't a similar restriction needed for exception-declarations (i.e.,
catch arguments)?
-----------------------------------------------------------------------------
Don Cameron dcc@cup.hp.com | you are in a maze of twisty little
HP Calif. Language Lab Cupertino, CA | assembly instructions, all alike
-----------------------------------------------------------------------------
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads