Re: Runtime exception check at compile time?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matt,

> I've painfully discovered that all exceptions in c++ functions must be
declared if they are thrown.

What do you mean?  Like this...

class Foo;
int Func()
{
  throw Foo();
}

Yes, you need to declare Foo.  A forward declaration is insufficient.

> Can the compiler enforce this at compile time instead of at runtime?

GCC's g++ compiler/linker disallows the above, for me.

--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux