Opened 7 years ago
Closed 7 years ago
#11778 closed Bugs (wontfix)
Cannot test C++11 "enum class" types
Reported by: | Owned by: | Gennadiy Rozental | |
---|---|---|---|
Milestone: | To Be Determined | Component: | test |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
If you use the test tools with C++11 variables of type "enum class", compilation fails with many iostream errors, mostly variations on this one:
/usr/include/boost/test/tools/detail/print_helper.hpp:50:14: note: cannot convert ‘t’ (type ‘const Example’) to type ‘const std::error_code&’ ostr << t;
Attachments (1)
Change History (4)
by , 7 years ago
comment:1 by , 7 years ago
The problem says that the variable is not printable. Would you please confirm that using
BOOST_TEST_DONT_PRINT_LOG_VALUE
(documented here) solves the issue?
Thanks.
comment:2 by , 7 years ago
Yes that does work - sorry I didn't realise you had already catered for this situation! I had assumed it would be possible to simply convert the enums to ints when printing, but then enum class types can't be inherited so I imagine it's not possible to handle enum classes in a generic way like this.
I don't suppose there's any way a static_assert or similar could be used to at least get an error message that makes it look less like a problem with the library code?
Either way thanks for your help!
comment:3 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
In development version you'll get nicer error message about this kind of errors
Minimal example demonstrating problem