[llvm-bugs] [Bug 49460] New: Apple Clang 12.0 is still c++03 on Apple M1's
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Mar 5 13:26:38 PST 2021
https://bugs.llvm.org/show_bug.cgi?id=49460
Bug ID: 49460
Summary: Apple Clang 12.0 is still c++03 on Apple M1's
Product: clang
Version: 11.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: noloader at gmail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
I realize this is an Apple bug, and not an LLVM bug. I hope the Apple folks
responsible for their compiler will see this report. Plus, I don't have an
Apple account due to the unconscionable terms of service.
I'm testing on a Mac-mini M1 with BigSur 11.2.2 (fully patched).
% sw_vers
ProductName: macOS
ProductVersion: 11.2.2
BuildVersion: 20D80
% c++ --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: arm64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Apple Clang is still c++03:
% c++ TestPrograms/test_cxx11_auto.cxx
TestPrograms/test_cxx11_auto.cxx:3:5: warning: 'auto' type specifier is a C++11
extension [-Wc++11-extensions]
auto a = 1 + 2;
% c++ TestPrograms/test_cxx11_deletefn.cxx
TestPrograms/test_cxx11_deletefn.cxx:2:11: warning: deleted function
definitions
are a C++11 extension [-Wc++11-extensions]
S() = delete;
% c++ TestPrograms/test_cxx11_alignas.cxx
TestPrograms/test_cxx11_alignas.cxx:3:5: error: use of undeclared identifier
'alignas'
alignas(8) unsigned char x[16];
% c++ TestPrograms/test_cxx11_alignof.cxx
TestPrograms/test_cxx11_alignof.cxx:4:32: error: expected '(' for
function-style
cast or type construction
std::size_t n = alignof(int);
And:
% cat TestPrograms/test_cxx11.cxx
// Real C++11 libraries provide <forward_list>
#include <forward_list>
int main(int argc, char* argv[])
{
#if __cplusplus >= 201103L
std::forward_list<int> x;
#else
int x[-1];
#endif
return 0;
}
% c++ TestPrograms/test_cxx11.cxx
TestPrograms/test_cxx11.cxx:8:11: error: 'x' declared as an array with a
negative size
int x[-1];
How does this machine have <forward_list>? Why does it not cause a compile
error?
It is 2021. It is about time to use C++11 as a default.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210305/81f204fd/attachment.html>
More information about the llvm-bugs
mailing list