Check a pointer is not null before attempting to use it. This prevents a
crash on an explicit specialization of a member function in a class scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181971 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/function-template-specialization.cpp b/test/SemaTemplate/function-template-specialization.cpp
index a0d41b2..2338b67 100644
--- a/test/SemaTemplate/function-template-specialization.cpp
+++ b/test/SemaTemplate/function-template-specialization.cpp
@@ -46,3 +46,12 @@
template <typename T> void f(T t) {}
template <typename T> void f<T*>(T* t) {} // expected-error{{function template partial specialization is not allowed}}
}
+
+class Foo {
+ template<class T>
+ static void Bar(const T& input);
+
+ // Don't crash here.
+ template<>
+ static void Bar(const long& input) {} // expected-error{{explicit specialization of 'Bar' in class scope}}
+};