================
@@ -11,13 +12,28 @@ void captureInt(const int &i
[[clang::lifetime_capture_by(x)]], X &x);
void captureRValInt(int &&i [[clang::lifetime_capture_by(x)]], X &x);
void noCaptureInt(int i [[clang::lifetime_capture_by(x)]], X &x);
-void use() {
- int local;
- captureInt(1, // expected-warning {{object whose reference is captured by
'x' will be destroyed at the end of the full-expression}}
- x);
+void temporary_int_capture() {
+ captureInt(1,x); // expected-warning {{object whose reference is captured by
'x' will be destroyed at the end of the full-expression}}
+ // cfg-warning@-1 {{temporary object does not live long
enough}}
+ // cfg-note@-2 {{destroyed here}}
----------------
kashika0112 wrote:
Done, I have used `\` instead of offsets throughout the test file.
https://github.com/llvm/llvm-project/pull/204361
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits