title: "Typedef redefinition with different types" error in Clang on working MSVC code
body: <p>I've been given some code that compiles fine on MSVC, and I'm trying to get it to compile on Clang in Xcode. I'm currently coming across an issue where a class is being redefined using the following typedef:</p>
  
  <pre><code>typedef std::map&lt;MyNS::istring, EntityState&gt; Entity;
  </code></pre>
  
  <p>Looking at the preprocessed output, I can see that there are two forward declarations of <code>class Entity</code> before this typedef. However, the actual definition of <code>class Entity</code> is not in the preprocessed output, but it is in the same namespace as the new Entity map (not <code>MyNS</code> though...). Is it the forward declarations that are causing this error? And is there some way that this could be valid in MSVC and not working due to the pedantry of Clang?</p>
  
  <p>EDIT: I don't have MSVC to hand, but here's a snippet I put together to demonstrate the kind of error I'm getting (I've simplified the definitions so that it all fits in a small space). This causes the same error as I get when I try to compile it with Clang. Would this work in MSVC?</p>
  
  <pre><code>namespace TheNS {
  
      class Entity;
  
      struct EntityState
      {
          std::string aString, anotherString;
          int anInt;
  
          EntityState() {}
  
          EntityState(std::string a, std::string b, int i)
          {
              // constructor
          }
      };
  
      typedef std::map&lt;std::string, EntityState&gt; Entity;
  
      class Entity
      {
      public:
          void SomeFunction();
  
      private:
          int m_aVar;
  
      };
  
  }    
  </code></pre>