xref: /aosp_15_r20/external/clang/test/SemaTemplate/instantiate-case.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify %s
2*67e74705SXin Li 
3*67e74705SXin Li template<class T>
alpha(T c)4*67e74705SXin Li static int alpha(T c)
5*67e74705SXin Li {
6*67e74705SXin Li     return *c; // expected-error{{indirection requires pointer operand}}
7*67e74705SXin Li }
8*67e74705SXin Li 
9*67e74705SXin Li template<class T>
10*67e74705SXin Li static void
_shexp_match()11*67e74705SXin Li _shexp_match()
12*67e74705SXin Li {
13*67e74705SXin Li   switch(1) {
14*67e74705SXin Li   case 1:
15*67e74705SXin Li     alpha(1); // expected-note{{instantiation of function template}}
16*67e74705SXin Li   }
17*67e74705SXin Li }
main()18*67e74705SXin Li int main() {
19*67e74705SXin Li   _shexp_match<char>(); // expected-note{{instantiation of function template}}
20*67e74705SXin Li   return 0;
21*67e74705SXin Li }
22