r225247 - Basic: fix compilation with MSVC

Saleem Abdulrasool compnerd at compnerd.org
Mon Jan 5 21:55:56 PST 2015


Author: compnerd
Date: Mon Jan  5 23:55:56 2015
New Revision: 225247

URL: http://llvm.org/viewvc/llvm-project?rev=225247&view=rev
Log:
Basic: fix compilation with MSVC

MSVC doesn't like the instantiation of the structure in the initializer list.
Initialize it in the constructor body to repair the build.

TargetInfo.h(545) : error C2143: syntax error : missing ')' before '{'
TargetInfo.h(545) : error C2143: syntax error : missing ';' before '}'
TargetInfo.h(545) : error C2059: syntax error : ')'
TargetInfo.h(545) : error C2059: syntax error : ','
TargetInfo.h(547) : error C2143: syntax error : missing ';' before '{'
TargetInfo.h(547) : error C2447: '{' : missing function header (old-style formal list?)

Modified:
    cfe/trunk/include/clang/Basic/TargetInfo.h

Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=225247&r1=225246&r2=225247&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Mon Jan  5 23:55:56 2015
@@ -543,8 +543,10 @@ public:
     std::string Name;           // Operand name: [foo] with no []'s.
   public:
     ConstraintInfo(StringRef ConstraintStr, StringRef Name)
-        : Flags(0), TiedOperand(-1), ImmRange({0, 0}),
-          ConstraintStr(ConstraintStr.str()), Name(Name.str()) {}
+        : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
+          Name(Name.str()) {
+      ImmRange.Min = ImmRange.Max = 0;
+    }
 
     const std::string &getConstraintStr() const { return ConstraintStr; }
     const std::string &getName() const { return Name; }





More information about the cfe-commits mailing list