[GCC-XML] last commit

Roman Yakovenko roman.yakovenko at gmail.com
Thu Jun 12 13:40:40 EDT 2008


On Wed, Jun 4, 2008 at 11:00 PM, Roman Yakovenko
<roman.yakovenko at gmail.com> wrote:
> On Wed, Jun 4, 2008 at 9:17 PM, Brad King <brad.king at kitware.com> wrote:
>> Roman Yakovenko wrote:
>>> Good evening.
>>>
>>> Brad, can you explain your last commit?
>>>
>>> "... BUG: xml_output_record_type should perform lazy declaration of
>>> implicitly declared constructors, destructors, and assignment
>>> operators so they are reported in the output.  See issue #7148. ..."
>>>
>>> Can you give an example of a code that this commit fix?
>>
>> It was a fix for this bug:
>>
>>  http://www.gccxml.org/Bug/view.php?id=7148
>>
>> For this code:
>>
>>  struct A { template <class T> A(T&); };
>>
>> gccxml was dumping no constructors at all which made the class look
>> default-constructible.  We still don't dump the template, but now
>> someone reading the output can assume from the lack of a default
>> constructor that there is no such constructor available.
>>
>>> Code generation for Boost.Python could be very tricky, especially when
>>> it is related to constructors and destructors.
>>
>> After this fix, all constructors and destructors that exist for a class
>> are dumped whether the user declared them or not.  Those that were
>> implicitly declared by the compiler are marked as "artificial".

Brad, I found something strange in XML, generated by GCC-XML with the
latest patch. Also I am not sure whether this is GCCXML problem or my
lack of C++ knowledge.

This is the smallest example I found:

namespace is_noncopyable{ namespace detail{
    struct BBB{ const int values[10]; };
    void test_BBB(BBB by_value);
    struct const_container{ const BBB items[10]; };
    void test_const_container(const_container by_value);
} }

struct AAA{ const int values[10]; };

As you can see AAA and BBB struct has exactly same definition, but for
some reason GCCXML generates that AAA has:

* constructor
* copy constructor
* operator=
* destructor
* variable

but BBB has only variable and public destructor.

If I comment declarations, that use BBB, than GCCXML generates all 5
declarations.

Thanks for help.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the gccxml mailing list