title: redefinition of a variable with a different type
body: <p>sorry for the question title but I didn't know a correct title for my problem. I have the following code example:</p>
  
  <pre><code>struct test {
      test(int a) {
      }
  };
  
  int main() {
      test(1);
      return 0;
   }
  </code></pre>
  
  <p>The above example code works. Now i do (in my understanding) the same a bit differently:</p>
  
  <pre><code>struct test {
       test(int a) {
       }
  };
  
  int main() {
      int a = 0;
      test(a);
      return 0;
  }
  </code></pre>
  
  <p>When I compile this I get the following error:</p>
  
  <pre><code>error: redefinition of 'a' with a different type: 'test' vs 'int'
  </code></pre>
  
  <p>But in my opinion it gets really strange when I try this:</p>
  
  <pre><code>struct test {
      test(int a) {
      }
  };
  
  int main() {
      int a = 0;
      test((int)a);
      return 0;
  }
  </code></pre>
  
  <p>the above example works again and really confuses me since I don't see the difference (except casting an int to an int). Can anyone explain what's going on? Thank you in advance.</p>