================ @@ -713,11 +714,21 @@ std::string PredefinedExpr::ComputeName(PredefinedIdentKind IK, return std::string(Out.str()); } if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(CurrentDecl)) { - if (IK != PredefinedIdentKind::PrettyFunction && - IK != PredefinedIdentKind::PrettyFunctionNoVirtual && - IK != PredefinedIdentKind::FuncSig && - IK != PredefinedIdentKind::LFuncSig) - return FD->getNameAsString(); + const auto &LO = Context.getLangOpts(); + if (ForceElaboratedPrinting) { + if ((IK == PredefinedIdentKind::Func || + IK == PredefinedIdentKind ::Function) && + !LO.MicrosoftExt) + return FD->getNameAsString(); + if (IK == PredefinedIdentKind::LFunction && LO.MicrosoftExt) + return FD->getNameAsString(); + } else { + if (IK != PredefinedIdentKind::PrettyFunction && + IK != PredefinedIdentKind::PrettyFunctionNoVirtual && + IK != PredefinedIdentKind::FuncSig && + IK != PredefinedIdentKind::LFuncSig) + return FD->getNameAsString(); + } ---------------- AaronBallman wrote:
These are all doing the same thing -- calling `FD->getNameAsString()`; can we simplify the logic? https://github.com/llvm/llvm-project/pull/67592 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits