Skip to content

Commit eb05a2e

Browse files
[Flang] Add fallthrough annotations in visit.h (#90014)
Add fallthrough annotations to avoid warnings if -Wimplicit-fallthrough is enabled. Test plan: ninja check-all
1 parent d3c9a97 commit eb05a2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

flang/include/flang/Common/visit.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "variant.h"
2525
#include "flang/Common/api-attrs.h"
26+
#include "llvm/Support/Compiler.h"
2627
#include <type_traits>
2728

2829
namespace Fortran::common {
@@ -40,11 +41,17 @@ inline RT_API_ATTRS RESULT Log2VisitHelper(
4041
return visitor(std::get<(LOW + N)>(std::forward<VARIANT>(u))...); \
4142
}
4243
VISIT_CASE_N(1)
44+
LLVM_FALLTHROUGH;
4345
VISIT_CASE_N(2)
46+
LLVM_FALLTHROUGH;
4447
VISIT_CASE_N(3)
48+
LLVM_FALLTHROUGH;
4549
VISIT_CASE_N(4)
50+
LLVM_FALLTHROUGH;
4651
VISIT_CASE_N(5)
52+
LLVM_FALLTHROUGH;
4753
VISIT_CASE_N(6)
54+
LLVM_FALLTHROUGH;
4855
VISIT_CASE_N(7)
4956
#undef VISIT_CASE_N
5057
}

0 commit comments

Comments
 (0)