[llvm-bugs] [Bug 33503] Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 3 15:13:08 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=33503

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |FIXED

--- Comment #9 from Richard Smith <richard-llvm at metafoo.co.uk> ---
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 comment#2 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).

Bug #19995 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.

Bug #21854 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180103/1c563ff1/attachment.html>


More information about the llvm-bugs mailing list