title: Can `this` be changed in a mutable lambda?
body: <p>Everyone knows that <code>this</code> object pointer in C++ cannot be changed in its methods. But what comes to mutable lambdas, where <code>this</code> is captured, some current compilers give such possibility. Consider this code:</p>
  <pre><code>struct A {
      void foo() {
          //this = nullptr; //error everywhere
  
          (void) [p = this]() mutable { 
              p = nullptr; //#1: ok everywhere
              (void)p;
          };
  
          (void) [this]() mutable { 
              this = nullptr; //#2: ok in MSVC only
          };
      }
  };
  
  </code></pre>
  <p>In the first lambda <code>this</code> is captured and given a new name <code>p</code>. Here all compilers permit to change the value of <code>p</code>. In the second lambda <code>this</code> is captured by its own name, and only MSVC allows the programmer to change its value. Demo: <a href="https://gcc.godbolt.org/z/x5P81TT4r" rel="noreferrer">https://gcc.godbolt.org/z/x5P81TT4r</a></p>
  <p>I believe MSVC behaves incorrectly in the second case (though it looks like a nice language extension). Could anyone find the right wording from the standard (the search is not easy since the word <code>this</code> is mentioned there 2800+ times)?</p>