[cfe-dev] clang and a class with non-copyable and non-assignable member

David Blaikie dblaikie at gmail.com
Sat Jan 17 08:53:24 PST 2015


Do you have a complete (standalone - preprocessed) example of this behavior?

On Sat, Jan 17, 2015 at 8:06 AM, Edward Diener <
eldlistmailingz at tropicsoft.com> wrote:

> I am using the latest clang built from source. I am seeing this situation:
>
> class XXX { some_non_copyable_non_assignable_member_type member; }
>
> An object of class XXX never gets copied or assigned (it's a singleton )
> and yet clang is giving an errors of the form:
>
> error: 'operator=' is a private member of 'some_non_assignable_member_
> type'.
>
> and
>
> error: field of type 'some_non_copyable_non_assignable_member_type' has
> private copy constructor
>
> My understanding of C++ is that if a member of a class is non-copyable and
> non-assignable and an instance of that class is never copied or assigned it
> is not an error even if the compiler would be creating a default copy
> constructor and default assignment operator when the class does not have
> user-defined versions.
>
> The command line options to the clang++.exe compiler are:
>
> -c -x c++ -O0 -g -fno-inline -Wall -pedantic -g
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150117/ebc5f942/attachment.html>


More information about the cfe-dev mailing list