Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

The standard library header <cstdalign> is missing #37384

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR38411
Status NEW
Importance P enhancement
Reported by Yuri (yuri@tsoft.com)
Reported on 2018-08-01 16:34:19 -0700
Last modified on 2018-08-01 17:20:13 -0700
Version unspecified
Hardware PC FreeBSD
CC llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
I found this problem on FreeBSD, which uses clang and llvm C++ library:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230230

cppreference says that there should be such standard header:
https://en.cppreference.com/w/cpp/header/cstdalign
Quuxplusone commented 6 years ago
In the long run, you'll want to fix your code, because <cstdalign> was
deprecated in C++17, and will be removed outright for C++20.

c++17: [diff.mods.to.headers]/4 says:
The headers <ciso646>, <cstdalign> (D.4.2), and <cstdbool> (D.4.3) are
meaningless in C++. Use of the C++ headers <ccomplex>, <cstdalign>, <cstdbool>,
and <ctgmath> is deprecated (D.5).

c++2a [diff.cpp17.library]/2 says:
Change: Remove vacuous C++ header files.
Rationale: The empty headers implied a false requirement to achieve C
compatibility with the C++ headers. Effect on original feature: A valid C++
2017 program that #includes any of the following headers may fail to compile:
<ccomplex>, <ciso646>, <cstdalign>, <cstdbool>, and <ctgmath>.

That being said, it looks like libc++ never added <cstdalign> or <cuchar> for
C++11.