Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
44bafcb6
Commit
44bafcb6
authored
Dec 07, 2009
by
zhanyong.wan
Browse files
Fixes the "passing non-POD to ellipsis" warning in Sun Studio. Based on Alexander Demin's patch.
parent
891b3716
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
16 deletions
+14
-16
include/gtest/internal/gtest-internal.h
include/gtest/internal/gtest-internal.h
+4
-7
include/gtest/internal/gtest-port.h
include/gtest/internal/gtest-port.h
+10
-9
No files found.
include/gtest/internal/gtest-internal.h
View file @
44bafcb6
...
@@ -148,17 +148,14 @@ char (&IsNullLiteralHelper(...))[2]; // NOLINT
...
@@ -148,17 +148,14 @@ char (&IsNullLiteralHelper(...))[2]; // NOLINT
// A compile-time bool constant that is true if and only if x is a
// A compile-time bool constant that is true if and only if x is a
// null pointer literal (i.e. NULL or any 0-valued compile-time
// null pointer literal (i.e. NULL or any 0-valued compile-time
// integral constant).
// integral constant).
#ifdef GTEST_ELLIPSIS_NEEDS_COPY_
#ifdef GTEST_ELLIPSIS_NEEDS_POD_
// Passing non-POD classes through ellipsis (...) crashes the ARM
// We lose support for NULL detection where the compiler doesn't like
// compiler. The Nokia Symbian and the IBM XL C/C++ compiler try to
// passing non-POD classes through ellipsis (...).
// instantiate a copy constructor for objects passed through ellipsis
// (...), failing for uncopyable objects. Hence we define this to
// false (and lose support for NULL detection).
#define GTEST_IS_NULL_LITERAL_(x) false
#define GTEST_IS_NULL_LITERAL_(x) false
#else
#else
#define GTEST_IS_NULL_LITERAL_(x) \
#define GTEST_IS_NULL_LITERAL_(x) \
(sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
(sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
#endif // GTEST_ELLIPSIS_NEEDS_
COPY
_
#endif // GTEST_ELLIPSIS_NEEDS_
POD
_
// Appends the user-supplied message to the Google-Test-generated message.
// Appends the user-supplied message to the Google-Test-generated message.
String
AppendUserMessage
(
const
String
&
gtest_msg
,
String
AppendUserMessage
(
const
String
&
gtest_msg
,
...
...
include/gtest/internal/gtest-port.h
View file @
44bafcb6
...
@@ -787,22 +787,23 @@ size_t GetThreadCount();
...
@@ -787,22 +787,23 @@ size_t GetThreadCount();
// Therefore Google Test is not thread-safe.
// Therefore Google Test is not thread-safe.
#define GTEST_IS_THREADSAFE 0
#define GTEST_IS_THREADSAFE 0
#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
// Passing non-POD classes through ellipsis (...) crashes the ARM
// Passing non-POD classes through ellipsis (...) crashes the ARM
// compiler. The Nokia Symbian and the IBM XL C/C++ compiler try to
// compiler and generates a warning in Sun Studio. The Nokia Symbian
// instantiate a copy constructor for objects passed through ellipsis
// and the IBM XL C/C++ compiler try to instantiate a copy constructor
// (...), failing for uncopyable objects. We define this to indicate
// for objects passed through ellipsis (...), failing for uncopyable
// the fact.
// objects. We define this to ensure that only POD is passed through
#define GTEST_ELLIPSIS_NEEDS_COPY_ 1
// ellipsis on these systems.
#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
#define GTEST_ELLIPSIS_NEEDS_POD_ 1
#endif
// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
// const T& and const T* in a function template. These compilers
// const T& and const T* in a function template. These compilers
// _can_ decide between class template specializations for T and T*,
// _can_ decide between class template specializations for T and T*,
// so a tr1::type_traits-like is_pointer works.
// so a tr1::type_traits-like is_pointer works.
#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
#define GTEST_NEEDS_IS_POINTER_ 1
#define GTEST_NEEDS_IS_POINTER_ 1
#endif
#endif // defined(__SYMBIAN32__) || defined(__IBMCPP__)
template
<
bool
bool_value
>
template
<
bool
bool_value
>
struct
bool_constant
{
struct
bool_constant
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment