#7 Minor bug, throw() declaration gets lost

closed-fixed
nobody
None
5
2007-01-07
2007-01-05
Kulik
No

This is really a minor bug, throw(..) gets lost and isn't generated in the wrapper classes, it doesn't matter but gcc4 (maybe gcc3 too) generates an error: looser throw specifier for 'virtual const char* Exception_wrapper::what() const'. I don't use throw() specifier that much, but Exception class is derived off std::exception and I need to include the throw() declaration there, otherwise I get the very same error.

I don't know whether gccxml itself does expose throw declaration, I hardly doubt, it would be great if it did though :)

Thanks in advance,
Martin Preisler

Discussion

  • Roman
    Roman
    2007-01-05

    Logged In: YES
    user_id=1084190
    Originator: NO

    Martin this time I need to ask few questions.
    1. What version of GCC-XML do you use? If you use 0.6 than you have to upgrade to the CVS one.
    Take a look on http://language-binding.net/pygccxml/download.html#gcc-xml page for GCC-XML
    installer created by me.
    2. I attached a file, that shows that virtual functions do have exception specifier. May be do you
    mean something else?
    File Added: x.h

     
  • Roman
    Roman
    2007-01-05

     
    Attachments
    x.h
  • Kulik
    Kulik
    2007-01-06

    Logged In: YES
    user_id=1620918
    Originator: YES

    I use dev-cpp/gccxml-0.7.0_pre20060311. The newest one provided by gentoo's portage. I will use your installer and post the results.

     
  • Kulik
    Kulik
    2007-01-06

    Logged In: YES
    user_id=1620918
    Originator: YES

    It doesn't work in my case even with the gccxml in your installer.

    for specific throw statements it works
    const char* method() throw( SomeExceptionClass )
    {}

    but for the empty can-throw-something statement it doesn't work
    const char* method() throw()
    {}

     
  • Roman
    Roman
    2007-01-06

    Logged In: YES
    user_id=1084190
    Originator: NO

    No need to install other GCC-XML. I am almost sure that I forget to add support for empty throws.
    I will do that tomorrow. It is almost midnight here. I think you provided enough information.

     
  • Roman
    Roman
    2007-01-07

     
    Attachments
  • Roman
    Roman
    2007-01-07

    Logged In: YES
    user_id=1084190
    Originator: NO

    Hello Martin. I think that I fixed the bug. Can you verify this against SVN version?
    This time you will have to check out pygccxml too. I added new unit test: http://tinyurl.com/ycepn9 and attached the generated file.

    File Added: throw.cpp

     
  • Kulik
    Kulik
    2007-01-07

    Logged In: YES
    user_id=1620918
    Originator: YES

    It works now, many thanks!

     
  • Kulik
    Kulik
    2007-01-07

    • status: open --> closed-fixed