[LLVMbugs] [Bug 12949] New: invalid copy-constructible requirement
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri May 25 12:21:15 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12949
Bug #: 12949
Summary: invalid copy-constructible requirement
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: roman at binarylife.net
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
$ cat apple.cpp
struct DRMed {
~DRMed()=default;
DRMed() =default;
DRMed(DRMed&&)=delete;
DRMed(DRMed const&)=delete;
DRMed& operator=(DRMed const&)=delete;
DRMed& operator=(DRMed&&)=delete;
};
struct iOS : DRMed { ~iOS(); };
struct iPad : iOS { iPad(int); };
template<int>
void jailbreak() {
iPad junk{0};
}
void freedom() {
jailbreak<0>();
}
$ clang++ -c -std=c++11 apple.cpp
apple.cpp:15:8: error: copying variable of type 'iPad' invokes deleted
constructor
iPad junk{0};
^ ~
apple.cpp:19:3: note: in instantiation of function template specialization
'jailbreak<0>' requested here
jailbreak<0>();
^
apple.cpp:11:15: note: copy constructor of 'iPad' is implicitly deleted because
base class 'iOS' has a deleted copy constructor
struct iPad : iOS { iPad(int); };
^
apple.cpp:10:15: note: copy constructor of 'iOS' is implicitly deleted because
base class 'DRMed' has a deleted copy constructor
struct iOS : DRMed { ~iOS(); };
^
apple.cpp:5:3: note: function has been explicitly marked deleted here
DRMed(DRMed const&)=delete;
^
1 error generated.
$ clang++ --version
clang version 3.2 (trunk 157484)
Target: x86_64-unknown-linux-gnu
Thread model: posix
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list