diff options
author | John McCall <rjmccall@apple.com> | 2010-12-15 04:00:32 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-15 04:00:32 +0000 |
commit | 357d0f3cafc476578bdfa7c75e97a05b3f9ac1cd (patch) | |
tree | 7de625ed2983d13352c442ce12bdbfcdc577ef41 /clang/test/CodeGenCXX/inline-functions.cpp | |
parent | 5d32b709678f74892fb5031930775b06ae1a3b50 (diff) | |
download | bcm5719-llvm-357d0f3cafc476578bdfa7c75e97a05b3f9ac1cd.tar.gz bcm5719-llvm-357d0f3cafc476578bdfa7c75e97a05b3f9ac1cd.zip |
Set the "implicitly inline" bit on a method as soon as we see a definition
within the class. Teach IR gen to look for function definitions in record
lexical contexts when deciding whether to emit a function whose address
was taken. Fixes PR8789.
llvm-svn: 121833
Diffstat (limited to 'clang/test/CodeGenCXX/inline-functions.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/inline-functions.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/inline-functions.cpp b/clang/test/CodeGenCXX/inline-functions.cpp index 63a523a9dec..69dfe0db98f 100644 --- a/clang/test/CodeGenCXX/inline-functions.cpp +++ b/clang/test/CodeGenCXX/inline-functions.cpp @@ -29,3 +29,27 @@ inline void f1(int); void f1(int) { } void test_f1() { f1(17); } + +// PR8789 +namespace test1 { + template <typename T> class ClassTemplate { + private: + friend void T::func(); + void g() {} + }; + + // CHECK: define linkonce_odr void @_ZN5test11C4funcEv( + + class C { + public: + void func() { + ClassTemplate<C> ct; + ct.g(); + } + }; + + void f() { + C c; + c.func(); + } +} |