https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111087

--- Comment #7 from Adam Badura <adam.f.badura at gmail dot com> ---
So, the cases I described here _is_ a false-positive, however, an expected one.
Do I understand this correctly?

However, consider the code:

  class class1
  {
  public:
    bool method1() const;
  };

  bool foo()
  {
    const class1* a = nullptr;
    return a != nullptr && a->method1();
  }

See it also on Compiler Explorer: https://godbolt.org/z/7GKT98Y5b.

It _does not_ generate the warning. So, what prevents generating the warning
here? How do I formulate the code to avoid the warning?

Reply via email to