title: Why type const double is not captured by lambda from reaching-scope, but const int is?
body: <p>I seem can't understand why the following code with type const int compiles:</p>
  
  <pre><code>int main()
  {
    using T = int;
    const T x = 1;
    auto lam = [] (T p) { return x+p; };
  }
  $ clang++ -c lambda1.cpp  -std=c++11
  $
  </code></pre>
  
  <p>while this one with type const double doesn't:</p>
  
  <pre><code>int main()
  {
    using T = double;
    const T x = 1.0;
    auto lam = [] (T p) { return x+p; };
  }
  $ clang++ -c lambda2.cpp  -std=c++11
  lambda1.cpp:5:32: error: variable 'x' cannot be implicitly captured in a lambda with no capture-default specified
    auto lam = [] (T p) { return x+p; };
                                 ^
  lambda1.cpp:4:11: note: 'x' declared here
    const T x = 1.0;
            ^
  lambda1.cpp:5:14: note: lambda expression begins here
    auto lam = [] (T p) { return x+p; };
               ^
  1 error generated.
  </code></pre>
  
  <p>yet compiles with constexpr double:</p>
  
  <pre><code>int main()
  {
    using T = double;
    constexpr T x = 1.0;
    auto lam = [] (T p) { return x+p; };
  }
  $ clang++ -c lambda3.cpp  -std=c++11
  $
  </code></pre>
  
  <p>Why behaviour for int differs from double, or for any other type than int, i.e. int is accepted with const qualifier, yet double/other types must be constexpr? Also, why this code compiles with C++11, my understanding from [1] is that such implicit captures is C++14 feature.</p>
  
  <p>.. [1] <a href="https://stackoverflow.com/questions/33849718/how-is-this-lambda-with-an-empty-capture-list-able-to-refer-to-reaching-scope-na">how is this lambda with an empty capture list able to refer to reaching-scope name?</a></p>