p4.cpp revision a04426c5416f22df1078f6b31c1619de73c40b59
1// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
2
3template<typename... Types> struct tuple;
4
5// FIXME: Many more bullets to go
6
7// In a template-argument-list (14.3); the pattern is a template-argument.
8template<typename ...Types>
9struct tuple_of_refs {
10  typedef tuple<Types& ...> types;
11};
12
13tuple<int&, float&> *t_int_ref_float_ref;
14tuple_of_refs<int&, float&>::types *t_int_ref_float_ref_2 =  t_int_ref_float_ref;
15
16template<typename ...Types>
17struct extract_nested_types {
18  typedef tuple<typename Types::type...> types;
19};
20
21template<typename T>
22struct identity {
23  typedef T type;
24};
25
26tuple<int, float> *t_int_float;
27extract_nested_types<identity<int>, identity<float> >::types *t_int_float_2
28  = t_int_float;
29
30// In a dynamic-exception-specification (15.4); the pattern is a type-id.
31template<typename ...Types>
32struct f_with_except {
33  virtual void f() throw(Types...);
34};
35
36// FIXME: the code below requires the ability to instantiate pack
37// expansions whose pattern is a type-id.
38#if 0
39struct check_f_with_except_1 : f_with_except<int, float> {
40  virtual void f() throw(int, float);
41};
42
43struct check_f_with_except_2 : f_with_except<int, float> {
44  virtual void f() throw(int);
45};
46#endif
47