@@ -816,30 +816,30 @@ struct X {
816
816
// /////////////////////////
817
817
// Detect dangling cases.
818
818
// /////////////////////////
819
- void captureInt (const int & i [[clang::lifetime_capture_by(x)]], X& x);
820
- void captureRValInt (int && i [[clang::lifetime_capture_by(x)]], X& x);
821
- void noCaptureInt (int i [[clang::lifetime_capture_by(x)]], X& x);
819
+ void captureInt (const int & i [[clang::lifetime_capture_by(x)]], X & x);
820
+ void captureRValInt (int && i [[clang::lifetime_capture_by(x)]], X & x);
821
+ void noCaptureInt (int i [[clang::lifetime_capture_by(x)]], X & x);
822
822
823
823
std::string_view substr (const std::string& s [[clang::lifetimebound]]);
824
824
std::string_view strcopy (const std::string& s);
825
825
826
- void captureSV (std::string_view s [[clang::lifetime_capture_by(x)]], X& x);
827
- void captureRValSV (std::string_view&& sv [[clang::lifetime_capture_by(x)]], X& x);
828
- void noCaptureSV (std::string_view sv, X& x);
829
- void captureS (const std::string& s [[clang::lifetime_capture_by(x)]], X& x);
830
- void captureRValS (std::string&& s [[clang::lifetime_capture_by(x)]], X& x);
826
+ void captureSV (std::string_view s [[clang::lifetime_capture_by(x)]], X & x);
827
+ void captureRValSV (std::string_view && sv [[clang::lifetime_capture_by(x)]], X & x);
828
+ void noCaptureSV (std::string_view sv, X & x);
829
+ void captureS (const std::string & s [[clang::lifetime_capture_by(x)]], X & x);
830
+ void captureRValS (std::string && s [[clang::lifetime_capture_by(x)]], X & x);
831
831
832
- const std::string& getLB (const std::string& s [[clang::lifetimebound]]);
833
- const std::string& getLB (std::string_view sv[[clang::lifetimebound]]);
834
- const std::string* getPointerLB (const std::string& s [[clang::lifetimebound]]);
835
- const std::string* getPointerNoLB (const std::string& s);
832
+ const std::string& getLB (const std::string &s [[clang::lifetimebound]]);
833
+ const std::string& getLB (std::string_view sv [[clang::lifetimebound]]);
834
+ const std::string* getPointerLB (const std::string &s [[clang::lifetimebound]]);
835
+ const std::string* getPointerNoLB (const std::string & s);
836
836
837
- void capturePointer (const std::string* sp [[clang::lifetime_capture_by(x)]], X& x);
837
+ void capturePointer (const std::string* sp [[clang::lifetime_capture_by(x)]], X & x);
838
838
839
839
struct ThisIsCaptured {
840
- void capture (X& x) [[clang::lifetime_capture_by(x)]];
841
- void bar (X& x) [[clang::lifetime_capture_by(abcd)]]; // expected-error {{'lifetime_capture_by' attribute argument 'abcd' is not a known function parameter}}
842
- void baz (X& x) [[clang::lifetime_capture_by(this )]]; // expected-error {{'lifetime_capture_by' argument references itself}}
840
+ void capture (X & x) [[clang::lifetime_capture_by(x)]];
841
+ void bar (X & x) [[clang::lifetime_capture_by(abcd)]]; // expected-error {{'lifetime_capture_by' attribute argument 'abcd' is not a known function parameter}}
842
+ void baz (X & x) [[clang::lifetime_capture_by(this )]]; // expected-error {{'lifetime_capture_by' argument references itself}}
843
843
};
844
844
845
845
void captureByGlobal (std::string_view s [[clang::lifetime_capture_by(global)]]);
0 commit comments