Opened 11 years ago
Last modified 11 years ago
#5745 assigned Feature Requests
Use native typeof support for Oracle Solaris Studio C++ compiler
Reported by: | Owned by: | Peder Holt | |
---|---|---|---|
Milestone: | Boost 1.48.0 | Component: | typeof |
Version: | Boost 1.47.0 | Severity: | Optimization |
Keywords: | Cc: | stephen.clamage@… |
Description
Oracle Solaris Studio (former SunStudio) C++ compiler supports native typeof since version 5.9. At the same time, support for typeof emulation is not so good (many compilation errors). It would be beneficial for Boost users if Boost used native typeof instead of emulation.
Here is proposed patch:
*** boost/typeof/typeof.hpp 2011-08-01 18:46:33.411406362 +0400 --- boost/typeof/typeof.hpp.new 2011-08-01 18:46:43.680746049 +0400 *************** *** 155,160 **** --- 155,176 ---- # else # error native typeof is not supported # endif + #elif defined(__SUNPRO_CC) + # if (__SUNPRO_CC < 0x590 ) + # ifdef BOOST_TYPEOF_NATIVE + # error native typeof is not supported + # endif + # ifndef BOOST_TYPEOF_EMULATION + # define BOOST_TYPEOF_EMULATION + # endif + # else + # ifndef BOOST_TYPEOF_EMULATION + # ifndef BOOST_TYPEOF_NATIVE + # define BOOST_TYPEOF_NATIVE + # endif + # define BOOST_TYPEOF_KEYWORD __typeof__ + # endif + # endif #else //unknown compiler # ifndef BOOST_TYPEOF_NATIVE # ifndef BOOST_TYPEOF_EMULATION
Change History (3)
comment:1 by , 11 years ago
Milestone: | To Be Determined → Boost 1.48.0 |
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
Even with the patch in place, most of the typeof regression tests still fail on the Sun compiler in native mode. http://www.boost.org/development/tests/trunk/developer/typeof.html This must be patched before this change can be integrated to release. I can apply the patch, but I don't have a Sun compiler so I can't write it.
comment:3 by , 11 years ago
That's expected. Next version of Oracle Solaris Studio C++ compiler 5.12 will handle typeof-related tests more gracefully. There was a minor deviation from common typeof implementation and it has been fixed.
I ran tests with patched boost and patched compiler in-house and got >250 new passes.
Patch committed to trunk