fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Wrapper {
  5. operator bool() { return true; }
  6. };
  7.  
  8. int main() {
  9. if (auto x = Wrapper{}) {}
  10. Wrapper w;
  11. if (w) {}
  12. int a[10];
  13. a[w] = 123;
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
Standard output is empty