This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix cp_parser_direct_declarator (PR c++/29886)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Nov 2006 11:38:33 -0500
- Subject: Re: [C++ PATCH] Fix cp_parser_direct_declarator (PR c++/29886)
- References: <20061123162600.GN6570@devserv.devel.redhat.com> <4565CCEA.9060700@lu.unisi.ch>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Nov 23, 2006 at 05:31:38PM +0100, Paolo Bonzini wrote:
> >+int A::z[(3, 2)]; // { dg-error "array bound is not an integer
> >constant" }
> >+
> >+void
> >+foo (int i)
> >+{
> >+ int j = int (A::x[i]);
> >+ switch (int (A::x[i])) {}
> >+ if (int (A::x[i])) {}
> >+ j = int (y[i]);
> >+ switch (int (y[i])) {}
> >+ if (int (y[i])) {}
> >+}
>
> What do you think about testing explicitly with dg-bogus on these lines?
Good idea, works just fine:
--- gcc/testsuite/g++.dg/parse/array1.C~ 2006-11-23 17:36:15.000000000 +0100
+++ gcc/testsuite/g++.dg/parse/array1.C 2006-11-23 17:36:15.000000000 +0100
@@ -16,8 +16,8 @@ void
foo (int i)
{
int j = int (A::x[i]);
- switch (int (A::x[i])) {}
- if (int (A::x[i])) {}
+ switch (int (A::x[i])) {} // { dg-bogus "array bound is not an integer constant" }
+ if (int (A::x[i])) {} // { dg-bogus "array bound is not an integer constant" }
j = int (y[i]);
switch (int (y[i])) {}
if (int (y[i])) {}
Jakub