From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaTemplate/ackermann.cpp | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 clang/test/SemaTemplate/ackermann.cpp (limited to 'clang/test/SemaTemplate/ackermann.cpp') diff --git a/clang/test/SemaTemplate/ackermann.cpp b/clang/test/SemaTemplate/ackermann.cpp new file mode 100644 index 0000000..9525bfc --- /dev/null +++ b/clang/test/SemaTemplate/ackermann.cpp @@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// template +// struct Ackermann { +// enum { +// value = M ? (N ? Ackermann >::value +// : Ackermann::value) +// : N + 1 +// }; +// }; + +template +struct Ackermann { + enum { + value = Ackermann::value >::value + }; +}; + +template struct Ackermann { + enum { + value = Ackermann::value + }; +}; + +template struct Ackermann<0, N> { + enum { + value = N + 1 + }; +}; + +template<> struct Ackermann<0, 0> { + enum { + value = 1 + }; +}; + +int g0[Ackermann<3, 4>::value == 125 ? 1 : -1]; + -- cgit v1.2.3