From: Aaron Ballman Date: Fri, 14 Nov 2014 20:31:50 +0000 (+0000) Subject: MinGW doesn't implement std::to_string; working around it. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac7d62cc87a657a0b8d44a52312ebe6641153aaf;p=clang MinGW doesn't implement std::to_string; working around it. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222033 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index 71b5c3650f..efb0b9b906 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -1880,8 +1880,13 @@ static void GenerateHasAttrSpellingStringSwitch( // present in the caller. Test = "LangOpts.CPlusPlus11"; + // FIXME: When MinGW support is dropped, or they gain support for + // std::to_string, this hack can be dropped as well. + std::stringstream ss; + ss << Version; + std::string TestStr = - !Test.empty() ? Test + " ? " + std::to_string(Version) + " : 0" : "1"; + !Test.empty() ? Test + " ? " + ss.str() + " : 0" : "1"; std::vector Spellings = GetFlattenedSpellings(*Attr); for (const auto &S : Spellings) if (Variety.empty() || (Variety == S.variety() &&