diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-05-22 21:36:38 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-05-22 21:36:38 +0000 |
commit | e51da3eab6ad2d02fcd8f68bdaef22d33a855210 (patch) | |
tree | 1bfa44f5a9427d658426ac7786a70741e36d1bc8 /test/PCH/cxx11-exception-spec.cpp | |
parent | 6b9a6e390fbb92c40eb9c6ac9e7abbd88dd7a767 (diff) |
Notes
Diffstat (limited to 'test/PCH/cxx11-exception-spec.cpp')
-rw-r--r-- | test/PCH/cxx11-exception-spec.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/PCH/cxx11-exception-spec.cpp b/test/PCH/cxx11-exception-spec.cpp new file mode 100644 index 000000000000..3fca4e48acf8 --- /dev/null +++ b/test/PCH/cxx11-exception-spec.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t +// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s + +#ifndef HEADER_INCLUDED + +#define HEADER_INCLUDED + +template<bool b> int f() noexcept(b) {} +decltype(f<false>()) a; +decltype(f<true>()) b; + +#else + +static_assert(!noexcept(f<false>()), ""); +static_assert(noexcept(f<true>()), ""); + +#endif |