aboutsummaryrefslogtreecommitdiff
path: root/test/PCH/cxx11-exception-spec.cpp
blob: 446619ed1c9436c8518923c84994da02d40d15a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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
// expected-no-diagnostics

#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