Thomas Klausner | 28 Mar 2012 17:19
Picon

nested_exception.h vs. clang

Hi!

When compiling some packages with clang (the version installed by
HAVE_LLVM and MKLLVM), they fail with:

In file included from /usr/include/g++/exception:151:
/usr/include/g++/nested_exception.h:122:61: error: redefinition of default argument
    __throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
                                                            ^ ~
/usr/include/g++/nested_exception.h:110:56: note: previous definition is here
    __throw_with_nested(_Ex&&, const nested_exception* = 0)
                                                       ^ ~
1 error generated.

Suggestions?
 Thomas

Christos Zoulas | 28 Mar 2012 17:49

Re: nested_exception.h vs. clang

In article <20120328151948.GL16022 <at> danbala.tuwien.ac.at>,
Thomas Klausner  <wiz <at> NetBSD.org> wrote:
>Hi!
>
>When compiling some packages with clang (the version installed by
>HAVE_LLVM and MKLLVM), they fail with:
>
>In file included from /usr/include/g++/exception:151:
>/usr/include/g++/nested_exception.h:122:61: error: redefinition of
>default argument
>    __throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
>                                                            ^ ~
>/usr/include/g++/nested_exception.h:110:56: note: previous definition is here
>    __throw_with_nested(_Ex&&, const nested_exception* = 0)
>                                                       ^ ~
>1 error generated.
>
>
>Suggestions?
> Thomas

clang is correct; C++ default arguments are illegal in the function defininion.
http://msdn.microsoft.com/en-us/library/91563f79%28v=vs.80%29.aspx
s/ = 0// in line 122.

christos

Thomas Klausner | 28 Mar 2012 23:08
Picon

Re: nested_exception.h vs. clang

On Wed, Mar 28, 2012 at 03:49:18PM +0000, Christos Zoulas wrote:
> clang is correct; C++ default arguments are illegal in the function defininion.
> http://msdn.microsoft.com/en-us/library/91563f79%28v=vs.80%29.aspx
> s/ = 0// in line 122.

Thanks. I'll build a world with that change and commit.
 Thomas

Thomas Klausner | 9 Apr 2012 02:25
Picon

Re: nested_exception.h vs. clang

On Wed, Mar 28, 2012 at 11:08:23PM +0200, Thomas Klausner wrote:
> On Wed, Mar 28, 2012 at 03:49:18PM +0000, Christos Zoulas wrote:
> > clang is correct; C++ default arguments are illegal in the function defininion.
> > http://msdn.microsoft.com/en-us/library/91563f79%28v=vs.80%29.aspx
> > s/ = 0// in line 122.
> 
> Thanks. I'll build a world with that change and commit.

Done.
 Thomas

Joerg Sonnenberger | 29 Mar 2012 03:00
Picon

Re: nested_exception.h vs. clang

On Wed, Mar 28, 2012 at 05:19:48PM +0200, Thomas Klausner wrote:
> Hi!
> 
> When compiling some packages with clang (the version installed by
> HAVE_LLVM and MKLLVM), they fail with:
> 
> In file included from /usr/include/g++/exception:151:
> /usr/include/g++/nested_exception.h:122:61: error: redefinition of default argument
>     __throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
>                                                             ^ ~
> /usr/include/g++/nested_exception.h:110:56: note: previous definition is here
>     __throw_with_nested(_Ex&&, const nested_exception* = 0)
>                                                        ^ ~
> 1 error generated.

The complain is correct. I had a patch in my local tree for that from
upstream, but continued to run into issues. I ultimately decided that
libstdc++ is somewhat a lost cause when it comes to standard compliance
:(

Joerg


Gmane