[llvm-commits] [llvm] r82516 - /llvm/trunk/lib/Support/StringRef.cpp

Daniel Dunbar daniel at zuster.org
Mon Sep 21 22:34:41 CDT 2009


Author: ddunbar
Date: Mon Sep 21 22:34:40 2009
New Revision: 82516

URL: http://llvm.org/viewvc/llvm-project?rev=82516&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Support/StringRef.cpp

Modified: llvm/trunk/lib/Support/StringRef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StringRef.cpp?rev=82516&r1=82515&r2=82516&view=diff

==============================================================================
--- llvm/trunk/lib/Support/StringRef.cpp (original)
+++ llvm/trunk/lib/Support/StringRef.cpp Mon Sep 21 22:34:40 2009
@@ -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





More information about the llvm-commits mailing list