This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Throwing constant objects (Snapshot 981026-latest rpm)
- To: egcs at cygnus dot com
- Subject: Throwing constant objects (Snapshot 981026-latest rpm)
- From: Sebastian Ritterbusch <uabp at rz dot uni-karlsruhe dot de>
- Date: Fri, 13 Nov 1998 11:19:02 +0100 (CET)
Hi,
the following code does not compile with the mentioned version (981026) as
"throw" does not want to take constant objects. Can anyone verify this with a
more current snapshot? Or am i wrong and doing bad things?
--- throw_constant.cpp
#define ANY int // a class with a public constructor
void athrow(const ANY & e) throw(ANY)
{
throw e;
}
int main(void)
{
athrow(ANY());
return 0;
}
---
And the Compiler (g++ throw_constant.cpp -o throw_constant) says:
throwconst.cpp: In function oid athrow(const int &)':
throwconst.cpp:5: passing onst int *' as argument 1 of _cp_push_exception(void *, void *, void (*)(void *, int))' discards qualifiers
(OS is Linux on Ix86)
Bye, Sebastian Ritterbusch.