1 // RUN: not %clang_cc1 -fsyntax-only %s -std=c++98 2>&1 | FileCheck %s
4 template<typename T
, char a
> struct X
{};
5 X
<int, 1> x
= X
<long, 257>();
6 // CHECK: error: no viable conversion from 'X<long, [...]>' to 'X<int, [...]>'
10 template <int x
, int y
= x
+1>
14 // CHECK: no viable conversion from 'A<[...], (default) x + 1 aka 1>' to 'A<[...], 0>'
16 // CHECK: no viable conversion from 'A<0, [...]>' to 'A<1, [...]>'
21 namespace default_args
{
22 template <int x
, int y
= 1+1, int z
= 2>
26 // CHECK: no viable conversion from 'A<[...], (default) 1 + 1 aka 2, (default) 2>' to 'A<[...], 0, 0>'
29 // CHECK: no viable conversion from 'A<[2 * ...], (default) 2>' to 'A<[2 * ...], 0>'
35 namespace qualifiers
{
37 void foo(void (func(T
*)), T
*) {}
42 void bar(const vector
<int>*) {}
44 void test(volatile vector
<int>* V
) {
48 // CHECK: candidate template ignored: deduced conflicting types for parameter 'T' ('const vector<...>' vs. 'volatile vector<...>')
61 wrapper
<1> w1
= foo
<2>().make();
62 // CHECK: no viable conversion from 'wrapper<2>' to 'wrapper<1>'
64 wrapper
<1> w2
= foo
<-3>().make();
65 // CHECK: no viable conversion from 'wrapper<-3>' to 'wrapper<1>'
70 wrapper
<1> w3
= make
<4>();
71 // CHECK: no viable conversion from 'wrapper<4>' to 'wrapper<1>'
74 wrapper
<-x
> makeNegative();
76 wrapper
<1> w4
= makeNegative
<5>();
77 // CHECK: no viable conversion from 'wrapper<-5>' to 'wrapper<1>'
79 wrapper
<1> w5
= makeNegative
<-6>();
80 // CHECK: no viable conversion from 'wrapper<6>' to 'wrapper<1>'