r222033 - MinGW doesn't implement std::to_string; working around it. NFC.

Aaron Ballman aaron at aaronballman.com
Fri Nov 14 12:31:50 PST 2014


Author: aaronballman
Date: Fri Nov 14 14:31:50 2014
New Revision: 222033

URL: http://llvm.org/viewvc/llvm-project?rev=222033&view=rev
Log:
MinGW doesn't implement std::to_string; working around it. NFC.

Modified:
    cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp

Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=222033&r1=222032&r2=222033&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Fri Nov 14 14:31:50 2014
@@ -1880,8 +1880,13 @@ static void GenerateHasAttrSpellingStrin
       // 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<FlattenedSpelling> Spellings = GetFlattenedSpellings(*Attr);
     for (const auto &S : Spellings)
       if (Variety.empty() || (Variety == S.variety() &&





More information about the cfe-commits mailing list