title: Scope issue: which variable would a inline function access in the following code ?
body: <p>Suppose we have the following c++ code:</p>
  
  <pre><code>int a = 10;
  
  inline int add(int x){return a+x;}
  
  void foo(int a, int b)
  {
       ... do something with a ...
       std::cout&lt;&lt;add(b);
  }
  
  int main()
  {
       foo(12);
  }
  </code></pre>
  
  <p>For inline function add, the "a" variable it uses is the global variable "a". But, in function call for foo(), we have another local variable "a".
  If add is not an inline function, it would definately use the global "a", but what would happen in the above code? Is there any rule for it?</p>