[clang] [clang] Fix incorrect inferred lifetime_capture_by attr on STL (PR #118013)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 28 18:53:43 PST 2024
================
@@ -37,67 +37,56 @@ struct vector {
struct [[gsl::Pointer()]] View {};
std::vector<View> views;
// CHECK: ClassTemplateSpecializationDecl {{.*}} struct vector definition implicit_instantiation
-// CHECK: TemplateArgument type 'View'
-// CHECK-NOT: LifetimeCaptureByAttr
// CHECK: CXXMethodDecl {{.*}} push_back 'void (const View &)'
-// CHECK: ParmVarDecl {{.*}} 'const View &'
-// CHECK: LifetimeCaptureByAttr {{.*}} Implicit
-// CHECK-NOT: LifetimeCaptureByAttr
+// CHECK-NEXT: ParmVarDecl {{.*}} 'const View &'
+// CHECK-NEXT: LifetimeCaptureByAttr {{.*}} Implicit
// CHECK: CXXMethodDecl {{.*}} push_back 'void (View &&)'
-// CHECK: ParmVarDecl {{.*}} 'View &&'
-// CHECK: LifetimeCaptureByAttr {{.*}} Implicit
+// CHECK-NEXT: ParmVarDecl {{.*}} 'View &&'
+// CHECK-NEXT: LifetimeCaptureByAttr {{.*}} Implicit
// CHECK: CXXMethodDecl {{.*}} insert 'void (iterator, View &&)'
-// CHECK: ParmVarDecl {{.*}} 'iterator'
-// CHECK: LifetimeCaptureByAttr {{.*}} Implicit
-// CHECK: ParmVarDecl {{.*}} 'View &&'
-// CHECK: LifetimeCaptureByAttr {{.*}} Implicit
-// CHECK-NOT: LifetimeCaptureByAttr
+// CHECK-NEXT: ParmVarDecl {{.*}} 'iterator'
+// CHECK-NOT: LifetimeCaptureByAttr {{.*}} Implicit
----------------
usx95 wrote:
maybe skip this line if CHECK-NEXT is possible.
same in line 70, 87
https://github.com/llvm/llvm-project/pull/118013
More information about the cfe-commits
mailing list