clang: Update libstdc++ issue workaround

Add some specificity to libstdc++ hack, perhaps we can remove it at a
later date.
This commit is contained in:
Nathan Sidwell 2021-04-16 12:34:30 -07:00
parent 1668ace948
commit 057b6f5d0b
1 changed files with 3 additions and 4 deletions

View File

@ -12134,10 +12134,9 @@ NamedDecl *Sema::BuildUsingDeclaration(
// invalid).
if (R.empty() &&
NameInfo.getName().getNameKind() != DeclarationName::CXXConstructorName) {
// HACK: Work around a bug in libstdc++'s detection of ::gets. Sometimes
// it will believe that glibc provides a ::gets in cases where it does not,
// and will try to pull it into namespace std with a using-declaration.
// Just ignore the using-declaration in that case.
// HACK 2017-01-08: Work around an issue with libstdc++'s detection of
// ::gets. Sometimes it believes that glibc provides a ::gets in cases where
// it does not. The issue was fixed in libstdc++ 6.3 (2016-12-21) and later.
auto *II = NameInfo.getName().getAsIdentifierInfo();
if (getLangOpts().CPlusPlus14 && II && II->isStr("gets") &&
CurContext->isStdNamespace() &&