================ @@ -6953,6 +6954,27 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) { return false; } + if (getASTContext().getTargetInfo().getTriple().isOSSolaris()) { + if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND)) { + if (!isStdNamespace(Context.getEffectiveDeclContext(RD))) + return false; + + // Issue #33114: Need non-standard mangling of std::tm etc. for + // Solaris ABI compatibility. + static std::set<StringRef> types{"div_t", "ldiv_t", "lconv", "tm"}; + + // <substitution> ::= tm # ::std::tm, same for the others + if (const IdentifierInfo *II = RD->getIdentifier()) { + StringRef type = II->getName(); + if (types.count(type)) { ---------------- cor3ntin wrote:
```suggestion if (llvm::is_contained({"div_t", "ldiv_t", "lconv", "tm"}, type)) { ``` using a std::set is a bit overkill here https://github.com/llvm/llvm-project/pull/106353 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits