Core 1609

Core 1609
	* decl2.c (check_default_args): Check for pack expansion.

From-SVN: r198152
This commit is contained in:
Jason Merrill 2013-04-22 14:50:35 -04:00 committed by Jason Merrill
parent a7ddca92d6
commit c10f41938a
3 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2013-04-22 Jason Merrill <jason@redhat.com>
Core 1609
* decl2.c (check_default_args): Check for pack expansion.
* mangle.c (write_type): Mangle decltype(auto).
2013-04-19 Jason Merrill <jason@redhat.com>

View File

@ -4463,7 +4463,7 @@ check_default_args (tree x)
{
if (TREE_PURPOSE (arg))
saw_def = true;
else if (saw_def)
else if (saw_def && !PACK_EXPANSION_P (TREE_VALUE (arg)))
{
error ("default argument missing for parameter %P of %q+#D", i, x);
TREE_PURPOSE (arg) = error_mark_node;

View File

@ -0,0 +1,9 @@
// Core 1609
// { dg-require-effective-target c++11 }
template<typename... T>
void f2(int a = 0, T... b, int c = 1);
int main(){
f2<>(); // parameter a has the value 0 and parameter c has the value 1
}