| 1 |
// { dg-do assemble } |
| 2 |
|
| 3 |
// Copyright (C) 2000 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 18 Jan 2001 <[email protected]> |
| 5 |
|
| 6 |
// Bug 1694. We complained during deduction, rather than reject the deduction. |
| 7 |
|
| 8 |
template <class T, T d> class X {}; |
| 9 |
|
| 10 |
template <class T> X<T,0> Foo (T *); |
| 11 |
template <class T> int Foo (T const *); |
| 12 |
|
| 13 |
void Baz (int *p1, int const *p2) |
| 14 |
{ |
| 15 |
int i = Foo (p1); // { dg-error "" } cannot convert |
| 16 |
int j = Foo (p2); |
| 17 |
} |
| 18 |
void Baz (float *p1, float const *p2) |
| 19 |
{ |
| 20 |
int i = Foo (p1); // ok, deduction fails on X<T,0> Foo (T *) |
| 21 |
int j = Foo (p2); |
| 22 |
} |