We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ cat makeuniquetest.cpp #include int main() { auto p = std::unique_ptr{new int()}; p.reset(new int()); }
clang-tidy warns about line 4, but not line 5:
$ clang-tidy makeuniquetest.cpp -checks=-*,modernize-make-unique -- -std=c++14 1 warning generated. /makeuniquetest.cpp:4:14: warning: use std::make_unique instead [modernize-make-unique] auto p = std::unique_ptr{new int()}; ^ std::make_unique ( )
Expected result after applying fixes:
#include int main() { auto p = std::make_unique(); p = std::make_unique(); }
The text was updated successfully, but these errors were encountered:
assigned to @pepsiman
Sorry, something went wrong.
Fixed in https://reviews.llvm.org/rL285589
pepsiman
No branches or pull requests
Extended Description
$ cat makeuniquetest.cpp
#include
int main()
{
auto p = std::unique_ptr{new int()};
p.reset(new int());
}
clang-tidy warns about line 4, but not line 5:
$ clang-tidy makeuniquetest.cpp -checks=-*,modernize-make-unique -- -std=c++14
1 warning generated.
/makeuniquetest.cpp:4:14: warning: use std::make_unique instead [modernize-make-unique]
auto p = std::unique_ptr{new int()};
^
std::make_unique ( )
Expected result after applying fixes:
#include
int main()
{
auto p = std::make_unique();
p = std::make_unique();
}
The text was updated successfully, but these errors were encountered: