What steps will reproduce the problem?
1. Compile any test case using death test asserts (eq. EXPECT_EXIT()) on
AIX
What is the expected output? What do you see instead?
The following warnings occur:
"Example_unittest.cpp", line 13.9: 1540-0306 (W) The "private" copy
constructor "RE(const RE &)" cannot be accessed.
"Example_unittest.cpp", line 13.9: 1540-0308 (I) The semantics specify that
a temporary object must be constructed.
"Example_unittest.cpp", line 13.9: 1540-0309 (I) The temporary is not
constructed, but the copy constructor must be accessible.
What version of the product are you using? On what operating system?
gtest 1.3.0
uname -a
AIX 3 5
Compiler:
lslpp -L | grep cpp | grep core
vacpp.cmp.core 8.0.0.20 C F IBM XL C/C++ Compiler
Please provide any additional information below.
AIX C++ compiler needs the copy constructor for "const
::testing::internal::RE& gtest_regex = (regex);". But the RE::RE() has the
constructors from the std::string and "const char*" only. The patch below
solves this problem:
==== gtest-1.3.0/include/gtest/internal/gtest-death-test-internal.h#1 -
gtest-1.3.0/include/gtest/internal/gtest-death-test-internal.h ====
@@ -158,7 +158,7 @@
#define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (true) { \
- const ::testing::internal::RE& gtest_regex = (regex); \
+ const ::testing::internal::RE gtest_regex(regex); \
::testing::internal::DeathTest* gtest_dt; \
if (!::testing::internal::DeathTest::Create(#statement, >est_regex,
\
__FILE__, __LINE__, >est_dt)) { \
Original issue reported on code.google.com by ade...@gmail.com on 29 Jul 2009 at 3:00
Original issue reported on code.google.com by
ade...@gmail.com
on 29 Jul 2009 at 3:00