This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Multiple FUNCTION_DECLS for __cxa_begin_catch
- From: Brendon Costa <bcosta at avdat dot com dot au>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 30 Nov 2006 16:08:42 +1100
- Subject: Multiple FUNCTION_DECLS for __cxa_begin_catch
Hi again,
Getting further along with my project, I have come across yet another
thing that I dont understand. While compiling:
libstdc++-v3/libsupc++/vec.cc
My GCC extension comes across two FUNCTION_DECL nodes that both have
DECL_ASSEMBLER_NAME of __cxa_begin_catch
After reading some past posts it seems that the standard allows for
multiple C functions defined extern "C" in different namespaces.
As an example of code which might do this see below:
extern "C"
{
void Function(void) {}
}
namespace NS
{
extern "C"
{
void Function(void);
}
}
Is it safe to assume in the C++ front end that two functions declared in
such a manner will always share the same implementation in which case it
is kind-of like a "using" statement?
If so, is there any reason why the following code does not emit an error
in the compiler but only in the assembler?
extern "C"
{
void Function(void) {}
}
namespace NS
{
extern "C"
{
void Function(void) {}
}
}
Thanks,
Brendon.