diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-03-20 00:02:27 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-03-20 00:02:27 +0000 |
| commit | 73768709f2627080f1635aef7573766257f2ec59 (patch) | |
| tree | 9d448f53444446e0383b111da170b3776d617107 /clang/test/CodeGenCXX | |
| parent | bbdc26ba1b05215347cae02242fb512586a9554e (diff) | |
| download | bcm5719-llvm-73768709f2627080f1635aef7573766257f2ec59.tar.gz bcm5719-llvm-73768709f2627080f1635aef7573766257f2ec59.zip | |
Don't crash-on-valid when an inline function is friend of class template
We assumed that the most recent declaration of an inline function would
also be inline. However, a more recent declaration can come from a
friend declaration in a class template that is instantiated at the
definition of the function.
llvm-svn: 232786
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/inline-functions.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/inline-functions.cpp b/clang/test/CodeGenCXX/inline-functions.cpp index 622cfa9536f..20da1f63180 100644 --- a/clang/test/CodeGenCXX/inline-functions.cpp +++ b/clang/test/CodeGenCXX/inline-functions.cpp @@ -121,3 +121,18 @@ struct TypeWithInlineMethods { // CHECK-NOT: _ZN21TypeWithInlineMethods12NonStaticFunEv void NonStaticFun() { StaticFun(); } }; + +namespace PR22959 { +template <typename> +struct S; + +S<int> Foo(); + +template <typename> +struct S { + friend S<int> Foo(); +}; + +__attribute__((used)) inline S<int> Foo() { return S<int>(); } +// CHECK-LABEL: define linkonce_odr void @_ZN7PR229593FooEv( +} |

