p14.cpp revision 8e8fb3be5bd78f0564444eca02b404566a5f3b5d
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s 2// expected-no-diagnostics 3 4template<typename T> struct identity; 5template<typename ...Types> struct tuple; 6 7template<typename T, typename U> struct is_same { 8 static const bool value = false; 9}; 10 11template<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 22template<typename T, typename ...Types> 23struct 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