Douglas Gregor | d94546a | 2009-05-20 21:38:11 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | // --------------------------------------------------------------------- |
| 4 | // C++ Functional Casts |
| 5 | // --------------------------------------------------------------------- |
| 6 | template<int N> |
| 7 | struct ValueInit0 { |
| 8 | int f() { |
| 9 | return int(); |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | template struct ValueInit0<5>; |
| 14 | |
| 15 | template<int N> |
| 16 | struct FunctionalCast0 { |
| 17 | int f() { |
| 18 | return int(N); |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | template struct FunctionalCast0<5>; |
| 23 | |
| 24 | struct X { |
| 25 | X(int, int); |
| 26 | }; |
| 27 | |
| 28 | template<int N, int M> |
| 29 | struct BuildTemporary0 { |
| 30 | X f() { |
| 31 | return X(N, M); |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | template struct BuildTemporary0<5, 7>; |
Douglas Gregor | e06274d | 2009-05-20 21:51:01 +0000 | [diff] [blame] | 36 | |
| 37 | template<int N, int M> |
| 38 | struct Temporaries0 { |
| 39 | void f() { |
| 40 | (void)X(N, M); |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | template struct Temporaries0<5, 7>; |