Skip to content

Commit f37c241

Browse files
[Clang] Set the final date for workaround for libstdc++'s format_kind (#140831)
We can use 20250520 as the final date, see the following commits. - GCC releases/gcc-15 branch: - https://gcc.gnu.org/g:fedf81ef7b98e5c9ac899b8641bb670746c51205 - https://gcc.gnu.org/g:53680c1aa92d9f78e8255fbf696c0ed36f160650 - GCC master branch: - https://gcc.gnu.org/g:9361966d80f625c5accc25cbb439f0278dd8b278 - https://gcc.gnu.org/g:c65725eccbabf3b9b5965f27fff2d3b9f6c75930 Follows-up #139560.
1 parent 2d956d2 commit f37c241

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4370,7 +4370,15 @@ static bool IsLibstdcxxStdFormatKind(Preprocessor &PP, VarDecl *Var) {
43704370
const Token &RevisionDateTok = MacroGLIBCXX->getReplacementToken(0);
43714371
bool Invalid = false;
43724372
std::string RevisionDate = PP.getSpelling(RevisionDateTok, &Invalid);
4373-
StringRef FixDate = "30251231";
4373+
4374+
// We can use 20250520 as the final date, see the following commits.
4375+
// GCC releases/gcc-15 branch:
4376+
// https://gcc.gnu.org/g:fedf81ef7b98e5c9ac899b8641bb670746c51205
4377+
// https://gcc.gnu.org/g:53680c1aa92d9f78e8255fbf696c0ed36f160650
4378+
// GCC master branch:
4379+
// https://gcc.gnu.org/g:9361966d80f625c5accc25cbb439f0278dd8b278
4380+
// https://gcc.gnu.org/g:c65725eccbabf3b9b5965f27fff2d3b9f6c75930
4381+
StringRef FixDate = "20250520";
43744382

43754383
if (Invalid)
43764384
return false;
@@ -4381,9 +4389,7 @@ static bool IsLibstdcxxStdFormatKind(Preprocessor &PP, VarDecl *Var) {
43814389
//
43824390
// Checking old versions of libstdc++ is not needed because 15.1 is the first
43834391
// release in which users can access std::format_kind.
4384-
//
4385-
// FIXME: Correct FixDate once the issue is fixed.
4386-
return RevisionDate.size() == 8 && RevisionDate <= FixDate;
4392+
return RevisionDate.size() == 8 && RevisionDate < FixDate;
43874393
}
43884394
} // end anonymous namespace
43894395

0 commit comments

Comments
 (0)