// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s template struct X; // expected-note {{'X' is incomplete}} template struct Y; X> *x1; Y<(1 >> 2)> *y1; Y<1 >> 2> *y2; // FIXME: expected-error{{expected unqualified-id}} X>>>> *x2; template<> struct X { }; typedef X X_int; struct Z : X_int { }; void f(const X x) { (void)reinterpret_cast>(x); // expected-error{{reinterpret_cast from}} (void)reinterpret_cast>>>(x); // expected-error{{reinterpret_cast from}} X> *x1; } template struct X1 { }; X1> x1a; namespace ParameterPackExpansions { // A template parameter pack that [contains an unexpanded parameter pack] is a // pack expansion. template struct Outer { // From [temp.variadic]p4: // In a template parameter pack that is a pack expansion, the pattern is // [...the template-parameter...] without the ellipsis. // Therefore the resulting sequence of parameters is not a parameter pack, // so is not required to be the last template parameter. template class ...Bs, typename ...Cs> struct Inner { struct Check : Bs... { Check(Cs...); }; }; }; template struct TemplateInt {}; template struct TemplateChar {}; template struct TemplateIntPtr {}; int x; Outer:: Inner<12345, 'x', &x, TemplateInt, TemplateChar, TemplateIntPtr, int*>:: Check check(&x); template struct types; enum place { _ }; template struct places {}; template struct append_places; template struct append_places, places> { typedef places type; }; template struct make_places : append_places::type, typename make_places::type> {}; template<> struct make_places<0> { typedef places<> type; }; template<> struct make_places<1> { typedef places<_> type; }; template struct wrap { template struct inner { typedef T type; }; }; template struct takedrop_impl; template struct takedrop_impl> { template class ...Take, template class ...Drop> struct inner { // expected-note 2{{declared}} typedef types::type...> take; typedef types::type...> drop; }; }; template struct take { using type = typename takedrop_impl::type>:: template inner::template inner...>::take; // expected-error {{too few template arguments}} }; template struct drop { using type = typename takedrop_impl::type>:: template inner::template inner...>::drop; // expected-error {{too few template arguments}} }; using T1 = take<3, int, char, double, long>::type; // expected-note {{previous}} // FIXME: Desguar the types on the RHS in this diagnostic. // desired-error {{'types' vs 'types'}} using T1 = types; // expected-error {{'types' vs 'types::type, typename inner<_>::type, typename inner<_>::type, (no argument)>'}} using D1 = drop<3, int, char, double, long>::type; using D1 = types; using T2 = take<4, int, char, double, long>::type; // expected-note {{previous}} // FIXME: Desguar the types on the RHS in this diagnostic. // desired-error {{'types' vs 'types'}} using T2 = types; // expected-error {{'types' vs 'types::type, typename inner<_>::type, typename inner<_>::type, typename inner<_>::type>'}} using T2 = types; using D2 = drop<4, int, char, double, long>::type; using D2 = types<>; using T3 = take<5, int, char, double, long>::type; // expected-note {{in instantiation of}} using D3 = drop<5, int, char, double, long>::type; // expected-note {{in instantiation of}} // FIXME: We should accept this code. A parameter pack within a default argument // in a template template parameter pack is expanded, because the pack is // implicitly a pack expansion. template struct DefArg { template class ...Classes> struct Inner { // expected-error {{default argument contains unexpanded parameter pack}} expected-note {{here}} Inner(Classes<>...); // expected-error {{too few}} }; }; template struct vector {}; template struct list {}; vector vi; list lc; DefArg::Inner defarg(vi, lc); // FIXME: // A template parameter pack that is a pack expansion shall not expand a // parameter pack declared in the same template-parameter-list. template void error(); // desired-error // This case should not produce an error, because in A's instantiation, Cs is // not a parameter pack. template void consume(Ts...); template struct A { template class ...Cs, Cs ...Vs> struct B { // ok B() { consume([]{ int arr[Vs]; // expected-error {{negative size}} }...); } }; }; template using Int = int; template using Char = char; A::B b; // expected-note {{here}} } namespace PR9023 { template struct A { template class ...> struct B { }; }; template struct C { }; template struct D { }; int main() { A::B e; } } namespace std_examples { template class Tuple; template struct multi_array; template struct value_holder { template struct apply { }; }; template struct static_array; // expected-error {{must be the last}} int n; value_holder::apply<12345, 'x', &n> test; }