blob: aa3b4b1b671ef5cc58b768c6230cc8bc1696c6aa [file] [log] [blame]
Daniel Dunbarffd408a2009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only %s
Douglas Gregor47bde7c2009-03-19 17:26:29 +00002
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];