• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
4 
5 template <int> int f(int);  // expected-note {{candidate function}}
6 #if __cplusplus <= 199711L
7 // expected-note@-2 {{candidate function}}
8 #endif
9 
10 template <signed char> int f(int); // expected-note {{candidate function}}
11 #if __cplusplus <= 199711L
12 // expected-note@-2 {{candidate function}}
13 #endif
14 
15 int i1 = f<1>(0); // expected-error{{call to 'f' is ambiguous}}
16 int i2 = f<1000>(0);
17 #if __cplusplus <= 199711L
18 // expected-error@-2{{call to 'f' is ambiguous}}
19 #endif
20 
21 namespace PR6707 {
22   template<typename T, T Value>
23   struct X { };
24 
25   template<typename T, T Value>
26   void f(X<T, Value>);
27 
g(X<int,10> x)28   void g(X<int, 10> x) {
29     f(x);
30   }
31 
32   static const unsigned char ten = 10;
33   template<typename T, T Value, typename U>
34   void f2(X<T, Value>, X<U, Value>);
35 
g2()36   void g2() {
37     f2(X<int, 10>(), X<char, ten>());
38   }
39 }
40