title: Why is this not a call of a pure virtual function?
body: <p>I tried to "repair" the example in <a href="https://stackoverflow.com/a/99622/2932052">this answer</a> as to demonstrate how a pure virtual function can be called. </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class A
  {
      int id;
  public:
      A(int i): id(i) {}
      int callFoo() { return foo(); }
      virtual int foo() = 0;
  };
  
  class B: public A
  {
  public:
      B(): A(callFoo()) {}
      int foo() { return 3; }
  };
  
  int main() {
      B b; // &lt;-- this should call a pure virtual function
      cout &lt;&lt; b.callFoo() &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>But I get no runtime error <a href="https://ideone.com/Q3TNky" rel="nofollow noreferrer">here (with C++ 4.9.2)</a>, but the output 3. I tried the same with Borland C++ 5.6.4, but there I'm getting an access violation. I think that <code>foo()</code> should be pure virtual in the call of the constructor of the base class.</p>
  
  <p>Who is wrong? Should I try more compilers? Am I right in my understanding of virtual functions? </p>