AaronBallman wrote:

> I don't think there's an easy migration path for this, the only thing I can 
> come up with is adding a new macro specifically for global/this/unknown 
> (though maybe there's some C macro magic that I am not aware about). E.g. a 
> separate macro for the `this` case that prefers the new spelling:
> 
> ```c++
> #if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetime_capture_by_this)
>  #define ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY_THIS \
>    [[clang::lifetime_capture_by_this]]
> #elif ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetime_capture_by)
>  #define ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY_THIS \
>    ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(this)
> #else
>  #define ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY_THIS
> #endif
> ```

FWIW, that is the migration path I was expecting folks to take (you check for 
the newer form and prefer it, otherwise you fall back on the older form); 
that's pretty idiomatic for deprecated or modified attributes.

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

Reply via email to