diff --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h --- a/flang/lib/Semantics/check-directive-structure.h +++ b/flang/lib/Semantics/check-directive-structure.h @@ -280,9 +280,9 @@ context_, directiveSource, directive, ContextDirectiveAsFortran()}; parser::Walk(block, noBranchingEnforce); + auto construct{parser::ToUpperCaseLetters(getDirectiveName(directive).str())}; LabelEnforce directiveLabelEnforce{context_, noBranchingEnforce.labels(), - directiveSource, - parser::ToUpperCaseLetters(getDirectiveName(directive).str()).c_str()}; + directiveSource, construct.c_str()}; parser::Walk(block, directiveLabelEnforce); }