aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__algorithm/comp.h
diff options
context:
space:
mode:
authorBenson Chu <bensonchu457@gmail.com>2021-08-15 13:12:21 -0500
committerBenson Chu <bensonchu457@gmail.com>2021-08-26 16:49:54 -0500
commit7bd92f5911dc7ec54200d37552d364f87ad03dfb (patch)
tree0af574ae513221a8773173edb5d7866c3a221f53 /libcxx/include/__algorithm/comp.h
parent6eed1fb349de8710fba0d12a4289ac0519f23fb3 (diff)
downloadllvm-7bd92f5911dc7ec54200d37552d364f87ad03dfb.zip
llvm-7bd92f5911dc7ec54200d37552d364f87ad03dfb.tar.gz
llvm-7bd92f5911dc7ec54200d37552d364f87ad03dfb.tar.bz2
[AST] Pick last tentative definition as the acting definition
Clang currently picks the second tentative definition when VarDecl::getActingDefinition is called. This can lead to attributes being dropped if they are attached to tentative definitions that appear after the second one. This is because VarDecl::getActingDefinition loops through VarDecl::redecls assuming that the last tentative definition is the last element in the iterator. However, it is the second element that would be the last tentative definition. This changeset modifies getActingDefinition to iterate through the declaration chain in reverse, so that it can immediately return when it encounters a tentative definition. Originally the unit test for this changeset did not have a -triple flag for the clang invocation, leading to this test being broken on MacOS, since Mach-O does not support the section attribute. Differential Revision: https://reviews.llvm.org/D99732
Diffstat (limited to 'libcxx/include/__algorithm/comp.h')
0 files changed, 0 insertions, 0 deletions