4 Commits

Author SHA1 Message Date
John Brawn
626c789d92 Fix compile error in UnresolvedSetTest.cpp, hopefully the last one
This test is failing to compile when LLVM_ENABLE_MODULES=ON due to
NamedDecl being multiply defined. Fix this by avoiding declaring our
own NamedDecl in the test and instead cast a struct of appropriate
size and alignment to NamedDecl.
2023-07-06 11:54:45 +01:00
John Brawn
25784cd6a9 Fix compile error in UnresolvedSetTest.cpp, again
My previous fix used a gcc-style attribute, but not all compilers will accept
that. Instead use [[maybe_unused]], which is what we use elsewhere for this
kind of thing.
2023-07-05 17:54:50 +01:00
John Brawn
2583221058 Fix compile error in UnresolvedSetTest.cpp with -Wall
A stage 2 buildbot that compiles with -Wall -Werror is showing a failure because
a dummy value is unused. Use the unused attribute to suppress the warning, and
add a comment about why we have this value.
2023-07-05 17:39:59 +01:00
John Brawn
4ade8b7ed9 [AST] Fix bug in UnresolvedSet::erase of last element
UnresolvedSet::erase works by popping the last element then replacing
the element to be erased with that element. When the element to be
erased is itself the last element this leads to writing past the end
of the set, causing an assertion failure.

Fix this by making erase of the last element just pop that element.

Differential Revision: https://reviews.llvm.org/D154502
2023-07-05 16:02:40 +01:00