aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-24 21:15:37 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-24 21:15:37 +0000
commit4ee2cf658ce4e27a1d0b517d97cb6339ff566684 (patch)
tree9c3a86a74a7d32c2152651b55f0cdb7823e71ecc /llvm/unittests/ADT/StringRefTest.cpp
parentbfb3671b25fd5c4fa52640fd583f84cfadf81fcd (diff)
downloadllvm-4ee2cf658ce4e27a1d0b517d97cb6339ff566684.zip
llvm-4ee2cf658ce4e27a1d0b517d97cb6339ff566684.tar.gz
llvm-4ee2cf658ce4e27a1d0b517d97cb6339ff566684.tar.bz2
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. llvm-svn: 92146
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index 19665df..6507c20 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -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 @@ std::ostream &operator<<(std::ostream &OS,
return OS;
}
+}
+
+namespace {
TEST(StringRefTest, Construction) {
EXPECT_EQ("", StringRef());
EXPECT_EQ("hello", StringRef("hello"));