From 04bea93961d8d276ed50892316debeeaf61d8415 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Thu, 29 Dec 2011 18:40:13 +0000 Subject: [PATCH] Make this text slightly more accurate; thanks to Johannes Schaub for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147346 91177308-0d34-0410-b5e6-96231b3b80d8 --- www/compatibility.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/www/compatibility.html b/www/compatibility.html index 2102ccca7e..ca43e1951d 100644 --- a/www/compatibility.html +++ b/www/compatibility.html @@ -769,7 +769,7 @@ void f(int a, int a);

In C++11, the explicit declaration of a move constructor or a move -assignment operator within a class disables the implicit declaration +assignment operator within a class deletes the implicit declaration of the copy constructor and copy assignment operator. This change came fairly late in the C++11 standardization process, so early implementations of C++11 (including Clang before 3.0, GCC before 4.7, @@ -778,16 +778,17 @@ accept this ill-formed code:

 struct X {
-  X(X&&); // suppresses implicit copy constructor
+  X(X&&); // deletes implicit copy constructor:
+  // X(const X&) = delete;
 };
 
 void f(X x);
 void g(X x) {
-  f(x); // error: X has no copy constructor
+  f(x); // error: X has a deleted copy constructor
 }
 
-

This affects some C++11 code, including Boost's popular This affects some early C++11 code, including Boost's popular shared_ptr up to version 1.47.0. The fix for Boost's shared_ptr is available here.

-- 2.40.0