1*3ea7442bSKristof Umann // RUN: %clang_analyze_cc1 -analyzer-output=plist -o %t.plist -std=c++11 -analyzer-checker=core %s
2*3ea7442bSKristof Umann // RUN: FileCheck --input-file=%t.plist %s
3*3ea7442bSKristof Umann 
4*3ea7442bSKristof Umann bool ret();
5*3ea7442bSKristof Umann 
6*3ea7442bSKristof Umann template <class T>
f(int i)7*3ea7442bSKristof Umann void f(int i) {
8*3ea7442bSKristof Umann   if (ret())
9*3ea7442bSKristof Umann     i = i / (i - 5);
10*3ea7442bSKristof Umann }
11*3ea7442bSKristof Umann 
12*3ea7442bSKristof Umann template <>
f(int i)13*3ea7442bSKristof Umann void f<int>(int i) {
14*3ea7442bSKristof Umann   if (ret())
15*3ea7442bSKristof Umann     i = i / (i - 5);
16*3ea7442bSKristof Umann }
17*3ea7442bSKristof Umann 
18*3ea7442bSKristof Umann template <int N = 0>
defaultTemplateParameterFunction(int i)19*3ea7442bSKristof Umann void defaultTemplateParameterFunction(int i) {
20*3ea7442bSKristof Umann   if (ret())
21*3ea7442bSKristof Umann     int a = 10 / i;
22*3ea7442bSKristof Umann }
23*3ea7442bSKristof Umann 
24*3ea7442bSKristof Umann template <typename... Args>
variadicTemplateFunction(int i)25*3ea7442bSKristof Umann void variadicTemplateFunction(int i) {
26*3ea7442bSKristof Umann   if (ret())
27*3ea7442bSKristof Umann     int a = 10 / i;
28*3ea7442bSKristof Umann }
29*3ea7442bSKristof Umann 
main()30*3ea7442bSKristof Umann int main() {
31*3ea7442bSKristof Umann   f<int>(5);
32*3ea7442bSKristof Umann   f<float>(5);
33*3ea7442bSKristof Umann   defaultTemplateParameterFunction<>(0);
34*3ea7442bSKristof Umann   variadicTemplateFunction<char, float, double, int *>(0);
35*3ea7442bSKristof Umann }
36*3ea7442bSKristof Umann 
37*3ea7442bSKristof Umann // CHECK:      <string>Calling &apos;f&lt;float&gt;&apos;</string>
38*3ea7442bSKristof Umann // CHECK:      <string>Calling &apos;f&lt;int&gt;&apos;</string>
39*3ea7442bSKristof Umann // CHECK:      <string>Calling &apos;defaultTemplateParameterFunction&lt;0&gt;&apos;</string>
40*3ea7442bSKristof Umann // CHECK:      <string>Calling &apos;variadicTemplateFunction&lt;char, float, double, int *&gt;&apos;</string>
41*3ea7442bSKristof Umann 
42