aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ADT
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
commitc883ad2dd8d4861f6c2cbc89f079152a159778c8 (patch)
tree78b5646ecb8c95b1fd4e1d597d4ae82375bca5d6 /unittests/ADT
parente4d4c43cc8f446d63ba3b0e94894f0934c4a9a99 (diff)
downloadexternal_llvm-c883ad2dd8d4861f6c2cbc89f079152a159778c8.zip
external_llvm-c883ad2dd8d4861f6c2cbc89f079152a159778c8.tar.gz
external_llvm-c883ad2dd8d4861f6c2cbc89f079152a159778c8.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r--unittests/ADT/StringRefTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/unittests/ADT/StringRefTest.cpp b/unittests/ADT/StringRefTest.cpp
index 19665df..6507c20 100644
--- a/unittests/ADT/StringRefTest.cpp
+++ b/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"));