Workaround what I believe is an MSVC bug where it emits a definition for a
authorDaniel Dunbar <daniel@zuster.org>
Tue, 22 Sep 2009 03:34:40 +0000 (03:34 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 22 Sep 2009 03:34:40 +0000 (03:34 +0000)
static const class member into each translation unit, with external linkage???
 - If someone understands this issue better, please clue me in, I haven't
   consulted the standard yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82516 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/StringRef.cpp

index a4c0e87c28eacd1574f4f1bc4da72b334d262bc4..deaa19efe998632d21797544d0f7a27572f395f5 100644 (file)
 #include "llvm/ADT/StringRef.h"
 using namespace llvm;
 
+// MSVC emits references to this into the translation units which reference it.
+#ifndef _MSC_VER
 const size_t StringRef::npos;
+#endif
 
 //===----------------------------------------------------------------------===//
 // String Searching