This patch extends the warnings for additional cases: when we call some well-known methods on a temporary object.
This is using a hard coded list of those well-known functions. Later revisions might replace string matching with checking function annotations from the lifetime papers. There are two reasons to hard code the list this way for now:
- The spelling and semantics of function annotations might change in the near future after incorporating some implementation related experience so we are not rushing adding those annotations to clang just yet (as opposed to class annotations which are considered quite stable now.)
- Checking for those well known functions is a huge usability boost for the check.