Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CXX / temp / temp.fct.spec / temp.deduct / p9.cpp
blobf7103a33cc72d586758101b3d9b524e21195ee44
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
5 template <int> int f(int); // expected-note {{candidate function}}
6 #if __cplusplus <= 199711L
7 // expected-note@-2 {{candidate function}}
8 #endif
10 template <signed char> int f(int); // expected-note {{candidate function}}
11 #if __cplusplus <= 199711L
12 // expected-note@-2 {{candidate function}}
13 #endif
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
21 namespace PR6707 {
22 template<typename T, T Value>
23 struct X { };
25 template<typename T, T Value>
26 void f(X<T, Value>);
28 void g(X<int, 10> x) {
29 f(x);
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 // expected-note@-1 {{candidate template ignored: deduced values of conflicting types for parameter 'Value' (10 of type 'int' vs. 10 of type 'char')}}
36 // expected-note@-2 {{candidate template ignored: deduced values of conflicting types for parameter 'Value' (10 of type 'char' vs. 10 of type 'int')}}
38 void g2() {
39 f2(X<int, 10>(), X<char, ten>()); // expected-error {{no matching}}
40 f2(X<char, 10>(), X<int, ten>()); // expected-error {{no matching}}