Files
rk35xx-android14/external/clang/test/Sema/template-specialization.cpp
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

22 lines
602 B
C++

// RUN: %clang_cc1 -verify -fsyntax-only %s
// Verify the absence of assertion failures when solving calls to unresolved
// template member functions.
struct A {
template <typename T>
static void bar(int) { } // expected-note {{candidate template ignored: couldn't infer template argument 'T'}}
};
struct B {
template <int i>
static void foo() {
int array[i];
A::template bar(array[0]); // expected-error {{no matching function for call to 'bar'}}
}
};
int main() {
B::foo<4>(); // expected-note {{in instantiation of function template specialization 'B::foo<4>'}}
return 0;
}