================
@@ -8612,7 +8612,11 @@ static void HandleLifetimeBoundAttr(TypeProcessingState 
&State,
     CurType = State.getAttributedType(
         createSimpleAttr<LifetimeBoundAttr>(State.getSema().Context, Attr),
         CurType, CurType);
+    return;
   }
+  State.getSema().Diag(Attr.getLoc(), diag::err_attribute_wrong_decl_type_str)
+      << Attr << Attr.isRegularKeywordAttribute()
+      << "parameters and implicit object parameters";
----------------
hokein wrote:

lifetime_capture_by is a similar attribute, we should apply the same check for 
it (on Line 8629), but it can be addressed in a follow-up patch.

https://github.com/llvm/llvm-project/pull/118281
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to