Commit 1941b0ca by Marc Glisse Committed by Jason Merrill

re PR c++/51314 ([C++0x] sizeof... and parentheses)

	PR c++/51314
	* parser.c (cp_parser_sizeof_operand): Require parentheses for
	sizeof...

From-SVN: r186988
parent 81b95894
2012-04-30 Marc Glisse <marc.glisse@inria.fr>
PR c++/51314
* parser.c (cp_parser_sizeof_operand): Require parentheses for
sizeof...
2012-04-30 Dodji Seketeli <dodji@redhat.com>
Fix location for static class members
......
......@@ -21969,6 +21969,9 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
/*attrlist=*/NULL);
}
}
else if (pack_expansion_p)
permerror (cp_lexer_peek_token (parser->lexer)->location,
"%<sizeof...%> argument must be surrounded by parentheses");
/* If the type-id production did not work out, then we must be
looking at the unary-expression production. */
......
2012-04-30 Marc Glisse <marc.glisse@inria.fr>
PR c++/51314
* g++.dg/cpp0x/vt-51314.C: New test.
* g++.dg/cpp0x/variadic76.C: Fix.
2012-04-30 Greta Yorsh <Greta.Yorsh@arm.com>
* gcc.dg/pr52283.c: Add missing dg-warning and dg-options.
......
......@@ -4,7 +4,8 @@
template<int... N> int foo ()
{
return sizeof... N (); // { dg-error "cannot be used as a function" }
return sizeof... (N ()); // { dg-error "cannot be used as a function" }
return sizeof... (N) (); // { dg-error "cannot be used as a function" }
}
int bar ()
......
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