Closed Quuxplusone closed 13 years ago
A patch would be welcome to fix this, it is unlikely to be fixed by a random person without one.
Is it possible to get the same spelling for both c++'0x and c++'98?
(In reply to comment #3)
> Is it possible to get the same spelling for both c++'0x and c++'98?
Do you mean reimplement the alignof keyword manually for compilers that don't
know nothing about no c++'0x? I guess you could provide a subset of it by
adding something like:
#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
#define alignof(t) alignOf<t>()
#endif
But then detecting whether compiling with -std=c++0x would only work with GCC,
and require using a GCC-specific define that probably isn't even guaranteed to
be around forever once the standard is actually ratified. And -std=c++0x can't
be checked for in the normal way (if __cplusplus >= *month of ratification*L)
until it *is* ratified, so there doesn't seem to be a good way to do that at
all right now.
Attached alignof-c++0x.diff
(2004 bytes, text/plain): rename alignof
Attached alignof-c++0x-v2.diff
(2502 bytes, text/plain): rename alignof
Thanks, I applied your patch in r117774 and updated clang in 117775
alignof-c++0x.diff
(2004 bytes, text/plain)alignof-c++0x-v2.diff
(2502 bytes, text/plain)alignof is a keyword in C++0x, so AlignOf.h fails to compile for C++0x projects using llvm.