[llvm-commits] [llvm] r92146 - /llvm/trunk/unittests/ADT/StringRefTest.cpp
Douglas Gregor
dgregor at apple.com
Thu Dec 24 13:15:37 PST 2009
Author: dgregor
Date: Thu Dec 24 15:15:37 2009
New Revision: 92146
URL: http://llvm.org/viewvc/llvm-project?rev=92146&view=rev
Log:
Move the two definitions of operator<< into namespace llvm, so they
will be found by argument-dependent lookup. As with the previous
commit, GCC is allowing ill-formed code.
Modified:
llvm/trunk/unittests/ADT/StringRefTest.cpp
Modified: llvm/trunk/unittests/ADT/StringRefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringRefTest.cpp?rev=92146&r1=92145&r2=92146&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/StringRefTest.cpp (original)
+++ llvm/trunk/unittests/ADT/StringRefTest.cpp Thu Dec 24 15:15:37 2009
@@ -13,7 +13,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-namespace {
+namespace llvm {
std::ostream &operator<<(std::ostream &OS, const StringRef &S) {
OS << S;
@@ -26,6 +26,9 @@
return OS;
}
+}
+
+namespace {
TEST(StringRefTest, Construction) {
EXPECT_EQ("", StringRef());
EXPECT_EQ("hello", StringRef("hello"));
More information about the llvm-commits
mailing list