xref: /minix3/external/bsd/llvm/dist/clang/test/Frontend/ast-main.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang -emit-llvm -S -o %t1.ll -x c++ - < %s
2*f4a2713aSLionel Sambuc // RUN: %clang -fno-delayed-template-parsing -emit-ast -o %t.ast %s
3*f4a2713aSLionel Sambuc // RUN: %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast
4*f4a2713aSLionel Sambuc // RUN: diff %t1.ll %t2.ll
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // http://llvm.org/bugs/show_bug.cgi?id=15377
7*f4a2713aSLionel Sambuc template<typename T>
8*f4a2713aSLionel Sambuc struct S {
9*f4a2713aSLionel Sambuc     T *mf();
10*f4a2713aSLionel Sambuc };
11*f4a2713aSLionel Sambuc template<typename T>
mf()12*f4a2713aSLionel Sambuc T *S<T>::mf() {
13*f4a2713aSLionel Sambuc     // warning: control reaches end of non-void function [-Wreturn-type]
14*f4a2713aSLionel Sambuc }
15*f4a2713aSLionel Sambuc 
f()16*f4a2713aSLionel Sambuc void f() {
17*f4a2713aSLionel Sambuc     S<int>().mf();
18*f4a2713aSLionel Sambuc }
19*f4a2713aSLionel Sambuc 
main()20*f4a2713aSLionel Sambuc int main() {
21*f4a2713aSLionel Sambuc   return 0;
22*f4a2713aSLionel Sambuc }
23