title: Is it legal to (accidentally) specify a classname twice when calling a static function?
body: <p>My collegue just ran our codebase through a new compiler for a new platform, and unsurprisingly there were errors that had not been reported before.</p>
  
  <p>One of them concerned code where the original author had accidentally typed a class name twice when calling a static function of that class.  The looked like this:</p>
  
  <pre><code>class Thing
  {
  public:
      static void DoStuff ();
  };
  
  int main (int, char **)
  {
      Thing::Thing::DoStuff();
      // or even: Thing::Thing::Thing::Thing::Thing::Thing::DoStuff();
      return 0;
  }
  </code></pre>
  
  <p>GCC 4.9.2 on my local (Cygwin) machine compiles it fine, even with <code>-Wall -Wextra -Wpedantic</code>.  A customized Clang that we're using for an embedded system also accepts it.  Visual Studio 2012 (v110) gives me the error:</p>
  
  <pre><code>error C3083: '{ctor}': the symbol to the left of a '::' must be a type
  </code></pre>
  
  <p>I can imagine equally convincing arguments for:</p>
  
  <ol>
  <li>It's legal and the compiler accepts it. (<em>i.e.</em> GCC and Clang are correct, VS is wrong)</li>
  <li>It's not legal, but the compiler may accept it anyway.</li>
  <li>It's legal but the compiler doesn't accept it. (<em>i.e.</em> VS is wrong; maybe it's a new C++11 thing that hasn't been added yet?)</li>
  <li>It's not legal and the compiler shouldn't accept it. (<em>i.e.</em> Visual Studio is the only correct one)</li>
  <li>Just fix the error and get on with my life.</li>
  </ol>
  
  <p>Which one is correct?</p>