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). --- .../temp.class.spec/temp.class.order/p2.cpp | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp (limited to 'clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp') diff --git a/clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp b/clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp new file mode 100644 index 0000000..97457ea --- /dev/null +++ b/clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp @@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +template struct X { + static const int value = 0; +}; + +template struct X { + static const int value = 1; +}; + +template struct X { + static const int value = 2; +}; + +int array0[X<0, 0, float>::value == 0? 1 : -1]; +int array1[X<0, 1, int>::value == 1? 1 : -1]; +int array2[X<0, 0, int>::value == 2? 1 : -1]; + +namespace DependentSubstPartialOrdering { + template + struct X { + static const unsigned value = 1; + }; + + template + struct X { + static const unsigned value = 2; + }; + + template + struct X { + static const unsigned value = 3; + }; + + struct X1 { }; + + struct X2 { + typedef void is_b; + }; + + struct X3 { + typedef void is_a; + typedef void is_b; + }; + + int check_X1[X::value == 1? 1 : -1]; + int check_X2[X::value == 2? 1 : -1]; + int check_X3[X::value == 3? 1 : -1]; +} -- cgit v1.2.3