ast-main.cpp 521 B

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