LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 38411 - The standard library header <cstdalign> is missing
Summary: The standard library header <cstdalign> is missing
Status: NEW
Alias: None
Product: libc++
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC FreeBSD
: P enhancement
Assignee: Marshall Clow (home)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-01 16:34 PDT by Yuri
Modified: 2018-08-01 17:20 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri 2018-08-01 16:34:19 PDT
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
Comment 1 Marshall Clow (home) 2018-08-01 17:20:13 PDT
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.