Commit 2fff6d71 by Mark Mitchell Committed by Mark Mitchell

re PR c++/9749 (ICE in write_expression on invalid function prototype)

	PR c++/9749
	* decl.c (grokdeclarator): Do not allow parameters with variably
	modified types.

	PR c++/9749
	* g++.dg/parse/varmod1.C: New test.

From-SVN: r63250
parent 9809a362
2003-02-21 Mark Mitchell <mark@codesourcery.com>
PR c++/9749
* decl.c (grokdeclarator): Do not allow parameters with variably
modified types.
2003-02-21 Nathan Sidwell <nathan@codesourcery.com> 2003-02-21 Nathan Sidwell <nathan@codesourcery.com>
* search.c (bfs_walk_grow): Remove. Fold into ... * search.c (bfs_walk_grow): Remove. Fold into ...
......
...@@ -11085,11 +11085,14 @@ grokdeclarator (tree declarator, ...@@ -11085,11 +11085,14 @@ grokdeclarator (tree declarator,
type = error_mark_node; type = error_mark_node;
} }
if (decl_context == FIELD if ((decl_context == FIELD || decl_context == PARM)
&& !processing_template_decl && !processing_template_decl
&& variably_modified_type_p (type)) && variably_modified_type_p (type))
{ {
error ("data member may not have variably modified type `%T'", type); if (decl_context == FIELD)
error ("data member may not have variably modified type `%T'", type);
else
error ("parameter may not have variably modified type `%T'", type);
type = error_mark_node; type = error_mark_node;
} }
......
2003-02-21 Mark Mitchell <mark@codesourcery.com> 2003-02-21 Mark Mitchell <mark@codesourcery.com>
PR c++/9749
* g++.dg/parse/varmod1.C: New test.
2003-02-21 Mark Mitchell <mark@codesourcery.com>
PR c++/9727 PR c++/9727
* g++.dg/template/op1.C: New test. * g++.dg/template/op1.C: New test.
......
int main(int argc, char** argv) {
int nx = 2;
void theerror(double a[][nx+1]); // { dg-error "" }
double** a;
theerror(a); // { dg-error "" }
return 0;
}
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