================
@@ -214,6 +248,27 @@ int *no_dangling_sources_ptr(int *a
[[clang::lifetimebound]], int *b [[clang::li
int *one_dangling_source_ptr(int *a [[clang::lifetimebound]]) {
int x = 1;
int *x_ptr = &x;
- return multi_param_test_ptr(a, x_ptr); // expected-warning {{Returning value
bound to 'x' that will go out of scope}}
+ return multi_param_test_ptr(a, x_ptr);
+ // expected-warning@-1 {{Returning value bound to 'x' that will go out of
scope}}
+ // expected-note@-2 {{Value bound to 'x' here}}
----------------
steakhal wrote:
Have you checked in your console that this highlights the source range of the
expression that you refer to `x`? If not, then you probably miss a `addRange`
call on the report object passing the expression's range.
unfortunately, the `-verify` is only line sensitive and you can not test if it
underlines parts with `~~~~` in the console output.
https://github.com/llvm/llvm-project/pull/207052
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits