template-specialization.cpp 602 B

123456789101112131415161718192021
  1. // RUN: %clang_cc1 -verify -fsyntax-only %s
  2. // Verify the absence of assertion failures when solving calls to unresolved
  3. // template member functions.
  4. struct A {
  5. template <typename T>
  6. static void bar(int) { } // expected-note {{candidate template ignored: couldn't infer template argument 'T'}}
  7. };
  8. struct B {
  9. template <int i>
  10. static void foo() {
  11. int array[i];
  12. A::template bar(array[0]); // expected-error {{no matching function for call to 'bar'}}
  13. }
  14. };
  15. int main() {
  16. B::foo<4>(); // expected-note {{in instantiation of function template specialization 'B::foo<4>'}}
  17. return 0;
  18. }