tools/check-moz-style/tests/test4.cpp
author Phil Ringnalda <philringnalda@gmail.com>
Fri, 30 Sep 2016 23:24:52 -0700
changeset 316107 fcc62bbf09eecabf27c8d198d5d3719e16b296ea
parent 265638 2c0d1469d2bffa2cd75d6a4696957335d7e6b648
permissions -rw-r--r--
Merge m-i to m-c, a=merge

class ShouldUseExplicit {
  // runtime/explicit
  ShouldUseExplicit(int i);
};

// readability/function
int foo(int) {
}

int main() {
  int i = 0;

  // readability/control_flow
  // XXX This doesn't trigger it. It needs to be fixed.
  if (i) {
    return;
  } else {
    i++;
  }

  // whitespace/parens
  if(i){}

  // readability/casting
  void* bad = (void*)i;

  // readability/comparison_to_zero
  if (i == true) {}
  if (i == false) {}
  if (i != true) {}
  if (i != false) {}
  if (i == NULL) {}
  if (i != NULL) {}
  if (i == nullptr) {}
  if (i != nullptr) {}
  if (i) {}
  if (!i) {}

  return 0;
}