title: Function definitions missing from intellisense in Visual Studio C++ 2005-2013
body: <p>The following problem plagues one of my projects for a long time:</p>
  
  <p><strong>Some function definitions (from .cpp files) are excluded/hidden from intellisense!</strong></p>
  
  <p>It is not possible to "<strong>Goto Definition</strong>" for those functions, nor are the listed in the <strong>Navigation Bar</strong>. </p>
  
  <p>The functions do appear in the autocompletion list, though. The problem is for .cpp files only, the .h files are parsed fine. 'Goto Declaration' works, too.</p>
  
  <p>This is the same since 2005, with every new version, I was hoping for a fix, but it does not seem to be regognized as a bug by anyone else.</p>
  
  <p><strong>UPDATE:</strong>
  I have tracked this down to the following: All functions containing a certain macro are not recognized by intellisense. The original macro was</p>
  
  <pre><code>#define forlist(x,list) for( auto x= list.begin(); x.valid(); ++x)
  </code></pre>
  
  <p>but you can also use the simplified test case</p>
  
  <pre><code>#define fortest(x)  for( auto x= 1; x&lt; 2; ++x)
  
  void myclass::TestFN()
  {
      fortest( g )
      {
          g;
      }
  }
  </code></pre>
  
  <p>Next step would be to find a workaround (or try to go through micrsoft bug reporting).</p>
  
  <p>Please don't rant too much about this macro. This is existing code of a list implementation which I am not able to change. I could just NOT use the macro, but I still think this is a VS bug.</p>
  
  <p>One funny thing is, that the following (really <em>*</em>**ic macro) works fine:</p>
  
  <pre><code>#define fortest(x)  for( auto x= 1; x&lt; 2; ++x) {
  
  void myclass::TestFN()
  {
      fortest( g )
          g;
      }
  }
  </code></pre>
  
  <p>Could it be that intellisense treats case 1 as an illegal local function definition? 
  (see <a href="http://connect.microsoft.com/VisualStudio/feedback/details/781121/c-intellisense-mistakes-loop-expression-for-function-definition">http://connect.microsoft.com/VisualStudio/feedback/details/781121/c-intellisense-mistakes-loop-expression-for-function-definition</a>)</p>
  
  <p>The following work fine, too</p>
  
  <pre><code>#define fortest(x)  for( auto x= 1; x&lt; 2; ++x)
  
  void myclass::TestFN()
  {
      fortest( g )
          g;
  }
  </code></pre>