blob: b56d8cdf693885373734dd22ba38d435c3d0a96c [file] [log] [blame]
Douglas Gregor5953d8b2009-03-19 17:26:29 +00001// RUN: clang -fsyntax-only %s
2
3// FIXME: The Fibonacci/FibonacciEval dance is here to work around our
4// inability to parse injected-class-name<template-argument-list>.
5template<unsigned I>
6struct FibonacciEval;
7
8template<unsigned I>
9struct Fibonacci {
10 enum { value = FibonacciEval<I-1>::value + FibonacciEval<I-2>::value };
11};
12
13template<unsigned I>
14struct FibonacciEval {
15 enum { value = Fibonacci<I>::value };
16};
17
18template<> struct Fibonacci<0> {
19 enum { value = 0 };
20};
21
22template<> struct Fibonacci<1> {
23 enum { value = 1 };
24};
25
26int array5[Fibonacci<5>::value == 5? 1 : -1];
27int array10[Fibonacci<10>::value == 55? 1 : -1];