Commit 17e87c1c by Jason Merrill Committed by Jason Merrill

re PR c++/63522 (ICE: unexpected expression 'ElementIndices' of kind template_parm_index)

	PR c++/63522
	* parser.c (cp_parser_type_parameter): Call
	check_for_bare_parameter_packs on default argument.

From-SVN: r219066
parent 9a5757a0
2014-12-25 Jason Merrill <jason@redhat.com>
PR c++/63522
* parser.c (cp_parser_type_parameter): Call
check_for_bare_parameter_packs on default argument.
2014-12-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63985
......
......@@ -13499,6 +13499,8 @@ cp_parser_type_parameter (cp_parser* parser, bool *is_parameter_pack)
"default arguments");
default_argument = NULL_TREE;
}
else if (check_for_bare_parameter_packs (default_argument))
default_argument = error_mark_node;
pop_deferring_access_checks ();
}
else
......
// PR c++/63522
// { dg-do compile { target c++11 } }
template <typename...> struct tuple;
template <typename...> void slice();
template <int Index, typename...> using slice_result = decltype(slice<Index>);
template <typename Tuple, typename... Tuples, int... ElementIndices,
typename =
typename tuple<slice_result<ElementIndices, Tuples...>,
slice_result<ElementIndices, Tuples...>...>::type> // { dg-error "parameter pack" }
void zip_with(Tuple...);
decltype(zip_with(0)) d; // { dg-error "no match" }
// { dg-do compile { target c++11 } }
template<typename... T, typename = T> struct A {}; // { dg-error "must be at the end" }
template<typename... T, typename = T> struct A {}; // { dg-error "parameter pack" }
template<template<typename... T, typename = T> class U> struct B // { dg-error "must be at the end" }
template<template<typename... T, typename = T> class U> struct B // { dg-error "parameter pack" }
{
template<int> U<int> foo(); // { dg-error "mismatch|constant|invalid|invalid" }
template<int> U<int> foo(); // { dg-error "mismatch|constant|wrong|invalid" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment