You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -475,6 +475,17 @@ namespace PR59389 {
475
475
};
476
476
}
477
477
478
+
voidtestLambdaInLambdaWithDoubleReturns() {
479
+
constauto MakeS = []() -> S* {
480
+
constauto MakeS2 = []() -> S* {
481
+
return ::gsl::owner<S*>{newS(1)};
482
+
// CHECK-NOTES: [[@LINE-1]]: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
+
};
484
+
return ::gsl::owner<S*>{newS(2)};
485
+
// CHECK-NOTES: [[@LINE-1]]:7: warning: returning a newly created resource of type 'S *' or 'gsl::owner<>' from a lambda whose return type is not 'gsl::owner<>'
486
+
};
487
+
}
488
+
478
489
voidtestReverseLambdaInLambdaNegative() {
479
490
constauto MakeI = []() -> int {
480
491
constauto MakeS = []() -> ::gsl::owner<S*> { returnnewS(); };
0 commit comments