summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/function-template-specialization.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaTemplate/function-template-specialization.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/SemaTemplate/function-template-specialization.cpp')
-rw-r--r--test/SemaTemplate/function-template-specialization.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/SemaTemplate/function-template-specialization.cpp b/test/SemaTemplate/function-template-specialization.cpp
index a0d41b2..6327ff6 100644
--- a/test/SemaTemplate/function-template-specialization.cpp
+++ b/test/SemaTemplate/function-template-specialization.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-template<int N> void f0(int (&array)[N]);
+template <int N>
+void f0(int (&array)[N]); // expected-note {{candidate template ignored: could not match 'int' against 'char'}}
// Simple function template specialization (using overloading)
template<> void f0(int (&array)[1]);
@@ -46,3 +47,12 @@ namespace PR8295 {
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}}
+};
OpenPOWER on IntegriCloud