title: Error: 'xxx' is not a type
body: <p>In this complete code:</p>
  
  <pre class="lang-c++ prettyprint-override"><code>class foo
  {
    public:
      foo(const int pin);
  };
  
  class bar {
    public:
      // Constructor
      bar(const int dataPin) : dataPin_ (dataPin) { }
  
    private:
      const int dataPin_;
      foo myFoo_ (dataPin_);  // instance of foo
  };
  
  int main (void)
    {
    return 0;
    }
  </code></pre>
  
  <p>Using g++ 4.8.4 I get the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>g++ -Wall -c "test.cpp" (in directory: /home/nick/Development)
  test.cpp:14:17: error: ‘dataPin_’ is not a type
       foo myFoo_ (dataPin_);  // instance of foo
                   ^
  Compilation failed.
  </code></pre>
  
  <p>Using clang 3.4-1ubuntu3 I get:</p>
  
  <pre><code>test.cpp:14:17: error: unknown type name 'dataPin_'
      foo myFoo_ (dataPin_);  // instance of foo
                  ^
  1 error generated.
  </code></pre>
  
  <p>Why does it want a type here? This is attempting to create an instance of <code>foo</code> as a class variable of <code>bar</code>. The variable <code>dataPin_</code> is declared directly above.</p>
  
  <hr>
  
  <p>If I change the line with the error to this, it compiles cleanly:</p>
  
  <pre class="lang-c++ prettyprint-override"><code>    foo myFoo_ (int dataPin_);  // instance of foo
  </code></pre>