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/enum-argument.cpp | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 clang/test/SemaTemplate/enum-argument.cpp (limited to 'clang/test/SemaTemplate/enum-argument.cpp') diff --git a/clang/test/SemaTemplate/enum-argument.cpp b/clang/test/SemaTemplate/enum-argument.cpp new file mode 100644 index 0000000..7d23757 --- /dev/null +++ b/clang/test/SemaTemplate/enum-argument.cpp @@ -0,0 +1,36 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +enum Enum { val = 1 }; +template struct C { + typedef C Self; +}; +template struct C; + +template +struct get_size { + static const unsigned value = sizeof(T); +}; + +template +struct X0 { + enum { + Val1 = get_size::value, + Val2, + SumOfValues = Val1 + Val2 + }; +}; + +X0 x0i; + +namespace rdar8020920 { + template + struct X { + enum { e0 = 32 }; + + unsigned long long bitfield : e0; + + void f(int j) { + bitfield + j; + } + }; +} -- cgit v1.2.3