From 8b90f05746157c125fb1c48dc0b34b64074ceaf4 Mon Sep 17 00:00:00 2001 From: Date: Thu, 12 Jan 2012 07:49:25 +0000 Subject: [PATCH] Fix compile failures with clang in stl_logging_unittest.cc This happens due to the reason I wrote in stl_logging.h. We don't need utilities.h (which includes logging.h) so we can just remove it. git-svn-id: https://google-glog.googlecode.com/svn/trunk@105 eb4d4688-79bd-11dd-afb4-1d65580434c0 --- src/glog/stl_logging.h.in | 12 ++++++++++++ src/stl_logging_unittest.cc | 1 - src/windows/glog/stl_logging.h | 12 ++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/glog/stl_logging.h.in b/src/glog/stl_logging.h.in index f09e087..70e61f0 100644 --- a/src/glog/stl_logging.h.in +++ b/src/glog/stl_logging.h.in @@ -43,6 +43,18 @@ // using ::operator<<; // // to fix these errors. +// +// +// Notice for clang users: you should include stl_logging.h BEFORE you +// include logging.h. Otherwise, you will see some errors when you use +// CHECK with STL containers. +// +// Clang's "using ::operator<<" incorporate symbols which are declared +// before the using keyword. With GCC, symbols defined after the using +// keyword are incorporated as well. The CHECK macro defined in +// logging.h uses the using keyword so you need to include logging.h +// after including stl_logging.h. +// #ifndef UTIL_GTL_STL_LOGGING_INL_H_ #define UTIL_GTL_STL_LOGGING_INL_H_ diff --git a/src/stl_logging_unittest.cc b/src/stl_logging_unittest.cc index 0ed4695..021f642 100644 --- a/src/stl_logging_unittest.cc +++ b/src/stl_logging_unittest.cc @@ -27,7 +27,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "utilities.h" #include "config.h" #ifdef HAVE_USING_OPERATOR diff --git a/src/windows/glog/stl_logging.h b/src/windows/glog/stl_logging.h index d76f6c1..72c020b 100755 --- a/src/windows/glog/stl_logging.h +++ b/src/windows/glog/stl_logging.h @@ -47,6 +47,18 @@ // using ::operator<<; // // to fix these errors. +// +// +// Notice for clang users: you should include stl_logging.h BEFORE you +// include logging.h. Otherwise, you will see some errors when you use +// CHECK with STL containers. +// +// Clang's "using ::operator<<" incorporate symbols which are declared +// before the using keyword. With GCC, symbols defined after the using +// keyword are incorporated as well. The CHECK macro defined in +// logging.h uses the using keyword so you need to include logging.h +// after including stl_logging.h. +// #ifndef UTIL_GTL_STL_LOGGING_INL_H_ #define UTIL_GTL_STL_LOGGING_INL_H_ -- 2.34.1