llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-temporal-safety

Author: Utkarsh Saxena (usx95)

<details>
<summary>Changes</summary>



---

Patch is 25.90 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/207345.diff


4 Files Affected:

- (modified) clang/lib/Sema/SemaLifetimeSafety.h (+2-2) 
- (modified) clang/test/Sema/LifetimeSafety/annotation-suggestions-fixits.cpp 
(+18-18) 
- (modified) 
clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-cross-tu.cpp (+9-9) 
- (modified) 
clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-intra-tu.cpp (+29-29) 


``````````diff
diff --git a/clang/lib/Sema/SemaLifetimeSafety.h 
b/clang/lib/Sema/SemaLifetimeSafety.h
index 3b9ea9eafbec5..48edf5f3f070f 100644
--- a/clang/lib/Sema/SemaLifetimeSafety.h
+++ b/clang/lib/Sema/SemaLifetimeSafety.h
@@ -296,7 +296,7 @@ class LifetimeSafetySemaHelperImpl : public 
LifetimeSafetySemaHelper {
 
     auto [InsertionPoint, FixItText] = getLifetimeBoundFixIt(ParmToAnnotate);
 
-    S.Diag(ParmToAnnotate->getBeginLoc(), DiagID)
+    S.Diag(InsertionPoint, DiagID)
         << ParmToAnnotate->getSourceRange()
         << FixItHint::CreateInsertion(InsertionPoint, FixItText);
 
@@ -376,7 +376,7 @@ class LifetimeSafetySemaHelperImpl : public 
LifetimeSafetySemaHelper {
     if (IsMacro || InsertionPoint.isInvalid())
       S.Diag(PVDDecl->getBeginLoc(), DiagID) << PVDDecl->getSourceRange();
     else
-      S.Diag(PVDDecl->getBeginLoc(), DiagID)
+      S.Diag(InsertionPoint, DiagID)
           << PVDDecl->getSourceRange()
           << FixItHint::CreateInsertion(InsertionPoint, FixItText);
 
diff --git a/clang/test/Sema/LifetimeSafety/annotation-suggestions-fixits.cpp 
b/clang/test/Sema/LifetimeSafety/annotation-suggestions-fixits.cpp
index e2fb9dd5df40a..dde1c8f7e2431 100644
--- a/clang/test/Sema/LifetimeSafety/annotation-suggestions-fixits.cpp
+++ b/clang/test/Sema/LifetimeSafety/annotation-suggestions-fixits.cpp
@@ -42,9 +42,9 @@ struct [[gsl::Pointer()]] View {
 };
 
 View return_view(View a) {
-  // CHECK: :[[@LINE-1]]:18: warning: parameter in intra-TU function should be 
marked {{\[\[}}clang::lifetimebound]] [-Wlifetime-safety-intra-tu-suggestions]
+  // CHECK: :[[@LINE-1]]:24: warning: parameter in intra-TU function should be 
marked {{\[\[}}clang::lifetimebound]] [-Wlifetime-safety-intra-tu-suggestions]
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:24-[[@LINE-2]]:24}:" 
{{\[\[}}clang::lifetimebound]]"
-  // CHECK-MACRO: :[[@LINE-3]]:18: warning: parameter in intra-TU function 
should be marked
+  // CHECK-MACRO: :[[@LINE-3]]:24: warning: parameter in intra-TU function 
should be marked
   // CHECK-MACRO: fix-it:"{{.*}}":{[[@LINE-4]]:24-[[@LINE-4]]:24}:" 
LIFETIMEBOUND_MACRO"
   // CHECK-BAD-MACRO: :[[@LINE-5]]:25: error: expected ')'
   // CHECK-BAD-MACRO: BAD_LIFETIMEBOUND_MACRO
@@ -52,9 +52,9 @@ View return_view(View a) {
 }
 
 MyObj &return_multi(MyObj &a, bool c, MyObj &b) {
-  // CHECK-DAG: :[[@LINE-1]]:21: warning: parameter in intra-TU function 
should be marked
+  // CHECK-DAG: :[[@LINE-1]]:29: warning: parameter in intra-TU function 
should be marked
   // CHECK-DAG: fix-it:"{{.*}}":{[[@LINE-2]]:29-[[@LINE-2]]:29}:" 
{{\[\[}}clang::lifetimebound]]"
-  // CHECK-DAG: :[[@LINE-3]]:39: warning: parameter in intra-TU function 
should be marked
+  // CHECK-DAG: :[[@LINE-3]]:47: warning: parameter in intra-TU function 
should be marked
   // CHECK-DAG: fix-it:"{{.*}}":{[[@LINE-4]]:47-[[@LINE-4]]:47}:" 
{{\[\[}}clang::lifetimebound]]"
   if (c)
     return a;
@@ -62,7 +62,7 @@ MyObj &return_multi(MyObj &a, bool c, MyObj &b) {
 }
 
 View return_partial(View a [[clang::lifetimebound]], bool c, View b) {
-  // CHECK: :[[@LINE-1]]:62: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:68: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:68-[[@LINE-2]]:68}:" 
{{\[\[}}clang::lifetimebound]]"
   if (c)
     return a;
@@ -70,25 +70,25 @@ View return_partial(View a [[clang::lifetimebound]], bool 
c, View b) {
 }
 
 View param_with_attr(View a [[maybe_unused]]) {
-  // CHECK: :[[@LINE-1]]:22: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:28: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:28-[[@LINE-2]]:28}:" 
{{\[\[}}clang::lifetimebound]]"
   return a;
 }
 
 View param_default(View a = View()) {
-  // CHECK: :[[@LINE-1]]:20: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:26: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:26-[[@LINE-2]]:26}:" 
{{\[\[}}clang::lifetimebound]]"
   return a;
 }
 
 int *arr_default(int a[2] = nullptr) {
-  // CHECK: :[[@LINE-1]]:18: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:23: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:23-[[@LINE-2]]:23}:" 
{{\[\[}}clang::lifetimebound]]"
   return a;
 }
 
 View multi_decl(View a);
-// CHECK: :[[@LINE-1]]:17: warning: parameter in intra-TU function should be 
marked
+// CHECK: :[[@LINE-1]]:23: warning: parameter in intra-TU function should be 
marked
 // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:23-[[@LINE-2]]:23}:" 
{{\[\[}}clang::lifetimebound]]"
 View multi_decl(View a);
 View multi_decl(View a) {
@@ -97,7 +97,7 @@ View multi_decl(View a) {
 
 template <typename T>
 T *template_identity(T *a) {
-  // CHECK: :[[@LINE-1]]:22: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:26: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:26-[[@LINE-2]]:26}:" 
{{\[\[}}clang::lifetimebound]]"
   return a;
 }
@@ -197,7 +197,7 @@ struct TrailingReturn {
 #define GNU_LIFETIMEBOUND_MACRO __attribute__((lifetimebound))
 
 View return_view_with_gnu_macro(View a) {
-  // CHECK: :[[@LINE-1]]:33: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:39: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:39-[[@LINE-2]]:39}:" 
GNU_LIFETIMEBOUND_MACRO"
   return a;
 }
@@ -223,7 +223,7 @@ View unnamed_macro(View a) {
 }
 
 View return_view_with_macro(View a) {
-  // CHECK: :[[@LINE-1]]:29: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:35: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:35-[[@LINE-2]]:35}:" 
MY_LIFETIMEBOUND_MACRO"
   return a;
 }
@@ -232,9 +232,9 @@ View return_view_with_macro(View a) {
 #define SECOND_LIFETIMEBOUND_MACRO [[clang::lifetimebound]]
 
 View return_view_with_latest_macro(View a) {
-  // CHECK: :[[@LINE-1]]:36: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:42: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:42-[[@LINE-2]]:42}:" 
SECOND_LIFETIMEBOUND_MACRO"
-  // CHECK-MACRO: :[[@LINE-3]]:36: warning: parameter in intra-TU function 
should be marked
+  // CHECK-MACRO: :[[@LINE-3]]:42: warning: parameter in intra-TU function 
should be marked
   // CHECK-MACRO: fix-it:"{{.*}}":{[[@LINE-4]]:42-[[@LINE-4]]:42}:" 
LIFETIMEBOUND_MACRO"
   return a;
 }
@@ -242,7 +242,7 @@ View return_view_with_latest_macro(View a) {
 #define REDEFINED_LIFETIMEBOUND_MACRO [[clang::lifetimebound]]
 
 View return_view_with_redefined_macro(View a) {
-  // CHECK: :[[@LINE-1]]:39: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:45: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:45-[[@LINE-2]]:45}:" 
REDEFINED_LIFETIMEBOUND_MACRO"
   return a;
 }
@@ -251,7 +251,7 @@ View return_view_with_redefined_macro(View a) {
 #define REDEFINED_LIFETIMEBOUND_MACRO [[maybe_unused]]
 
 View return_view_after_redefined_macro(View a) {
-  // CHECK: :[[@LINE-1]]:40: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:46: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:46-[[@LINE-2]]:46}:" 
SECOND_LIFETIMEBOUND_MACRO"
   return a;
 }
@@ -259,7 +259,7 @@ View return_view_after_redefined_macro(View a) {
 #define UNDEFINED_LIFETIMEBOUND_MACRO [[clang::lifetimebound]]
 
 View return_view_with_undefined_macro(View a) {
-  // CHECK: :[[@LINE-1]]:39: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:45: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:45-[[@LINE-2]]:45}:" 
UNDEFINED_LIFETIMEBOUND_MACRO"
   return a;
 }
@@ -267,7 +267,7 @@ View return_view_with_undefined_macro(View a) {
 #undef UNDEFINED_LIFETIMEBOUND_MACRO
 
 View return_view_after_undefined_macro(View a) {
-  // CHECK: :[[@LINE-1]]:40: warning: parameter in intra-TU function should be 
marked
+  // CHECK: :[[@LINE-1]]:46: warning: parameter in intra-TU function should be 
marked
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:46-[[@LINE-2]]:46}:" 
SECOND_LIFETIMEBOUND_MACRO"
   return a;
 }
diff --git 
a/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-cross-tu.cpp 
b/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-cross-tu.cpp
index cade7c7a81105..1ccdb5253bf0c 100644
--- a/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-cross-tu.cpp
+++ b/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-cross-tu.cpp
@@ -10,9 +10,9 @@ struct HeaderObj {
   ~HeaderObj() {}
 };
 
-HeaderObj &header_param(HeaderObj &  // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers in other translation 
units; add it to the declaration instead}}
-                                     // CHECK: 
cross.h:[[#PARAM_WARN_LINE:]]:{{[0-9]+}}: warning: 'lifetimebound' attribute on 
this definition is not visible
-                        obj          // CHECK: 
fix-it:"{{.*}}cross.h":{[[#PARAM_WARN_LINE+2]]:{{[0-9]+}}-[[#PARAM_WARN_LINE+2]]:{{[0-9]+}}}:"
 {{\[\[}}clang::lifetimebound{{\]\]}}"
+HeaderObj &header_param(HeaderObj &  obj  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers in 
other translation units; add it to the declaration instead}}
+                                          // CHECK: 
cross.h:[[#PARAM_WARN_LINE:]]:{{[0-9]+}}: warning: 'lifetimebound' attribute on 
this definition is not visible
+                                          // CHECK: 
fix-it:"{{.*}}cross.h":{[[#PARAM_WARN_LINE]]:{{[0-9]+}}-[[#PARAM_WARN_LINE]]:{{[0-9]+}}}:"
 {{\[\[}}clang::lifetimebound{{\]\]}}"
                         );
 
 struct HeaderS {
@@ -25,16 +25,16 @@ struct HeaderS {
 
 //--- cross_1.h
 struct HeaderObj;
-HeaderObj &multi_header_param(HeaderObj &  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers in 
other translation units; add it to the declaration instead}}
-                                           // CHECK: 
cross_1.h:[[#PARAM_WARN_LINE:]]:{{[0-9]+}}: warning: 'lifetimebound' attribute 
on this definition is not visible
-                              obj          // CHECK: 
fix-it:"{{.*}}cross_1.h":{[[#PARAM_WARN_LINE+2]]:{{[0-9]+}}-[[#PARAM_WARN_LINE+2]]:{{[0-9]+}}}:"
 {{\[\[}}clang::lifetimebound{{\]\]}}"
+HeaderObj &multi_header_param(HeaderObj &  obj  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers in 
other translation units; add it to the declaration instead}}
+                                                // CHECK: 
cross_1.h:[[#PARAM_WARN_LINE:]]:{{[0-9]+}}: warning: 'lifetimebound' attribute 
on this definition is not visible
+                                                // CHECK: 
fix-it:"{{.*}}cross_1.h":{[[#PARAM_WARN_LINE]]:{{[0-9]+}}-[[#PARAM_WARN_LINE]]:{{[0-9]+}}}:"
 {{\[\[}}clang::lifetimebound{{\]\]}}"
                               );
 
 //--- cross_2.h
 struct HeaderObj;
-HeaderObj &multi_header_param(HeaderObj &  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers in 
other translation units; add it to the declaration instead}}
-                                           // CHECK: 
cross_2.h:[[#PARAM_WARN_LINE:]]:{{[0-9]+}}: warning: 'lifetimebound' attribute 
on this definition is not visible
-                              obj          // CHECK: 
fix-it:"{{.*}}cross_2.h":{[[#PARAM_WARN_LINE+2]]:{{[0-9]+}}-[[#PARAM_WARN_LINE+2]]:{{[0-9]+}}}:"
 {{\[\[}}clang::lifetimebound{{\]\]}}"
+HeaderObj &multi_header_param(HeaderObj &  obj  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers in 
other translation units; add it to the declaration instead}}
+                                                // CHECK: 
cross_2.h:[[#PARAM_WARN_LINE:]]:{{[0-9]+}}: warning: 'lifetimebound' attribute 
on this definition is not visible
+                                                // CHECK: 
fix-it:"{{.*}}cross_2.h":{[[#PARAM_WARN_LINE]]:{{[0-9]+}}-[[#PARAM_WARN_LINE]]:{{[0-9]+}}}:"
 {{\[\[}}clang::lifetimebound{{\]\]}}"
                               );
 
 //--- cross.cpp
diff --git 
a/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-intra-tu.cpp 
b/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-intra-tu.cpp
index 25f5b6e94c28c..28dd65211b268 100644
--- a/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-intra-tu.cpp
+++ b/clang/test/Sema/LifetimeSafety/misplaced-lifetimebound-intra-tu.cpp
@@ -10,16 +10,16 @@ struct MyObj {
   ~MyObj() {}
 };
 
-MyObj &free_param(MyObj &  // expected-warning {{'lifetimebound' attribute on 
this definition is not visible to callers before the definition; add it to the 
declaration instead}}
-                  obj      // CHECK: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+MyObj &free_param(MyObj & obj // expected-warning {{'lifetimebound' attribute 
on this definition is not visible to callers before the definition; add it to 
the declaration instead}}
+                              // CHECK: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
                   );
 
 MyObj &free_param(MyObj &obj [[clang::lifetimebound]]) { // expected-note 
{{'lifetimebound' attribute appears here on the definition}}
   return obj;
 }
 
-MyObj &earliest_redecl_param(MyObj & // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
-                             obj     // CHECK: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+MyObj &earliest_redecl_param(MyObj & obj  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers before 
the definition; add it to the declaration instead}}
+                                          // CHECK: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
                              );
 MyObj &earliest_redecl_param(MyObj &obj);
 MyObj &earliest_redecl_param(MyObj &obj [[clang::lifetimebound]]) { // 
expected-note {{'lifetimebound' attribute appears here on the definition}}
@@ -32,12 +32,12 @@ struct S {
                                   );  // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
                                       // CHECK: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
 
-  const MyObj &param_only(const MyObj & // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
-                          obj           // CHECK: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+  const MyObj &param_only(const MyObj & obj // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers before 
the definition; add it to the declaration instead}}
+                                            // CHECK: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
                           );
 
-  const MyObj &both(const MyObj &  // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
-                    obj,           // CHECK-DAG: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+  const MyObj &both(const MyObj & obj,  // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
+                                        // CHECK-DAG: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
                     bool
                     );             // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
                                    // CHECK-DAG: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
@@ -61,8 +61,8 @@ const MyObj &S::both(
 template <class T>
 struct MixedSpecializations {
   T data;
-  T &both(T &   // expected-warning {{'lifetimebound' attribute on this 
definition is not visible to callers before the definition; add it to the 
declaration instead}}
-          arg,  // CHECK-DAG: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+  T &both(T& arg, // expected-warning {{'lifetimebound' attribute on this 
definition is not visible to callers before the definition; add it to the 
declaration instead}}
+                  // CHECK-DAG: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
           bool
           );    // expected-warning {{'lifetimebound' attribute on this 
definition is not visible to callers before the definition; add it to the 
declaration instead}}
                 // CHECK-DAG: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
@@ -80,8 +80,8 @@ struct InternalObj {
 };
 
 namespace {
-InternalObj &anon_param(InternalObj &  // expected-warning {{'lifetimebound' 
attribute on this definition is not visible to callers before the definition; 
add it to the declaration instead}}
-                        obj            // CHECK: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+InternalObj &anon_param(InternalObj & obj // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers before 
the definition; add it to the declaration instead}}
+                                          // CHECK: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
                         );
 
 InternalObj &anon_param(InternalObj &obj [[clang::lifetimebound]]) { // 
expected-note {{'lifetimebound' attribute appears here on the definition}}
@@ -100,8 +100,8 @@ InternalObj &AnonS::anon_this() [[clang::lifetimebound]] { 
// expected-note {{'l
 }
 } // namespace
 
-static InternalObj &static_param(InternalObj &  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers before 
the definition; add it to the declaration instead}}
-                                 obj  // CHECK: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+static InternalObj &static_param(InternalObj & obj // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers before 
the definition; add it to the declaration instead}}
+                                                   // CHECK: 
fix-it:"{{.*}}":{[[@LINE-1]]:{{[0-9]+}}-[[@LINE-1]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
                                  );
 
 static InternalObj &static_param(InternalObj &obj [[clang::lifetimebound]]) { 
// expected-note {{'lifetimebound' attribute appears here on the definition}}
@@ -112,8 +112,8 @@ struct IntraSuppressedObj {
   ~IntraSuppressedObj() {}
 };
 
-IntraSuppressedObj &intra_suppressed(IntraSuppressedObj &  // expected-warning 
{{'lifetimebound' attribute on this definition is not visible to callers before 
the definition; add it to the declaration instead}}
-                                     obj  // CHECK: 
fix-it:"{{.*}}":{[[@LINE]]:{{[0-9]+}}-[[@LINE]]:{{[0-9]+}}}:" 
{{\[\[clang::lifetimebound\]\]}}"
+IntraSuppressedObj &intra_suppressed(IntraSuppressedObj &obj  // 
expected-warning {{'lifetimebound' attribute on this definition is not visible 
to callers before the definition; add it to the declaration instead}}
+                                                              // CHECK: 
fix-it:"{{.*}}":{[[@LINE-...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/207345
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to