-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++11clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
| Bugzilla Link | 19591 |
| Version | trunk |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@zygoloid |
Extended Description
$ cat a.cc#include <memory>
void f(std::unique_ptr<int> i) {
std::unique_ptr<int> j = i;
}$ clang a.cc -std=c++11
a.cc:4:24: error: call to deleted constructor of 'std::unique_ptr<int>'
std::unique_ptr<int> j = i;
^ ~
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/unique_ptr.h:256:7: note:
'unique_ptr' has been explicitly marked deleted here
unique_ptr(const unique_ptr&) = delete;
^
1 error generated.Could we detect that there is a rvalue-reference constructor and suggest that the user may have wanted to use it (or std::move)?
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++11clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer