<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Apple Clang 12.0 is still c++03 on Apple M1's"
   href="https://bugs.llvm.org/show_bug.cgi?id=49460">49460</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Apple Clang 12.0 is still c++03 on Apple M1's
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>noloader@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>