]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaCXX/template-specialization.cpp
Vendor import of clang trunk r300422:
[FreeBSD/FreeBSD.git] / test / SemaCXX / template-specialization.cpp
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
5 struct A {
6   template <typename T>
7   static void bar(int) { } // expected-note {{candidate template ignored: couldn't infer template argument 'T'}}
8 };
9
10 struct B {
11   template <int i>
12   static void foo() {
13     int array[i];
14     A::template bar(array[0]); // expected-error {{no matching function for call to 'bar'}}
15   }
16 };
17
18 int main() {
19   B::foo<4>(); // expected-note {{in instantiation of function template specialization 'B::foo<4>'}}
20   return 0;
21 }