<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed."
href="https://bugs.llvm.org/show_bug.cgi?id=33503">bug 33503</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;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed."
href="https://bugs.llvm.org/show_bug.cgi?id=33503#c9">Comment # 9</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed."
href="https://bugs.llvm.org/show_bug.cgi?id=33503">bug 33503</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>The original testcase reduces to:
inline namespace { int to_string(); }
int ::to_string();
... which looks like it's asserting because we built a broken AST: the semantic
DeclContext of the second to_string declaration is incorrectly set to the TU,
whereas it should be the anonymous namespace. (That is, this is not a "linkage
computed too early" problem.)
That's fixed in r321770.
The testcase in <a href="show_bug.cgi?id=33503#c2">comment#2</a> passes at head, and is a duplicate of PR35697 (that
test happens to tickle the same bug prior to the change in r313729 that exposed
the bug more widely).
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Simple use of inline namespace: Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed."
href="show_bug.cgi?id=19995">Bug #19995</a> looks like a similar wrong-AST bug to this one (another case where
inline namespaces can unexpectedly change the semantic context of a
declaration), but not a duplicate.
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [fuzz] Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed."
href="show_bug.cgi?id=21854">Bug #21854</a> is an unrelated bug, where error recovery has left us with a
malformed AST.
So this bug is fixed, and those two other bugs are distinct issues that simply
happen to trip up the same assert. Of particular note: none of these would be
fixed by delaying linkage calculation; they're all bugs in other parts of
Clang.</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>