Debian Codegraph @

clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp

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