This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Fix cp_parser_direct_declarator (PR c++/29886)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]