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.
llvm-svn: 181971
diff --git a/clang/test/SemaTemplate/function-template-specialization.cpp b/clang/test/SemaTemplate/function-template-specialization.cpp
index a0d41b2..2338b67 100644
--- a/clang/test/SemaTemplate/function-template-specialization.cpp
+++ b/clang/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}}
+};