* decl.c (grokdeclarator): Do not allow parameters with variably
modified types.
PR c++/9749
* g++.dg/parse/varmod1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63250
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
* search.c (bfs_walk_grow): Remove. Fold into ...
type = error_mark_node;
}
- if (decl_context == FIELD
+ if ((decl_context == FIELD || decl_context == PARM)
&& !processing_template_decl
&& 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;
}
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
* g++.dg/template/op1.C: New test.
--- /dev/null
+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;
+}