| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
// PR7463: Make sure that when we have an rvalue, it does not have |
| 4 |
// cv-qualified non-class type. |
| 5 |
template <typename T_> void g (T_&); // expected-note 7{{not viable}} |
| 6 |
|
| 7 |
template<const int X> void h() { |
| 8 |
g(X); // expected-error{{no matching function for call to 'g'}} |
| 9 |
} |
| 10 |
|
| 11 |
template<typename T, T X> void h2() { |
| 12 |
g(X); // expected-error{{no matching function for call to 'g'}} |
| 13 |
} |
| 14 |
|
| 15 |
void a(__builtin_va_list x) { |
| 16 |
g(__builtin_va_arg(x, const int)); // expected-error{{no matching function for call to 'g'}} |
| 17 |
g((const int)0); // expected-error{{no matching function for call to 'g'}} |
| 18 |
typedef const int cint; |
| 19 |
g(cint(0)); // expected-error{{no matching function for call to 'g'}} |
| 20 |
g(static_cast<const int>(1)); // expected-error{{no matching function for call to 'g'}} |
| 21 |
g(reinterpret_cast<int *const>(0)); // expected-error{{no matching function for call to 'g'}} |
| 22 |
h<0>(); |
| 23 |
h2<const int, 0>(); // expected-note{{instantiation of}} |
| 24 |
} |