title: Multiple instantiation points with different instantiations?
body: <p>I have some code with multiple instantiation points, in which Stroustrup C++ states &quot;A program is illegal if it is possible to construct two different meanings by choosing different points of instantiation. That is, if the bindings of a dependent or a nondependent name can differ, the program is illegal. &quot;.</p>
  <p>Does anyone know why the compiler is not catching this?</p>
  <p>Thanks</p>
  <pre><code>void f(int) {}
  
  namespace N {
      class X { };
      char g(X,int) {return 0;}
  }
  
  template&lt;typename T&gt; char ff(T t, double d)
  {
      f(d); // f is bound to f(int)
      return g(t,d); // g might be bound to g(X,int)
  }
  auto x1 = ff(N::X{},double{1.1});
  
  namespace N {
      char g(X,double) {return 0;}
  }
  
  auto x2 = ff(N::X{},double{2.2});
  
  int main(int argc, char *argv[])
  {
      return 0;
  }
  </code></pre>
  <p>Compilation:</p>
  <pre><code>clang++ -pedantic -Wall -std=c++11 test188.cc &amp;&amp; ./a.out
  
  Compilation finished at Tue Jul 21 18:48:29
  </code></pre>