| // RUN: not %clang_cc1 -fsyntax-only %s -std=c++98 2>&1 | FileCheck %s |
| template<typename T, char a> struct X {}; |
| X<int, 1> x = X<long, 257>(); |
| // CHECK: error: no viable conversion from 'X<long, [...]>' to 'X<int, [...]>' |
| template <int x, int y = x+1> |
| // CHECK: no viable conversion from 'A<[...], (default) x + 1 aka 1>' to 'A<[...], 0>' |
| // CHECK: no viable conversion from 'A<0, [...]>' to 'A<1, [...]>' |
| template <int x, int y = 1+1, int z = 2> |
| // CHECK: no viable conversion from 'A<[...], (default) 1 + 1 aka 2, (default) 2>' to 'A<[...], 0, 0>' |
| // CHECK: no viable conversion from 'A<[2 * ...], (default) 2>' to 'A<[2 * ...], 0>' |
| void foo(void (func(T*)), T*) {} |
| void bar(const vector<int>*) {} |
| void test(volatile vector<int>* V) { |
| // CHECK: candidate template ignored: deduced conflicting types for parameter 'T' ('const vector<...>' vs. 'volatile vector<...>') |