Summary: | max_align_t should be in std namespace | ||
---|---|---|---|
Product: | gcc | Reporter: | Matthias Kretz (Vir) <mkretz> |
Component: | libstdc++ | Assignee: | Paolo Carlini <paolo.carlini> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ai.azuma |
Priority: | P3 | Keywords: | rejects-valid |
Version: | 4.8.0 | ||
Target Milestone: | 4.9.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | 4.7.2, 4.8.0 | Last reconfirmed: | 2013-01-17 00:00:00 |
Description
Matthias Kretz (Vir)
2013-01-17 12:58:53 UTC
<cstddef> just hasn't been updated since max_align_t was added to <stddef.h> Mine. Fixed for 4.9.0. If somebody is interested in 4.8.x too, backporting the patch should not be a big deal. The fix introduces another problem. Whenever '__need_size_t' is defined prior to the inclusion of <cstddef>, the type 'max_align_t' will not have been defined. This inevitably causes a compiler error: #define __need_size_t #include <cstddef> int main( void ) { return 0; } This happens on Mac OS X 10.9. In my case it got triggered by including <gmp.h>. Presumably this bug also occurs when #defining the other '__need_*' macros. I would propose adding something like #ifdef _GCC_MAX_ALIGN_T ... #endif around the 'using' declaration. (Though I really have no idea whatsoever off gcc internals...) (In reply to Jobst.Ziebell from comment #4) > Presumably this bug also occurs when #defining the other '__need_*' macros. Which user code should never be doing anyway. GMP is broken (and already fixed upstream). This is documented at http://gcc.gnu.org/gcc-4.9/porting_to.html and isn't going to be changed to accomodate broken libraries. |