Opened 10 years ago
Closed 8 years ago
#7675 closed Bugs (wontfix)
BOOST_NO_DECLTYPE doesn't imply BOOST_NO_DECLTYPE_N3276 anymore
Reported by: | Owned by: | Marshall Clow | |
---|---|---|---|
Milestone: | To Be Determined | Component: | config |
Version: | Boost 1.52.0 | Severity: | Regression |
Keywords: | Cc: | gromer@… |
Description
Here's a simple repro:
#define BOOST_NO_DECLTYPE #include <boost/suffix.hpp> #ifndef BOOST_NO_DECLTYPE_N3276 #error "BOOST_NO_DECLTYPE should imply BOOST_NO_DECLTYPE_N3276" #endif
(I include only suffix.hpp so that the bug reproduces on any compiler; you can include boost/config.hpp instead, if you use a compiler that Boost detects as supporting N3276)
This fails with Boost 1.52.0, but builds with 1.50.0 (I don't have 1.51.0 handy to test, but from context I suspect it fails there too). This is a problem because utility/result_of.hpp, and possibly other Boost code, assumes decltype is permitted if BOOST_NO_DECLTYPE_N3276 is not defined; due to this bug, that code will continue to use decltype even when the user specifies BOOST_NO_DECLTYPE.
I've attached a patch that fixes this specific issue, but note that it may reflect a more general problem with the handling of deprecated config macros.
Attachments (1)
Change History (5)
by , 10 years ago
Attachment: | decltype.patch added |
---|
comment:1 by , 10 years ago
Hmm; the problem is indeed more general: user-supplied settings of any of the deprecated macros will be ignored by Boost code that uses the corresponding new macros. This is because, although suffix.hpp contains code to set the legacy macros based on the new macros, the config headers have no corresponding code to set the new macros based on the legacy macros. I've specifically encountered this in the context of boost/thread/locks.hpp's use of BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
, but this is presumably just one instance of many.
Note that this deprecation is not even documented yet (see ticket:7676), so the fact that these macros are marked deprecated deep in the config headers is no excuse for breaking support for them.
comment:2 by , 10 years ago
Owner: | changed from | to
---|
Marshall, as you made the changes to deprecate/rename those macros, can you take a look?
Thanks! John.
comment:3 by , 10 years ago
The good news is that almost no Boost code uses these macros (BOOST_NO_DECLTYPE_N3276
and BOOST_NO_DECLTYPE
) any more.
Right now, it's just Fusion, Spirit, and Chrono; and I'm working to make sure that these will be all be removed in the 1.53 release.
That being said, the breaking support for the old macros was a mistake, and I apologize.
However, I think that going forward, the best way to deal with this is to well, just go forward and use the new macros.
I'm still looking at this, though - leaving this bug report open.
comment:4 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
There was only one use of BOOST_NO_DECLTYPE in the 1.55 release, and none of BOOST_NO_DECLTYPE_N3276.
Closing this as "wont fix"
Patch to fix the issue, relative to 1.52.0