xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/cxx11-exception-spec.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s
3*f4a2713aSLionel Sambuc // expected-no-diagnostics
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc #ifndef HEADER_INCLUDED
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc #define HEADER_INCLUDED
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc template<bool b> int f() noexcept(b) {}
10*f4a2713aSLionel Sambuc decltype(f<false>()) a;
11*f4a2713aSLionel Sambuc decltype(f<true>()) b;
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc #else
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc static_assert(!noexcept(f<false>()), "");
16*f4a2713aSLionel Sambuc static_assert(noexcept(f<true>()), "");
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc #endif
19