aaron.ballman added a comment.

This seems like a case where we might want a configuration option (maybe). Some 
of the test cases where you silence the diagnostic look like places I would 
expect us to be able to use a (local) enumeration. e.g.,
  void g(int x)
  {
    if (x != 0) {
  #define INSIDE1 1
  #define INSIDE2 2
  // No reason the above can't be replaced with enum { INSIDE1 = 1, INSIDE2 = 2 
};
      if (INSIDE1 > 1) {
        f();
      }
    } else {
      if (INSIDE2 == 1) {
        f();
      }
    }
  }
  
  struct S {
  #define INSIDE5 5
  #define INSIDE6 6
  // The above could reasonably be: enum { INSIDE5 = 5, INSIDE6 = 6 }; 
especially in C++
    char storage[INSIDE5];
  };

WDYT?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124066/new/

https://reviews.llvm.org/D124066

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to