forked from OSchip/llvm-project
More tests for explicit template specialization
llvm-svn: 83896
This commit is contained in:
parent
bf43817408
commit
1fc79dda69
|
@ -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}}
|
|
@ -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>&);
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: clang-cc -fsyntax-only %s
|
||||
|
||||
template<typename T> void f(T);
|
||||
|
||||
template<> void f(int) { }
|
||||
void f(int) { }
|
|
@ -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];
|
||||
};
|
Loading…
Reference in New Issue