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 Umannvoid 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 Umannvoid 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 Umannvoid 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 Umannvoid variadicTemplateFunction(int i) { 26*3ea7442bSKristof Umann if (ret()) 27*3ea7442bSKristof Umann int a = 10 / i; 28*3ea7442bSKristof Umann } 29*3ea7442bSKristof Umann main()30*3ea7442bSKristof Umannint 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 'f<float>'</string> 38*3ea7442bSKristof Umann // CHECK: <string>Calling 'f<int>'</string> 39*3ea7442bSKristof Umann // CHECK: <string>Calling 'defaultTemplateParameterFunction<0>'</string> 40*3ea7442bSKristof Umann // CHECK: <string>Calling 'variadicTemplateFunction<char, float, double, int *>'</string> 41*3ea7442bSKristof Umann 42