Core 1609
Core 1609 * decl2.c (check_default_args): Check for pack expansion. From-SVN: r198152
This commit is contained in:
parent
a7ddca92d6
commit
c10f41938a
@ -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>
|
||||
|
@ -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;
|
||||
|
9
gcc/testsuite/g++.dg/cpp0x/variadic142.C
Normal file
9
gcc/testsuite/g++.dg/cpp0x/variadic142.C
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user