blob: 494e190f776b3cccfbc48068404f7e0ecda0a89a [file] [log] [blame]
Sebastian Redl5bbcdbf2011-04-14 14:07:59 +00001// RUN: %clang_cc1 -chain-include %s -chain-include %s -fsyntax-only %s
2// Just don't crash.
3#if !defined(RUN1)
4#define RUN1
5
6struct CXXRecordDecl { CXXRecordDecl(int); };
7
8template <typename T, typename U>
9T cast(U u) {
10 return reinterpret_cast<T&>(u);
11}
12
13void test1() {
14 cast<float>(1);
15}
16
17#elif !defined(RUN2)
18#define RUN2
19
20template <typename T>
21void test2(T) {
22 cast<CXXRecordDecl>(1.0f);
23}
24
25#else
26
27void test3() {
28 cast<CXXRecordDecl>(1.0f);
29 test2(1);
30}
31
32#endif