Skip to content

Commit 8a84596

Browse files
authored
[flang] Dodge bogus GCC 13.2.0 error message in new code (#86708)
Rearrange some new code a little bit to avoid a bogus error message coming out from GCC 13.2.0 about an uninitialized data member in a parser.
1 parent 8ea94b6 commit 8a84596

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

flang/include/flang/Parser/parse-tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3317,7 +3317,7 @@ struct CompilerDirective {
33173317
TUPLE_CLASS_BOILERPLATE(NameValue);
33183318
std::tuple<Name, std::optional<std::uint64_t>> t;
33193319
};
3320-
struct Unrecognized {};
3320+
EMPTY_CLASS(Unrecognized);
33213321
CharBlock source;
33223322
std::variant<std::list<IgnoreTKR>, LoopCount, std::list<AssumeAligned>,
33233323
std::list<NameValue>, Unrecognized>

flang/lib/Parser/Fortran-parsers.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,8 @@ TYPE_PARSER(beginDirective >> "DIR$ "_tok >>
12801280
many(construct<CompilerDirective::NameValue>(
12811281
name, maybe(("="_tok || ":"_tok) >> digitString64))))) /
12821282
endOfStmt ||
1283-
construct<CompilerDirective>(
1284-
SkipTo<'\n'>{} >> pure<CompilerDirective::Unrecognized>()) /
1285-
endOfStmt))
1283+
construct<CompilerDirective>(pure<CompilerDirective::Unrecognized>()) /
1284+
SkipTo<'\n'>{}))
12861285

12871286
TYPE_PARSER(extension<LanguageFeature::CrayPointer>(
12881287
"nonstandard usage: based POINTER"_port_en_US,

0 commit comments

Comments
 (0)