From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/PCH/cxx-chain-function-template.cpp | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 clang/test/PCH/cxx-chain-function-template.cpp (limited to 'clang/test/PCH/cxx-chain-function-template.cpp') diff --git a/clang/test/PCH/cxx-chain-function-template.cpp b/clang/test/PCH/cxx-chain-function-template.cpp new file mode 100644 index 0000000..494e190 --- /dev/null +++ b/clang/test/PCH/cxx-chain-function-template.cpp @@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -chain-include %s -chain-include %s -fsyntax-only %s +// Just don't crash. +#if !defined(RUN1) +#define RUN1 + +struct CXXRecordDecl { CXXRecordDecl(int); }; + +template +T cast(U u) { + return reinterpret_cast(u); +} + +void test1() { + cast(1); +} + +#elif !defined(RUN2) +#define RUN2 + +template +void test2(T) { + cast(1.0f); +} + +#else + +void test3() { + cast(1.0f); + test2(1); +} + +#endif -- cgit v1.2.3