brintos

brintos / llvm-project-archived public Read only

0
0
Text · 984 B · ed76ced Raw
25 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// PR7463: Make sure that when we have an rvalue, it does not have4// cv-qualified non-class type.5template <typename T_> void g (T_&); // expected-note 7{{not viable}}6 7template<const int X> void h() { 8  g(X); // expected-error{{no matching function for call to 'g'}}9}10 11template<typename T, T X> void h2() { 12  g(X); // expected-error{{no matching function for call to 'g'}}13}14 15void 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}25