2007-09-05 Paolo Carlini <pcarlini@suse.de>
PR c++/29731 (again)
* parser.c (cp_parser_primary_expression): Return error_mark_node
when a statement-expression is found in a template-argument list.
/testsuite
2007-09-05 Paolo Carlini <pcarlini@suse.de>
PR c++/29731
* g++.dg/parse/template24.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128124
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-09-05 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/29731 (again)
+ * parser.c (cp_parser_primary_expression): Return error_mark_node
+ when a statement-expression is found in a template-argument list.
+
2007-09-04 Jason Merrill <jason@redhat.com>
PR c++/31419
int i = ({ int j = 3; j + 1; });
at class or namespace scope. */
- if (!parser->in_function_body)
+ if (!parser->in_function_body
+ || parser->in_template_argument_list_p)
{
- error ("statement-expressions are allowed only inside functions");
+ error ("statement-expressions are not allowed outside "
+ "functions nor in template-argument lists");
cp_parser_skip_to_end_of_block_or_statement (parser);
expr = error_mark_node;
}
+2007-09-05 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/29731
+ * g++.dg/parse/template24.C: New.
+
2007-09-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
* g++.dg/other/spu2vmx-1.C: New test.
--- /dev/null
+/* PR c++/29731. This used to ICE in uses_template_parms. */
+
+template<int> struct A {};
+
+void foo()
+{
+ A<({})> a; /* { dg-error "forbids braced-groups within expressions|statement-expressions|template argument 1 is invalid|invalid type" } */
+}