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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to