title: Expression must have class type
body: <p>I have't coded in c++ for some time and I got stuck when I tried to compile this simple snippet:</p>
  
  <pre><code>class A
  {
    public:
      void f() {}
  };
  
  int main()
  {
    {
      A a;
      a.f(); // works fine
    }
  
    {
      A *a = new A();
      a.f(); // this doesn't
    }
  }
  </code></pre>