[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / dependent-noexcept-unevaluated.cpp
blobfad8d0918d530452ed42efd7b0d014beeaaa085c
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s
3 template <class T>
4 T&&
5 declval() noexcept;
7 template <class T>
8 struct some_trait
10 static const bool value = false;
13 template <class T>
14 void swap(T& x, T& y) noexcept(some_trait<T>::value)
16 T tmp(static_cast<T&&>(x));
17 x = static_cast<T&&>(y);
18 y = static_cast<T&&>(tmp);
21 template <class T, unsigned N>
22 struct array
24 T data[N];
26 void swap(array& a) noexcept(noexcept(::swap(declval<T&>(), declval<T&>())));
29 struct DefaultOnly
31 DefaultOnly() = default;
32 DefaultOnly(const DefaultOnly&) = delete;
33 DefaultOnly& operator=(const DefaultOnly&) = delete;
34 ~DefaultOnly() = default;
37 int main()
39 array<DefaultOnly, 1> a, b;