[cfe-commits] r83896 - in /cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec: p10.cpp p11.cpp p13.cpp p9.cpp
Douglas Gregor
dgregor at apple.com
Mon Oct 12 13:45:50 PDT 2009
Author: dgregor
Date: Mon Oct 12 15:45:50 2009
New Revision: 83896
URL: http://llvm.org/viewvc/llvm-project?rev=83896&view=rev
Log:
More tests for explicit template specialization
Added:
cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp
Added: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp?rev=83896&view=auto
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp (added)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp Mon Oct 12 15:45:50 2009
@@ -0,0 +1,7 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<class T> class X;
+template<> class X<int>; // expected-note{{forward}}
+X<int>* p;
+
+X<int> x; // expected-error{{incomplete type}}
Added: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp?rev=83896&view=auto
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp (added)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp Mon Oct 12 15:45:50 2009
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<class T> class Array { /* ... */ };
+template<class T> void sort(Array<T>& v);
+
+// explicit specialization for sort(Array<int>&)
+// with deduced template-argument of type int
+template<> void sort(Array<int>&);
Added: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp?rev=83896&view=auto
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp (added)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp Mon Oct 12 15:45:50 2009
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only %s
+
+template<typename T> void f(T);
+
+template<> void f(int) { }
+void f(int) { }
Added: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp?rev=83896&view=auto
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp (added)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp Mon Oct 12 15:45:50 2009
@@ -0,0 +1,14 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+namespace N {
+ template<class T> class X { /* ... */ };
+ template<class T> class Y { /* ... */ };
+ template<> class X<int> { /* ... */ };
+ template<> class Y<double>;
+
+ const unsigned NumElements = 17;
+}
+
+template<> class N::Y<double> {
+ int array[NumElements];
+};
More information about the cfe-commits
mailing list