cca icon indicating copy to clipboard operation
cca copied to clipboard

[cpp] parser failures

Open petr-bauch opened this issue 1 year ago • 2 comments

We found a few more parser failures you might be interested in:

int main() {
  int func(int x);
  int result = ((func))(3) - 3; // fails here
}
int main() {
  struct S f;
  s += ((*((f)->function))(1, (f)->params) + (*((f)->function))(1, (f)->params)); // fails here
}
int main() {
  void(b ? (void)printf("IPTV1: ") : void()); // fails here
}
int main() {
  auto var = new ("text", 61, FUNC) int(); // fails here
}
int main() {
  int status;
  // this enters an infinite loop printing a message
  do {
#ifdef A
  } while (status & A);
#elif defined(B)
  } while (status & B);
#else
  } while (status & 3);
#endif
}
int main() {
  bool btf;
  int (*pfunc)(int, int);
  for (; btf && (*pfunc)(0, 0);) // fails here
    ;
}
int main() {
  int isize = 3;
  assert((isize == sizeof(unsigned int)) && ("")); // fails here
}
int main()  {
  int block_size = 3, block_count = 4;
  rt_malloc((block_size + sizeof(int *)) * block_count); // fails here
}
int main() {
  if (((size_t)sizeof(double)) & (((size_t)sizeof(double)) - 1)) // fails here
    ;
}
int(params_allocation)[7]; // fails here
int main() {}

petr-bauch avatar Aug 14 '24 06:08 petr-bauch

Thank you for reporting. We will look into them.

codinuum avatar Aug 16 '24 00:08 codinuum

The latest fix (c86e9dda91b680c46389ac6fad1472162e778ed5) works for them.

codinuum avatar Aug 27 '24 01:08 codinuum

Sorry for the late reply, this looks great. Thank you.

petr-bauch avatar Oct 29 '24 06:10 petr-bauch