Issue 180933
Summary [LifetimeSafety] Suggest annotation when doing pointer arithmetic
Labels clang:temporal-safety
Assignees
Reporter emaxx-google
    ```c++
class Str {
 public:
  const char* begin() const [[clang::lifetimebound]] {  // <-- this is suggested by Clang if missing
    return inner_.c_str();
  }
 const char* end() const {  // <-- missing the suggestion here
    return begin() + inner_.size();
  }

 private:
  std::string inner_ = "foo";
};
```

Expected: an error like `error: implicit this ... should be marked` for the `end()` method when `-flifetime-safety-inference` is used.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to