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