When instantiating a function template specialization following
template argument deduction, use the lexical declaration context as
the owner for friend function templates. Fixes 2 failures in
Boost.Graph.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102489 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp
index 6ee30aa..4b60a3d 100644
--- a/test/SemaTemplate/friend-template.cpp
+++ b/test/SemaTemplate/friend-template.cpp
@@ -127,3 +127,18 @@
};
}
+namespace FriendTemplateDefinition {
+ template<unsigned > struct int_c { };
+
+ template<typename T>
+ struct X {
+ template<unsigned N>
+ friend void f(X, int_c<N>) {
+ int value = N;
+ };
+ };
+
+ void test_X(X<int> x, int_c<5> i5) {
+ f(x, i5);
+ }
+}