Open
Description
We just ran into a bug where we have a gsl::Owner type which holds two values. We found that the -Wdangling-gsl
warning correctly detects unsafe conversions such as string
-> string_view
, but only for the type which is listed first in the template arguments.
Simplified example: https://godbolt.org/z/Y56eWv74Y
Walking through the code, it seems that this is because this line only checks the first template argument, rather than all of them. Is there a reason why? Intuitively, it seems that we should be checking if any of the types are pointer-like. Does that introduce false positives?