<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - const member function in templated "union-like" class treats non-static member as non-const"
   href="http://llvm.org/bugs/show_bug.cgi?id=22637">22637</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>const member function in templated "union-like" class treats non-static member as non-const
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hs@xmission.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>// snippet tested on clang HEAD 3.7.0 (trunk 229861) (llvm/trunk 229855)

#include <iostream>

void check(int&) { std::cout << "non-const "; }
void check(int const&) { std::cout << "const "; }

template <typename> 
struct A { 
    union { 
        int b; 
    };

    int c;    
    void foo() const { check(b); check(c); } 
};

int main(){ 
    A<int> a; 
    a.foo(); 


// output: non-const const</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>