[GCC-XML] default argument namespace

Gerd v. Egidy lists at egidy.de
Fri Jul 18 12:39:29 EDT 2008


Hi,

I'm using gccxml within our libt2n-project (a C++ IPC library, 
http://www.intra2net.com/de/produkte/opensource/libt2n/)
and it has helped us very much to avoid needing an IDL-file: you just 
mark a function within the source and that is parsed by gccxml to 
gather the information usually found within an IDL.

I'm now adding support for default arguments and I'm unsure 
about the details of the gccxml-output:

when I write 

void testb(std::string a=std::string())
{
    return;
}

I'll get

<Function id="_8" name="testb" returns="_334" context="_1" mangled="_Z5testbSs" 
   demangled="testb(std::string)" location="f0:23" file="f0" line="23" endline="25">
  <Argument name="a" type="_951" location="f0:23" file="f0" line="23" default="string()"/>
</Function>

So the default argument is returned without namespace.

But in this code:

namespace foo
{

    class bar
    {
        public:
            static const std::string other;
    };

    const std::string bar::other="secret";
}
 
void testc(std::string a=foo::bar::other)
{
    return;
}

<Function id="_7" name="testc" returns="_334" context="_1" mangled="_Z5testcSs" 
  demangled="testc(std::string)" location="f0:28" file="f0" line="28" endline="30">
  <Argument name="a" type="_951" location="f0:28" file="f0" line="28" default="foo::bar::other"/>
</Function>

I get the full namespace of the default argument.

I always need the full namespace of the default argument to be able 
to add it to the headers of my stubs.

Would anyone mind to help me understand the logic behind the
default attribute and where to get the namespace from in my
first example?

Kind regards,

Gerd

-- 
Address (better: trap) for people I really don't want to get mail from:
james at cactusamerica.com



More information about the gccxml mailing list