p4.cpp revision b99268b3083c882103bd1bd08bdcc9a76a2b4795
1// RUN: %clang_cc1 -std=c++0x -fsyntax-only -fexceptions -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...); // expected-note{{overridden virtual function is here}} 34}; 35 36struct check_f_with_except_1 : f_with_except<int, float> { 37 virtual void f() throw(int, float); 38}; 39 40struct check_f_with_except_2 : f_with_except<int, float> { 41 virtual void f() throw(int); 42}; 43 44struct check_f_with_except_3 : f_with_except<int, float> { 45 virtual void f() throw(int, float, double); // expected-error{{exception specification of overriding function is more lax than base version}} 46}; 47