diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2017-07-13 06:08:27 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2017-07-13 06:08:27 +0000 |
commit | 2246167362bf3596f13988723b363449b8427cfd (patch) | |
tree | 7e0bdc9ff27963518c08aa8b4e1b9d964eae091d /clang/test/CodeGenCXX/vtable-available-externally.cpp | |
parent | fa5183b0280fe0d0bc44f1bbc8f24d744013e31b (diff) | |
download | bcm5719-llvm-2246167362bf3596f13988723b363449b8427cfd.tar.gz bcm5719-llvm-2246167362bf3596f13988723b363449b8427cfd.zip |
[Sema] Mark a virtual CXXMethodDecl as used if a call to it can be
devirtualized.
The code to detect devirtualized calls is already in IRGen, so move the
code to lib/AST and make it a shared utility between Sema and IRGen.
This commit fixes a linkage error I was seeing when compiling the
following code:
$ cat test1.cpp
struct Base {
virtual void operator()() {}
};
template<class T>
struct Derived final : Base {
void operator()() override {}
};
Derived<int> *d;
int main() {
if (d)
(*d)();
return 0;
}
rdar://problem/33195657
Differential Revision: https://reviews.llvm.org/D34301
llvm-svn: 307883
Diffstat (limited to 'clang/test/CodeGenCXX/vtable-available-externally.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/vtable-available-externally.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/vtable-available-externally.cpp b/clang/test/CodeGenCXX/vtable-available-externally.cpp index db99f73d9e7..2e2cdbbfeff 100644 --- a/clang/test/CodeGenCXX/vtable-available-externally.cpp +++ b/clang/test/CodeGenCXX/vtable-available-externally.cpp @@ -275,9 +275,8 @@ struct C { virtual D& operator=(const D&); }; -// Cannot emit D's vtable available_externally, because we cannot create -// a reference to the inline virtual D::operator= function. -// CHECK-TEST11: @_ZTVN6Test111DE = external unnamed_addr constant +// Can emit D's vtable available_externally. +// CHECK-TEST11: @_ZTVN6Test111DE = available_externally unnamed_addr constant struct D : C { virtual void key(); }; |