159cdf90aSEric Fiselier //===----------------------------------------------------------------------===//
259cdf90aSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
659cdf90aSEric Fiselier //
759cdf90aSEric Fiselier //===----------------------------------------------------------------------===//
859cdf90aSEric Fiselier 
959cdf90aSEric Fiselier // <array>
1059cdf90aSEric Fiselier 
1159cdf90aSEric Fiselier // void swap(array& a);
1259cdf90aSEric Fiselier 
1359cdf90aSEric Fiselier #include <array>
1459cdf90aSEric Fiselier #include <cassert>
1559cdf90aSEric Fiselier 
main(int,char **)162df59c50SJF Bastien int main(int, char**) {
1759cdf90aSEric Fiselier   {
1859cdf90aSEric Fiselier     typedef double T;
1959cdf90aSEric Fiselier     typedef std::array<const T, 0> C;
2059cdf90aSEric Fiselier     C c = {};
2159cdf90aSEric Fiselier     C c2 = {};
22*76476efdSMuhammad Usman Shahid     // expected-error-re@array:* {{{{(static_assert|static assertion)}} failed{{.*}}cannot swap zero-sized array of type 'const T'}}
2359cdf90aSEric Fiselier     c.swap(c2); // expected-note {{requested here}}
2459cdf90aSEric Fiselier   }
252df59c50SJF Bastien 
262df59c50SJF Bastien   return 0;
2759cdf90aSEric Fiselier }
28