diff options
Diffstat (limited to 'test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp')
-rw-r--r-- | test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp b/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp new file mode 100644 index 0000000000..2e85c18fff --- /dev/null +++ b/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s + +// Various tests related to partial ordering of variadic templates. +template<typename ...Types> struct tuple; + +template<typename Tuple> +struct X1 { + static const unsigned value = 0; +}; + +template<typename Head, typename ...Tail> +struct X1<tuple<Head, Tail...> > { + static const unsigned value = 1; +}; + +template<typename Head, typename ...Tail> +struct X1<tuple<Head, Tail&...> > { + static const unsigned value = 2; +}; + +template<typename Head, typename ...Tail> +struct X1<tuple<Head&, Tail&...> > { + static const unsigned value = 3; +}; + +int check0[X1<tuple<>>::value == 0? 1 : -1]; +int check1[X1<tuple<int>>::value == 2? 1 : -1]; +int check2[X1<tuple<int, int>>::value == 1? 1 : -1]; +int check3[X1<tuple<int, int&>>::value == 2? 1 : -1]; +int check4[X1<tuple<int&, int&>>::value == 3? 1 : -1]; |