Douglas Gregor | 1a6e034 | 2010-03-26 02:38:37 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | template <int> int f(int); // expected-note 2{{candidate}} |
| 4 | template <signed char> int f(int); // expected-note 2{{candidate}} |
| 5 | int i1 = f<1>(0); // expected-error{{ambiguous}} |
| 6 | int i2 = f<1000>(0); // expected-error{{ambiguous}} |
Douglas Gregor | 4a0bac9 | 2010-03-26 05:57:46 +0000 | [diff] [blame^] | 7 | |
| 8 | namespace PR6707 { |
| 9 | template<typename T, T Value> |
| 10 | struct X { }; |
| 11 | |
| 12 | template<typename T, T Value> |
| 13 | void f(X<T, Value>); |
| 14 | |
| 15 | void g(X<int, 10> x) { |
| 16 | f(x); |
| 17 | } |
| 18 | |
| 19 | static const unsigned char ten = 10; |
| 20 | template<typename T, T Value, typename U> |
| 21 | void f2(X<T, Value>, X<U, Value>); |
| 22 | |
| 23 | void g2() { |
| 24 | f2(X<int, 10>(), X<char, ten>()); |
| 25 | } |
| 26 | } |