clang/test/PCH/cxx14-decltype-auto.cpp
raw| 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> |
| 9 | constexpr decltype(auto) test(T) { return T(); } |
| 10 | class A {}; |
| 11 | void k() { test(A()); } |
| 12 | |
| 13 | #else |
| 14 | |
| 15 | auto s = test(A()); |
| 16 | #endif |