xref: /llvm-project/clang/test/PCH/cxx14-decltype-auto.cpp (revision ab3f100bec03d72ecee947a323c51698d4b95207)
1 // Test with pch.
2 // RUN: %clang_cc1 -emit-pch -std=c++14 -o %t %s
3 // RUN: %clang_cc1 -include-pch %t -emit-llvm -std=c++14 -o - %s
4 
5 #ifndef HEADER
6 #define HEADER
7 
8 template <typename T>
test(T)9 constexpr decltype(auto) test(T) { return T(); }
10 class A {};
k()11 void k() {  test(A()); }
12 
13 #else
14 
15 auto s = test(A());
16 #endif
17