Article View: comp.std.c++
Article #3802Can a type be defined in a catch argument?
From: 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
]
Technical Details
Message-ID:
<4ivs16$5j0@hpax.cup.hp.com>Path:
arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austernShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern From: dcc@hpax.cup.hp.com (Don Cameron) Newsgroups: comp.std.c++ Subject: Can a type be defined in a catch argument? Date: 25 Mar 1996 09:59:27 PST Organization: Hewlett Packard, Cupertino Approved: austern@isolde.mti.sgi.com Message-ID: <4ivs16$5j0@hpax.cup.hp.com> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 23 Mar 1996 03:43:34 GMT X-Newsreader: TIN [version 1.2 PL2] X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMVbfYEy4NqrwXLNJAQEd3QH/TfDWwGZYQkuYYHCEl07YHXkbHzq4bGpq EgKNtHNMZUKPHQyVuPb1FsclecmRTSZ/qr/vC9GSqeJZtujvEK2Udg== =Jaxw Originator: austern@isolde.mti.sgi.com