From c827d9ee0e540481cb1e32e081cc5a4777437ee9 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 22 Sep 2009 03:34:40 +0000 Subject: Workaround what I believe is an MSVC bug where it emits a definition for a 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. llvm-svn: 82516 --- llvm/lib/Support/StringRef.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Support/StringRef.cpp') diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp index a4c0e87..deaa19e 100644 --- a/llvm/lib/Support/StringRef.cpp +++ b/llvm/lib/Support/StringRef.cpp @@ -10,7 +10,10 @@ #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 -- cgit v1.1