Skip to content

Commit

Permalink
[clang] Update comments on another libstdc++ HACK
Browse files Browse the repository at this point in the history
Document relevant gcc versions and dates.

Differential Revision: https://reviews.llvm.org/D101530
  • Loading branch information
urnathan committed Apr 30, 2021
1 parent 8989268 commit e90792d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
Expand Up @@ -856,10 +856,11 @@ Decl *TemplateDeclInstantiator::InstantiateTypedefNameDecl(TypedefNameDecl *D,
SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
}

// HACK: g++ has a bug where it gets the value kind of ?: wrong.
// libstdc++ relies upon this bug in its implementation of common_type.
// If we happen to be processing that implementation, fake up the g++ ?:
// semantics. See LWG issue 2141 for more information on the bug.
// HACK: 2012-10-23 g++ has a bug where it gets the value kind of ?: wrong.
// libstdc++ relies upon this bug in its implementation of common_type. If we
// happen to be processing that implementation, fake up the g++ ?:
// semantics. See LWG issue 2141 for more information on the bug. The bugs
// are fixed in g++ and libstdc++ 4.9.0 (2014-04-22).
const DecltypeType *DT = DI->getType()->getAs<DecltypeType>();
CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D->getDeclContext());
if (DT && RD && isa<ConditionalOperator>(DT->getUnderlyingExpr()) &&
Expand Down

0 comments on commit e90792d

Please sign in to comment.