blob: 5946d9b680b85c3cfa5e4b9b2287080f1a5902c9 [file] [log] [blame]
Douglas Gregor3a923c2d2009-09-24 23:14:47 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3template<int N> void f0(int (&array)[N]);
4
5// Simple function template specialization (using overloading)
6template<> void f0(int (&array)[1]);
7
8void test_f0() {
9 int iarr1[1];
10 f0(iarr1);
11}
12
13// Function template specialization where there are no matches
14template<> void f0(char (&array)[1]); // expected-error{{no function template matches}}
15
16// Function template specialization that requires partial ordering
17template<typename T, int N> void f1(T (&array)[N]); // expected-note{{matches}}
18template<int N> void f1(int (&array)[N]); // expected-note{{matches}}
19
20template<> void f1(float (&array)[1]);
21template<> void f1(int (&array)[1]);
22
23// Function template specialization that results in an ambiguity
24template<typename T> void f1(T (&array)[17]); // expected-note{{matches}}
25template<> void f1(int (&array)[17]); // expected-error{{ambiguous}}