[PATCH] Don't copy objects with trivial, deleted copy ctors
Richard Smith
richard at metafoo.co.uk
Mon May 12 18:42:59 PDT 2014
On Mon, May 12, 2014 at 5:09 PM, Reid Kleckner <rnk at google.com> wrote:
> Hm, this approach fails quickly when I try to compile some simple
> programs. This program doesn't declare any special members:
> struct S { int a; };
> void foo(S s) { }
>
You should be able handle this by using hasTrivialCopyConstructor and
hasTrivialMoveConstructor to check if the class has a (possibly
not-yet-declared) trivial copy or move constructor, under the same
assumption you're already making (if there is a trivial operation that's
not yet declared, it would not be deleted).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140512/adafef25/attachment.html>
More information about the cfe-commits
mailing list