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). --- .../test/SemaTemplate/instantiate-declref-ice.cpp | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 clang/test/SemaTemplate/instantiate-declref-ice.cpp (limited to 'clang/test/SemaTemplate/instantiate-declref-ice.cpp') diff --git a/clang/test/SemaTemplate/instantiate-declref-ice.cpp b/clang/test/SemaTemplate/instantiate-declref-ice.cpp new file mode 100644 index 0000000..49b1b63 --- /dev/null +++ b/clang/test/SemaTemplate/instantiate-declref-ice.cpp @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +template struct x { + static const int j = i; + x* y; +}; + +template +const int x::j; + +int array0[x<2>::j]; + +template +struct X0 { + static const unsigned value = sizeof(T); +}; + +template +const unsigned X0::value; + +int array1[X0::value == sizeof(int)? 1 : -1]; + +const unsigned& testX0() { return X0::value; } + +int array2[X0::value == sizeof(int)? 1 : -1]; + +template +struct X1 { + static const unsigned value; +}; + +template +const unsigned X1::value = sizeof(T); + +int array3[X1::value == sizeof(int)? 1 : -1]; -- cgit v1.2.3