<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:zhongyunde@tom.com" title="Allen zhong <zhongyunde@tom.com>"> <span class="fn">Allen zhong</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Missing optimization for member function with const attribute"
href="https://bugs.llvm.org/show_bug.cgi?id=50735">bug 50735</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>REOPENED
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Missing optimization for member function with const attribute"
href="https://bugs.llvm.org/show_bug.cgi?id=50735#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Missing optimization for member function with const attribute"
href="https://bugs.llvm.org/show_bug.cgi?id=50735">bug 50735</a>
from <span class="vcard"><a class="email" href="mailto:zhongyunde@tom.com" title="Allen zhong <zhongyunde@tom.com>"> <span class="fn">Allen zhong</span></a>
</span></b>
<pre>thanks, you are right, I verify with following change as you show, it indeed
can modify 'bins[0]'
class NPair /*: protected Pointers */ {
public:
int bins[10];
//int exclusion(int n) __attribute__((const));
int exclusion (int n) const {
printf ("before %d\n", bins[0]);
NPair* pt = const_cast<NPair*>(this);
pt->bins[0] = 1;
printf ("after %d\n", bins[0]);
}
NPair (void) {
bins[0] = 3;
}
};</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>