Skip to content

Commit 444ee46

Browse files
banach-spacememfrob
authored andcommitted
[Flang] Fix build failures (NFC)
Some changes introduced in https://reviews.llvm.org/D88655 cause compiler warnings. Since in Flang warnings are treated as errors (`-Werror` is on by default), these are in practice compiler errors (verified with clang-10 and clang-11, gcc-10). This patches fixes these warning/failures. Warning/error 1: ``` llvm-project/flang/lib/Semantics/check-omp-structure.cpp:107:3: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] ``` Warning/error 2: ``` llvm-project/flang/lib/Semantics/check-directive-structure.h:39:9: error: field 'currentDirective_' will be initialized after field 'upperCaseDirName_' [-Werror,-Wreorder-ctor] ``` Failing buildbot: * http://lab.llvm.org:8011/#/builders/33/builds/386
1 parent ecd1f83 commit 444ee46

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

flang/lib/Semantics/check-directive-structure.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ template <typename D> class NoBranchingEnforce {
3636
parser::CharBlock sourcePosition, D directive,
3737
std::string &&upperCaseDirName)
3838
: context_{context}, sourcePosition_{sourcePosition},
39-
currentDirective_{directive}, upperCaseDirName_{
40-
std::move(upperCaseDirName)} {}
39+
upperCaseDirName_{std::move(upperCaseDirName)}, currentDirective_{
40+
directive} {}
4141
template <typename T> bool Pre(const T &) { return true; }
4242
template <typename T> void Post(const T &) {}
4343

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ void OmpStructureChecker::Enter(const parser::OpenMPBlockConstruct &x) {
104104
switch (beginDir.v) {
105105
case llvm::omp::OMPD_parallel:
106106
CheckNoBranching(block, llvm::omp::OMPD_parallel, beginDir.source);
107+
break;
107108
default:
108109
break;
109110
}

0 commit comments

Comments
 (0)