bro 2.1 vs clang

There's a FreeBSD ports bug report that says clang 3.3 doesn't like bro 2.1:

    182127 – security/bro fails to build

    /home/ports/security/bro/work/bro-2.1/src/ error:
reference to 'is_assignable' is ambiguous
    if ( ! is_assignable(op->Type()) )
    /home/ports/security/bro/work/bro-2.1/src/Type.h:645:12: note:
candidate found by name lookup is 'is_assignable'
    extern int is_assignable(BroType* t);
    /usr/include/c++/v1/type_traits:1407:8: note: candidate found by
name lookup is 'std::__1::is_assignable'
    struct is_assignable
    1 error generated.

I don't have a 10/CURRENT system handy but I built clang 3.3 on my
9.1-RELEASE system but bro built without errors. (There were errors
which I've attached in case they'd be useful.) Rather than having to
actually build a -CURRENT system to figure this out, is it obvious what
the issue is and how to patch it?

I'm now the maintainer of the FreeBSD bro port and I'm about to submit a
PR to split broccoli out of the current bro port, make broctl a config
option, etc. and would like to fix this as part of this update if possible.


bro.txt (21.7 KB)

clang will be happy if you change it to this:

    + if ( ! ::is_assignable(op->Type()) )

I've actually fixed that in a branch, thanks for reminding me to merge
it in for 2.2. :slight_smile: