title: passing ‘const this argument discards qualifiers [-fpermissive]
body: <p>I have a class <code>Cache</code> which has a function write specified as </p>
  
  <pre><code>bool write(const MemoryAccess &amp;memory_access, CacheLine &amp;cl);
  </code></pre>
  
  <p>I am calling this function like this.</p>
  
  <pre><code>const Cache *this_cache;
  c = (a==b)?my_cache:not_cache;
  c-&gt;write(memory_access,cl);
  </code></pre>
  
  <p>The above line is giving me following error </p>
  
  <blockquote>
    <p>"passing ‘const Cache’ as ‘this’ argument of ‘bool Cache::write(const
    MemoryAccess&amp;, CacheLine&amp;)’ discards qualifiers [-fpermissive]."</p>
  </blockquote>
  
  <p>the this argument is compiler specific which helps in code-mangling and breaking local namespace variable priority. But such a variable is not being passed here.</p>