summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-12 22:27:17 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-12 22:27:17 +0000
commitca027af608698af35991d5403bdf19927c5fff18 (patch)
tree673ffa27cc2f2603f9dd879781079a27c38b1c95 /clang/test
parente724ae92a8372d110516fa63f6cf836ee6cc92a7 (diff)
downloadbcm5719-llvm-ca027af608698af35991d5403bdf19927c5fff18.tar.gz
bcm5719-llvm-ca027af608698af35991d5403bdf19927c5fff18.zip
Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set the access specifiers properly when instantiating the declarations of member function templates. llvm-svn: 83911
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp
new file mode 100644
index 00000000000..ce40afd4022
--- /dev/null
+++ b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp
@@ -0,0 +1,26 @@
+// RUN: clang-cc -fsyntax-only %s
+template<class T> struct A {
+ void f(T);
+ template<class X1> void g1(T, X1);
+ template<class X2> void g2(T, X2);
+ void h(T) { }
+};
+
+// specialization
+template<> void A<int>::f(int);
+
+// out of class member template definition
+template<class T> template<class X1> void A<T>::g1(T, X1) { }
+
+// member template specialization
+template<> template<class X1> void A<int>::g1(int, X1);
+
+// member template specialization
+template<> template<>
+ void A<int>::g1(int, char); // X1 deduced as char
+
+template<> template<>
+ void A<int>::g2<char>(int, char); // X2 specified as char
+ // member specialization even if defined in class definition
+
+template<> void A<int>::h(int) { }
OpenPOWER on IntegriCloud