Fix PR5716 by bandaging over the solution until we can come back to it.
I apologize for friend declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91359 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp
index f4fd6b8..98992f6 100644
--- a/test/SemaTemplate/friend-template.cpp
+++ b/test/SemaTemplate/friend-template.cpp
@@ -82,3 +82,18 @@
X3<long> x3l; // FIXME: should cause an instantiation-time failure
}
+
+// PR5716
+namespace test4 {
+ template<typename> struct A {
+ template<typename T> friend void f(const A<T>&);
+ };
+
+ template<typename T> void f(const A<T>&) {
+ int a[sizeof(T) ? -1 : -1]; // expected-error {{array size is negative}}
+ }
+
+ void f() {
+ f(A<int>()); // expected-note {{in instantiation of function template specialization}}
+ }
+}