github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 85437 tests passed
* 1207 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### Clang Tools
<details>
<summary>Clang
Tools.clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
/usr/bin/python3
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp
cppcoreguidelines-owning-memory
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp
# executed command: /usr/bin/python3
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp
cppcoreguidelines-owning-memory
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp
# .---command stdout------------
# | Running ['clang-tidy', '--experimental-custom-checks',
'/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp',
'-fix', '--checks=-*,cppcoreguidelines-owning-memory', '--config={}', '--',
'-std=c++11', '-nostdinc++']...
# | ------------------------ clang-tidy output -----------------------
# | 51 warnings generated.
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:38:3:
warning: returning a newly created resource of type 'int *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 38 | return new int(42);
# | | ^~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:47:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 47 | gsl::owner<int *> owner = new int(42);
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:48:3:
warning: returning a newly created resource of type 'int *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 48 | return owner;
# | | ^~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:59:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 59 | gsl::owner<int *> o1 = new int(42); // Ok
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:73:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 73 | gsl::owner<int *> owned_int1 = &stack_int1; // BAD
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:77:3:
warning: expected assignment source to be of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 77 | owned_int2 = &stack_int2; // BAD since no owner, bad since
uninitialized
# | | ^~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:80:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 80 | gsl::owner<int *> owned_int3 = new int(42); // Good
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:99:3:
warning: initializing non-owner 'int *' with a newly created 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 99 | int *unowned_int3 = returns_owner1(); // Bad
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:106:3:
warning: assigning newly created 'gsl::owner<>' to non-owner 'int *'
[cppcoreguidelines-owning-memory]
# | 106 | unowned_int4 = returns_owner1(); // Bad
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:109:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 109 | gsl::owner<int *> owned_int11 = returns_no_owner1(); // Bad since
no owner
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:113:3:
warning: expected assignment source to be of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 113 | owned_int12 = returns_no_owner1(); // Bad since no owner
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:124:3:
warning: assigning newly created 'gsl::owner<>' to non-owner 'int *'
[cppcoreguidelines-owning-memory]
# | 124 | unowned_int8 = new int(42);
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:131:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 131 | gsl::owner<int *> owned_int1 = new int(42);
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:134:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 134 | gsl::owner<int *> owned_int2 = new int[42];
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:139:3:
warning: deleting a pointer through a type that is not marked 'gsl::owner<>';
consider using a smart pointer instead [cppcoreguidelines-owning-memory]
# | 139 | delete unowned_int1; // BAD, since no owner
# | | ^ ~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:137:3:
note: variable declared here
# | 137 | int *unowned_int1 = new int(42); // BAD, since new creates and
owner
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:145:3:
warning: deleting a pointer through a type that is not marked 'gsl::owner<>';
consider using a smart pointer instead [cppcoreguidelines-owning-memory]
# | 145 | delete[] unowned_int2; // BAD since no owner
# | | ^ ~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:143:3:
note: variable declared here
# | 143 | int *unowned_int2 = new int[42]; // BAD, since new creates and
owner
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:156:15:
warning: expected argument of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 156 | takes_owner(&stack_int); // BAD
# | | ^~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:158:15:
warning: expected argument of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 158 | takes_owner(unowned_int1); // BAD
# | | ^~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:161:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 161 | gsl::owner<int *> owned_int1 = new int(42);
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:164:28:
warning: expected argument of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 164 | takes_owner_and_more(42, &stack_int, 42.0f); // BAD
# | | ^~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:166:28:
warning: expected argument of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 166 | takes_owner_and_more(42, unowned_int1, 42.0f); // BAD
# | | ^~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:174:25:
warning: expected argument of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 174 | takes_templated_owner(unowned_int1); // Bad
# | | ^~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:178:15:
warning: expected argument of type 'gsl::owner<>'; got 'int *'
[cppcoreguidelines-owning-memory]
# | 178 | takes_owner(returns_no_owner1()); // BAD
# | | ^~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:185:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 185 | gsl::owner<int *> owned_int1 = new int(42);
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:190:17:
warning: initializing non-owner argument of type 'int *' with a newly created
'gsl::owner<>' [cppcoreguidelines-owning-memory]
# | 190 | takes_pointer(new int(42)); // Bad, since new creates and owner
# | | ^~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:193:17:
warning: initializing non-owner argument of type 'int *' with a newly created
'gsl::owner<>' [cppcoreguidelines-owning-memory]
# | 193 | takes_pointer(returns_owner1()); // Bad
# | | ^~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:237:43:
warning: expected initialization of owner member variable with value of type
'gsl::owner<>'; got 'ArbitraryClass *' [cppcoreguidelines-owning-memory]
# | 237 | ClassWithOwner(ArbitraryClass &other) : owner_var(&other) {}
# | | ^~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:247:5:
warning: expected assignment source to be of type 'gsl::owner<>'; got
'ArbitraryClass *' [cppcoreguidelines-owning-memory]
# | 247 | owner_var = bad_data;
# | | ^~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:262:3:
warning: member variable of type 'gsl::owner<>' requires the class
'ClassWithOwner' to implement a destructor to release the owned resource
[cppcoreguidelines-owning-memory]
# | 262 | gsl::owner<ArbitraryClass *> owner_var;
# | | ^
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:268:3:
warning: member variable of type 'gsl::owner<>' requires the class
'DefaultedDestructor' to implement a destructor to release the owned resource
[cppcoreguidelines-owning-memory]
# | 268 | gsl::owner<int *> Owner;
# | | ^
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:274:3:
warning: member variable of type 'gsl::owner<>' requires the class
'DeletedDestructor' to implement a destructor to release the owned resource
[cppcoreguidelines-owning-memory]
# | 274 | gsl::owner<int *> Owner;
# | | ^
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:288:3:
warning: expected assignment source to be of type 'gsl::owner<>'; got
'ArbitraryClass *' [cppcoreguidelines-owning-memory]
# | 288 | Owner2 = &A; // BAD, since type deduction resulted in
owner<ArbitraryClass *>
# | | ^~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:292:3:
warning: expected assignment source to be of type 'gsl::owner<>'; got
'ArbitraryClass *' [cppcoreguidelines-owning-memory]
# | 292 | Owner3 = &A;
// Bad, since assignment of non-owner to owner
# | | ^~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:299:25:
warning: expected initialization of owner member variable with value of type
'gsl::owner<>'; got 'int *' [cppcoreguidelines-owning-memory]
# | 299 | HeapArray(int size) : _data(new int[size]), size(size) {} // Ok
# | | ^~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:306:50:
warning: expected initialization of owner member variable with value of type
'gsl::owner<>'; got 'void' [cppcoreguidelines-owning-memory]
# | 306 | HeapArray(int size, T val, int *problematic) :
_data{problematic}, size(size) {} // Bad
# | | ^~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:311:5:
warning: expected assignment source to be of type 'gsl::owner<>'; got
'std::nullptr_t' [cppcoreguidelines-owning-memory]
# | 311 | other._data = nullptr;
// Ok
# | | ^~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:341:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 341 | gsl::owner<int *> OwningPtr = Array1.data(); // Bad, since it
does not return the owner
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:361:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'T'
[cppcoreguidelines-owning-memory]
# | 361 | gsl::owner<int *> owner_t = t; // Probably bad, since type
deduction still wrong
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:361:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 361 | gsl::owner<int *> owner_t = t; // Probably bad, since type
deduction still wrong
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:381:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | 381 | gsl::owner<int *> IntOwner1 = NonOwner1.getVal(); // Bad, since
owner initialized with non-owner
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:396:5:
warning: returning a newly created resource of type 'A *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 396 | return new B;
# | | ^~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:417:7:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a lambda whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 417 | return ::gsl::owner<S*>{new S{}};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:433:9:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 433 | return ::gsl::owner<S*>{new S{}};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:446:5:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 446 | return ::gsl::owner<S*>{new S(MakeI())};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:461:5:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 461 | return ::gsl::owner<S*>{new S(C().test())};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:475:7:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a lambda whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 475 | return ::gsl::owner<S*>{new S(MakeI())};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:483:9:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a lambda whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 483 | return ::gsl::owner<S*>{new S(1)};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:486:7:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a lambda whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 486 | return ::gsl::owner<S*>{new S(2)};
# | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:500:39:
warning: returning a newly created resource of type 'S *' or 'gsl::owner<>'
from a lambda whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | 500 | const auto MakeS = []() -> S* { return new S(); };
# | | ^~~~~~~~~~~~~~
# | Suppressed 3 warnings (1 NOLINT, 2 with check filters).
# |
# | ------------------------------------------------------------------
# | ------------------------------ Fixes -----------------------------
# |
# | ------------------------------------------------------------------
# | FileCheck
-input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp.notes
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp
-check-prefixes=CHECK-NOTES -implicit-check-not={{note|warning|error}}: failed:
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp:43:18:
error: CHECK-NOTES: expected string not found in input
# | // CHECK-NOTES: [[@LINE-1]]:3: warning: initializing non-owner 'int *'
with a newly created 'gsl::owner<>'
# | ^
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp.notes:2:303:
note: scanning from here
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:38:3:
warning: returning a newly created resource of type 'int *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# |
^
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp.notes:2:303:
note: with "@LINE-1" equal to "42"
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:38:3:
warning: returning a newly created resource of type 'int *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# |
^
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp.notes:23:165:
note: possible intended match here
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:99:3:
warning: initializing non-owner 'int *' with a newly created 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# |
^
# |
# | Input file:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp.notes
# | Check file:
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | 1: 51 warnings generated.
# | 2:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:38:3:
warning: returning a newly created resource of type 'int *' or 'gsl::owner<>'
from a function whose return type is not 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | check:43'0
X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | check:43'1
with "@LINE-1" equal to "42"
# | 3: 38 | return new int(42);
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 4: | ^~~~~~~~~~~~~~~~~~
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~
# | 5:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:47:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | check:43'0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 6: 47 | gsl::owner<int *> owner = new int(42);
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 7: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 18: 77 | owned_int2 = &stack_int2; // BAD since no owner, bad
since uninitialized
# | check:43'0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 19: | ^~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 20:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:80:3:
warning: expected initialization with value of type 'gsl::owner<>'; got 'int
*' [cppcoreguidelines-owning-memory]
# | check:43'0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 21: 80 | gsl::owner<int *> owned_int3 = new int(42); // Good
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 22: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 23:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:99:3:
warning: initializing non-owner 'int *' with a newly created 'gsl::owner<>'
[cppcoreguidelines-owning-memory]
# | check:43'0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'2
?
possible intended
match
# | 24: 99 | int *unowned_int3 = returns_owner1(); // Bad
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 25: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 26:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp:106:3:
warning: assigning newly created 'gsl::owner<>' to non-owner 'int *'
[cppcoreguidelines-owning-memory]
# | check:43'0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 27: 106 | unowned_int4 = returns_owner1(); // Bad
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 28: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | >>>>>>
# |
# `-----------------------------
# .---command stderr------------
# | Traceback (most recent call last):
# | File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py",
line 413, in <module>
# | main()
# | File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py",
line 409, in main
# | CheckRunner(args, extra_args).run()
# | File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py",
line 313, in run
# | self.check_notes(clang_tidy_output)
# | File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py",
line 292, in check_notes
# | try_run(
# | File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/../test/clang-tidy/check_clang_tidy.py",
line 63, in try_run
# | process_output = subprocess.check_output(args,
stderr=subprocess.STDOUT).decode(
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# | File "/usr/lib/python3.12/subprocess.py", line 466, in check_output
# | return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# | File "/usr/lib/python3.12/subprocess.py", line 571, in run
# | raise CalledProcessError(retcode, process.args,
# | subprocess.CalledProcessError: Command '['FileCheck',
'-input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/checkers/cppcoreguidelines/Output/owning-memory.cpp.tmp.cpp.notes',
'/home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp',
'-check-prefixes=CHECK-NOTES', '-implicit-check-not={{note|warning|error}}:']'
returned non-zero exit status 1.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken
or flaky at HEAD), please open an issue at
https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/175817
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits