[cfe-dev] Clang error message implicitly-deleted copy constructor

Fletcher, John P j.p.fletcher at aston.ac.uk
Tue Mar 27 12:08:19 PDT 2012


David

Thank you very much. I have followed through on the September 2011 case and it does look like a problem in libstdc++ not clang, fixed in later libstdc++ than the 4.4 I am using.

John

________________________________________
From: David Blaikie [dblaikie at gmail.com]
Sent: 27 March 2012 17:12
To: Fletcher, John P
Cc: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] Clang error message implicitly-deleted copy constructor

On Tue, Mar 27, 2012 at 8:57 AM, Fletcher, John P
<j.p.fletcher at aston.ac.uk> wrote:
> Apologies that this not related to clang development, more to clang usage.
>
> I have this error message:
>
> error: call to implicitly-deleted copy constructor of
>      'std::pair<int, int>'
>
> This is happening when I use a templated list and attempt to make a list of std::pair<int,int>.
>
> This used to work fine but now fails with clang 3.1 with C++11.
>
> Please could someone point me to somewhere where there is discussion on this.  I would like to adapt my code to (a) detect a std::pair and (b) take appropriate action.  I have made some progress with (a) but complete frustration with (b).

I'm not entirely sure what you're getting at - where are you doing (a)?

In any case, this is probably the same bug in libstdc++ that was
discussed on the list 6 months ago. I believe it was fixed in
libstdc++ since then. The original cfe-dev thread is here:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-September/017183.html
and some better documentation (though it still doesn't call out the
libstdc++ issue) for Clang's conformance is here:
http://clang.llvm.org/compatibility.html#deleted-special-func

> It does not look a clever idea to try and put a copy constructor into std::pair.
>
> There are more details at http://c2.com/cgi/wiki?ImplicitlyDeletedCopyConstructor
>
> Thanks
>
> John
>
> Dr John P. Fletcher Tel: (44) 121 204 3389 (direct line), FAX: (44) 121 204 3678
> Chemical Engineering and Applied Chemistry (CEAC),
> formerly Associate Dean - External Relations,
> School of Engineering and Applied Science (EAS),
> Aston University, Aston Triangle, BIRMINGHAM B4 7ET  U.K.
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev






More information about the cfe-dev mailing list