[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-09-19 Thread Davide Italiano via Phabricator via cfe-commits
davide added a comment.

This broke all the lldb bots as well, FWIW.


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-09-19 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment.

Reverted in r342599 .


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-09-19 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment.

Seems like revert didn't go through. I suspect it is causing build failure in 
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/49593/consoleText

  SANITIZER_TEST_OBJECTS.sanitizer_vector_test.cc.i386.o 
SANITIZER_TEST_OBJECTS.gtest-all.cc.i386.o 
/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/clang-build/tools/clang/runtime/compiler-rt-bins/lib/sanitizer_common/tests/libRTSanitizerCommon.test.osx.a
 -o 
/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/clang-build/tools/clang/runtime/compiler-rt-bins/lib/sanitizer_common/tests/./Sanitizer-i386-Test
 -g --driver-mode=g++ -stdlib=libc++ -lc++ -lc++abi -fapplication-extension 
-mmacosx-version-min=10.9 -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -Wl,-U,___sanitizer_free_hook -Wl,-U,___sanitizer_malloc_hook 
-Wl,-U,___sanitizer_report_error_summary -Wl,-U,___sanitizer_sandbox_on_notify 
-Wl,-U,___sanitizer_symbolize_code -Wl,-U,___sanitizer_symbolize_data 
-Wl,-U,___sanitizer_symbolize_demangle -Wl,-U,___sanitizer_symbolize_flush -ldl 
-pthread -arch i386
  Undefined symbols for architecture i386:
"std::__1::basic_ostream 
>::operator<<(std::nullptr_t)", referenced from:
std::__1::basic_string, 
std::__1::allocator > 
testing::PrintToString(std::nullptr_t const&) in 
SANITIZER_TEST_OBJECTS.sanitizer_quarantine_test.cc.i386.o
std::__1::basic_string, 
std::__1::allocator > 
testing::PrintToString(std::nullptr_t const&) in 
SANITIZER_TEST_OBJECTS.sanitizer_stacktrace_printer_test.cc.i386.o
  ld: symbol(s) not found for architecture i386
  clang-8: error: linker command failed with exit code 1 (use -v to see 
invocation)


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-09-19 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment.

Symbol added: _ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEDn

  {'is_defined': True, 'type': 'FUNC', 'name': 
'_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEDn'}

Symbol added: _ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEDn

  {'is_defined': True, 'type': 'FUNC', 'name': 
'_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEDn'}

Symbol added: 
_ZNSt3__1lsIwNS_11char_traitsIwRNS_13basic_ostreamIT_T0_EES7_PKc

  {'is_defined': True, 'type': 'FUNC', 'name': 
'_ZNSt3__1lsIwNS_11char_traitsIwRNS_13basic_ostreamIT_T0_EES7_PKc'}

Symbol added: 
_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcRNS_13basic_ostreamIT_T0_EES7_PKS4_m

  {'is_defined': True, 'type': 'FUNC', 'name': 
'_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcRNS_13basic_ostreamIT_T0_EES7_PKS4_m'}


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-09-19 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists reopened this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.

Reverted in r342590 while I investigate additions to the dylib.


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-09-19 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists closed this revision.
mclow.lists added a comment.

Landed as revision 342566


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-03-08 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith accepted this revision.
dexonsmith added a comment.
This revision is now accepted and ready to land.

LGTM.


https://reviews.llvm.org/D44263



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44263: Implement LWG 2221 - No formatted output operator for nullptr

2018-03-08 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists created this revision.
mclow.lists added reviewers: EricWF, dexonsmith.

https://cplusplus.github.io/LWG/issue2221

This is straightforward; I'm putting it up for review because it will add 
symbols to the dylib


https://reviews.llvm.org/D44263

Files:
  include/ostream
  
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/nullptr.pass.cpp

Index: test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/nullptr.pass.cpp
===
--- test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/nullptr.pass.cpp
+++ test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/nullptr.pass.cpp
@@ -0,0 +1,80 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// 
+
+// template  >
+//   class basic_ostream;
+
+// template
+//   basic_ostream& operator<<(basic_ostream& out, nullptr_t);
+//
+
+#include 
+#include 
+#include "test_macros.h"
+
+template 
+class testbuf
+: public std::basic_streambuf
+{
+typedef std::basic_streambuf base;
+std::basic_string str_;
+public:
+testbuf()
+{
+}
+
+std::basic_string str() const
+{return std::basic_string(base::pbase(), base::pptr());}
+
+protected:
+
+virtual typename base::int_type
+overflow(typename base::int_type ch = base::traits_type::eof())
+{
+if (ch != base::traits_type::eof())
+{
+int n = static_cast(str_.size());
+str_.push_back(ch);
+str_.resize(str_.capacity());
+base::setp(const_cast(str_.data()),
+   const_cast(str_.data() + str_.size()));
+base::pbump(n+1);
+}
+return ch;
+}
+};
+
+int main()
+{
+{
+std::wostream os((std::wstreambuf*)0);
+os << nullptr;
+assert(os.bad());
+assert(os.fail());
+}
+{
+testbuf sb;
+std::ostream os();
+assert(sb.str().length() == 0);
+os << nullptr;
+assert(sb.str().length() > 0);
+LIBCPP_ASSERT(sb.str() == "(nullptr)");  // output is an implementation-defined NTCTS
+}
+
+{
+testbuf sb;
+std::wostream os();
+assert(sb.str().length() == 0);
+os << nullptr;
+assert(sb.str().length() > 0);
+LIBCPP_ASSERT(sb.str() == L"(nullptr)");  // output is an implementation-defined NTCTS
+}
+}
Index: include/ostream
===
--- include/ostream
+++ include/ostream
@@ -56,6 +56,7 @@
 basic_ostream& operator<<(double f);
 basic_ostream& operator<<(long double f);
 basic_ostream& operator<<(const void* p);
+basic_ostream& operator<<(nullptr_t);   // C++17
 basic_ostream& operator<<(basic_streambuf* sb);
 
 // 27.7.2.7 Unformatted output:
@@ -216,6 +217,7 @@
 basic_ostream& operator<<(double __f);
 basic_ostream& operator<<(long double __f);
 basic_ostream& operator<<(const void* __p);
+basic_ostream& operator<<(nullptr_t);
 basic_ostream& operator<<(basic_streambuf* __sb);
 
 // 27.7.2.7 Unformatted output:
@@ -709,6 +711,14 @@
 return *this;
 }
 
+template 
+basic_ostream<_CharT, _Traits>&
+basic_ostream<_CharT, _Traits>::operator<<(nullptr_t)
+{
+	return *this << "(nullptr)";
+}
+
+
 template
 basic_ostream<_CharT, _Traits>&
 __put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
@@ -742,7 +752,6 @@
 return __os;
 }
 
-
 template
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits