From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../SemaCXX/dependent-noexcept-unevaluated.cpp | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 clang/test/SemaCXX/dependent-noexcept-unevaluated.cpp (limited to 'clang/test/SemaCXX/dependent-noexcept-unevaluated.cpp') diff --git a/clang/test/SemaCXX/dependent-noexcept-unevaluated.cpp b/clang/test/SemaCXX/dependent-noexcept-unevaluated.cpp new file mode 100644 index 0000000..0a3a8bb --- /dev/null +++ b/clang/test/SemaCXX/dependent-noexcept-unevaluated.cpp @@ -0,0 +1,40 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s + +template +T&& +declval() noexcept; + +template +struct some_trait +{ + static const bool value = false; +}; + +template +void swap(T& x, T& y) noexcept(some_trait::value) +{ + T tmp(static_cast(x)); + x = static_cast(y); + y = static_cast(tmp); +} + +template +struct array +{ + T data[N]; + + void swap(array& a) noexcept(noexcept(swap(declval(), declval()))); +}; + +struct DefaultOnly +{ + DefaultOnly() = default; + DefaultOnly(const DefaultOnly&) = delete; + DefaultOnly& operator=(const DefaultOnly&) = delete; + ~DefaultOnly() = default; +}; + +int main() +{ + array a, b; +} -- cgit v1.2.3