Are clang++ and libc++ compatible?

Dimitry Andric dim at FreeBSD.org
Tue Nov 12 17:38:00 UTC 2013


On 12 Nov 2013, at 17:54, Steve Kargl <sgk at troutmask.apl.washington.edu> wrote:
...
> namespace pan
> {
>  class Log
>  {
>    public:
>      enum Severity {
>        PAN_SEVERITY_INFO = 1,
>        PAN_SEVERITY_ERROR = 2,
>        PAN_SEVERITY_URGENT = (1<<10)
>      };
> 
>      struct Entry {
>        time_t date;
>        Severity severity;
>        std::deque<Entry> messages;
>        std::string message;
>        bool is_child;
>        Entry() : is_child(false) { }
>      };

I think the problem is that the code tries to use std::deque<Entry> as a
member of struct Entry, before it is completely defined.  This is not
allowed by the standard, although some libraries (e.g. GNU libstdc++)
apparently permit it for some container types.

You could try to work around it with -fdelayed-template-parsing, but I
am not sure if it will help.  Alternatively, compile the code with
libstdc++, or rewrite it to conform. :-)

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20131112/7184669c/attachment.sig>


More information about the freebsd-current mailing list