brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ac9344d Raw
32 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s2 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 end15// of a parameter-declaration-clause without a preceding comma. In16// this case, the ellipsis is parsed as part of the17// abstract-declarator if the type of the parameter names a template18// parameter pack that has not been expanded; otherwise, it is parsed19// as part of the parameter-declaration-clause.20 21template<typename T, typename ...Types>22struct X0 {23  typedef identity<T(Types...)> function_pack_1;24  typedef identity<T(Types......)> variadic_function_pack_1; // expected-warning {{varargs}} expected-note {{pack}} expected-note {{insert ','}}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 disambiguation32