Porting to Solaris SPARC using Sun Studio 12
<p>I am trying to compile an object file using the code below.</p>

<pre><code>//--Begin test.cpp
class A;

void (A::* f_ptr) ();

void test() {
    A *a;
    (a-&gt;*f_ptr)();
}
//-- End test.cpp
</code></pre>

<p>For GNU g++ compiler, it is able to compile the object file.</p>

<p><code>$ g++ -c test.cpp</code></p>

<p>But for Sun Studio 12 on a Solaris 10 (SPARC), it outputs an error.</p>

<p><code>$ CC -c test.cpp</code></p>

<blockquote>
  <p>"test.cpp", line 7: Error: Cannot call through pointer to member function before defining class A.</p>
  
  <p>1 Error(s) detected.</p>
</blockquote>

<p>Is there a compiler flags to get the Sun Studio C++ compiler to build
the object file?  Is there another workaround?</p>
