p14.cpp revision a8bc8c9e9ba5bffebde00340786fe8542469c435
1// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
2
3template<typename T> struct identity;
4template<typename ...Types> struct tuple;
5
6template<typename T, typename U> struct is_same {
7  static const bool value = false;
8};
9
10template<typename T> struct is_same<T, T> {
11  static const bool value = true;
12};
13
14// There is a syntactic ambiguity when an ellipsis occurs at the end
15// of a parameter-declaration-clause without a preceding comma. In
16// this case, the ellipsis is parsed as part of the
17// abstract-declarator if the type of the parameter names a template
18// parameter pack that has not been expanded; otherwise, it is parsed
19// as part of the parameter-declaration-clause.
20
21template<typename T, typename ...Types>
22struct X0 {
23  typedef identity<T(Types...)> function_pack_1; // expected-error{{clang does not yet support function parameter packs}}
24  typedef identity<T(Types......)> variadic_function_pack_1;  // expected-error{{clang does not yet support function parameter packs}}
25  typedef identity<T(T...)> variadic_1;
26  typedef tuple<T(Types, ...)...> template_arg_expansion_1;
27};
28
29
30
31// FIXME: Once function parameter packs are implemented, we can test all of the disambiguation
32