From 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 May 2011 19:39:53 +0000 Subject: Vendor import of clang trunk r130700: http://llvm.org/svn/llvm-project/cfe/trunk@130700 --- test/PCH/cxx-chain-function-template.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/PCH/cxx-chain-function-template.cpp (limited to 'test/PCH/cxx-chain-function-template.cpp') diff --git a/test/PCH/cxx-chain-function-template.cpp b/test/PCH/cxx-chain-function-template.cpp new file mode 100644 index 0000000000000..494e190f776b3 --- /dev/null +++ b/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