[PATCH] D24905: Fix unreachable code false positive, vardecl in switch

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 30 11:37:32 PDT 2016


dcoughlin added a comment.

Sorry, missed this patch.

I think it would good to add a test to make sure we do warn when the var decl has an initializer, since that will not be executed.

  void varDecl(int X) {
    switch (X) {
      int A = 12; // We do want a warning here, since the variable will be uninitialized in C (This is not allowed in C++).
    case 1:
      ...
      break;
    }
  }


Repository:
  rL LLVM

https://reviews.llvm.org/D24905





More information about the cfe-commits mailing list