Adapt compilerplugins/clang/test/makeshared.cxx to MSVC standard library

> error: 'error' diagnostics seen but not expected:
>   File compilerplugins/clang/test/makeshared.cxx Line 47: rather use make_shared than constructing from 'unique_ptr<int>' [loplugin:makeshared]
>   File compilerplugins/clang/test/makeshared.cxx Line 49: rather use make_shared than constructing from 'unique_ptr<int>' [loplugin:makeshared]
>   File compilerplugins/clang/test/makeshared.cxx Line 53: rather use make_shared than constructing from 'unique_ptr<int>' [loplugin:makeshared]

Change-Id: I5d2d1b129c9d0fee496eceb4e2cf14f5853ba00b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100074
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2020-08-04 11:50:37 +02:00
parent 5a8edae67c
commit 30ededbd00

View File

@ -43,13 +43,13 @@ void test1()
void test2() void test2()
{ {
// expected-error-re@+1 {{rather use make_shared than constructing from {{.+}} (aka 'unique_ptr<int>') [loplugin:makeshared]}} // expected-error-re@+1 {{rather use make_shared than constructing from {{.*}}'unique_ptr<int>'{{.*}} [loplugin:makeshared]}}
std::shared_ptr<int> x = std::make_unique<int>(1); std::shared_ptr<int> x = std::make_unique<int>(1);
// expected-error-re@+1 {{rather use make_shared than constructing from {{.+}} (aka 'unique_ptr<int>') [loplugin:makeshared]}} // expected-error-re@+1 {{rather use make_shared than constructing from {{.*}}'unique_ptr<int>'{{.*}} [loplugin:makeshared]}}
x = std::make_unique<int>(1); x = std::make_unique<int>(1);
(void)x; (void)x;
// expected-error-re@+1 {{rather use make_shared than constructing from {{.+}} (aka 'unique_ptr<int>') [loplugin:makeshared]}} // expected-error-re@+1 {{rather use make_shared than constructing from {{.*}}'unique_ptr<int>'{{.*}} [loplugin:makeshared]}}
std::shared_ptr<int> y(std::make_unique<int>(1)); std::shared_ptr<int> y(std::make_unique<int>(1));
(void)y; (void)y;