https://llvm.org/bugs/show_bug.cgi?id=30636
Ahmed Asadi <ahmedasad...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |ahmedasad...@gmail.com Resolution|--- |INVALID --- Comment #1 from Ahmed Asadi <ahmedasad...@gmail.com> --- fun<false> gets instantiated to the following function: int fun(int i) { switch (i) { case 1: if (false) return 3; case 2: return 4; default: return 5; } } case 1 falls through to case 2, hence the warning. When you insert [[clang::fallthrough]], it isn't reachable in fun<true> because it will always hit 'return 3'. Clang produces valid warnings in both cases. I'm marking the bug as invalid. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs