[cfe-dev] Cast to type with side effects

Abramo Bagnara abramo.bagnara at gmail.com
Wed Sep 22 08:13:35 PDT 2010


int g();

int main() {
  //  enum { x = (g(), 0) };
  enum { x = (int)(int(*)[g()])0 };
  return 0;
}

Constant expression evaluator seems to (wrongly IMHO) believe that types
cannot have side effects.

Do you confirm we have a bug here?



More information about the cfe-dev mailing list