<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61639>61639</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            building C++ with the iOS 5.1 SDK fails with clang 16.0.0
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          OldWorldOrdr
      </td>
    </tr>
</table>

<pre>
    ```c++
#include <iostream>
int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
```
`clang++ -target arm-apple-darwin9 -arch armv6 -miphoneos-version-min=3.0.0 -mlinker-version=609 -isysroot /home/joey/iosdev/toolchain/sdk hello.cpp`
```
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:38:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ios:216:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__locale:15:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/string:434:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/algorithm:594:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/memory:590:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/typeinfo:61:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/exception:144:5: error: an attribute list cannot appear here
    _ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr);
 ^~~~~~~~~~~~~~~~~~~~
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__config:120:25: note: expanded from macro '_ATTRIBUTE'
#  define _ATTRIBUTE(x) [[x]]
 ^~~~~
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:38:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ios:216:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__locale:15:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/string:434:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/algorithm:594:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/memory:3724:18: error: 'reset' is missing exception specification 'noexcept'
shared_ptr<_Tp>::reset(_Yp* __p)
 ^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/memory:3099:30: note: previous declaration is here
    template<class _Yp> void reset(_Yp* __p) _NOEXCEPT;
                             ^
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:38:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ios:216:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__locale:15:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/string:3425:44: error: 'compare' is missing exception specification 'noexcept'
basic_string<_CharT, _Traits, _Allocator>::compare(const_pointer __s) const
 ^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/string:1433:9: note: previous declaration is here
    int compare(const_pointer __s) const _NOEXCEPT;
        ^
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:38:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ios:216:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__locale:18:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/mutex:177:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/functional:466:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/tuple:604:1: error: 'get' is missing exception specification 'noexcept'
get(tuple<_Tp...>& __t)
^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__tuple:81:1: note: previous declaration is here
get(tuple<_Tp...>&) _NOEXCEPT;
^
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:38:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ios:216:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__locale:18:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/mutex:177:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/functional:466:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/tuple:613:1: error: 'get' is missing exception specification 'noexcept'
get(const tuple<_Tp...>& __t)
^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__tuple:85:1: note: previous declaration is here
get(const tuple<_Tp...>&) _NOEXCEPT;
^
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:38:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ios:216:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__locale:18:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/mutex:177:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/functional:466:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/tuple:622:1: error: 'get' is missing exception specification 'noexcept'
get(tuple<_Tp...>&& __t)
^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/__tuple:89:1: note: previous declaration is here
get(tuple<_Tp...>&&) _NOEXCEPT;
^
In file included from hello.cpp:1:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/iostream:40:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/istream:156:
In file included from /home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/ostream:134:
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/bitset:212:28: error: '__init' is missing exception specification 'noexcept'
__bitset<_N_words, _Size>::__init(unsigned long long __v, false_type)
 ^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/bitset:193:10: note: previous declaration is here
    void __init(unsigned long long __v, false_type) _NOEXCEPT;
 ^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/bitset:225:28: error: '__init' is missing exception specification 'noexcept'
__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type)
 ^
/home/joey/iosdev/toolchain/sdk/usr/include/c++/v1/bitset:194:10: note: previous declaration is here
    void __init(unsigned long long __v, true_type) _NOEXCEPT;
         ^
8 errors generated.
```

When using clang 15.0.7 it compiles and runs just fine, no errors or even warnings.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmt-P2rgWx_8a82IRJXbIjwceGBh0qyt1rm5n1d0nyyQnxK1jR7bDzOzD_u0rG8jMbKdVf0G7u6AIQozz9Tn2-RzbgVsrtgpgjmZXaLaa8MG12sxvZP1WG1nfmNpMNrp-mKMs3h8VIlf-iFcoXiBCharkUANGdCm0dQZ4h-j1vlgohzsuFCIFIiVG-aEaxhhbVyO6QHRR6cH52oguMSLkPyClRmSJQwMQSRAhx-KxDqhaIvrkbgbcYBSOx4soXx1Ojg0fv1aSq-3eCjx13GzBYW66Ke97CdOamzuhSjzlpmr99V2Gp53oW61A2-kOjBVaTTuhEF3RKI5iPO2kUO_BHAsRXWVxiafCPlijtcOIrFvdASLrdxoeEFkLbWvYIbJ2WsuqDS5a2_o9br31UdX3Txv8tP2vFG6EBHxwe40bo7sn1egi8S76xG8_uzGIrAdr_A_29RFZHzufrHfJvuahwxe0OKssoguSZOeTZEzqikvw_p2dT9Y6I9QW0UVK0_OpcrnVRrjW9-usPKNwB502D0E1Pp-qe-hBqEYjusgeg-c7CsB9Bb0LYFgkqfenH0IYjNHGn3CFuXNGbAYHWArrcMWV0g7zvgducAsGHlHHFre3_3919cvtNSKF0nvyebw2RoCq8U6L2vOwNfqOPUqTYjxnvTOIlI8ARbPrPz58fXc_MFZp1Qg_nhPiO5gEPyjtIPjjvudq7OCOV0ZjRPKn9uZj2sG4hkYoeO6O-5BmfCq7ukezlT-eWXhh6IWhP5ahp6AlzYkXSIpnVEE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