xref: /minix3/external/bsd/llvm/dist/clang/test/CXX/except/except.spec/template.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // We use pointer assignment compatibility to test instantiation.
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc template <int N> void f1() throw(int);
6*f4a2713aSLionel Sambuc template <int N> void f2() noexcept(N > 1);
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc void (*t1)() throw(int) = &f1<0>;
9*f4a2713aSLionel Sambuc void (*t2)() throw() = &f1<0>; // expected-error {{not superset}}
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc void (*t3)() noexcept = &f2<2>; // no-error
12*f4a2713aSLionel Sambuc void (*t4)() noexcept = &f2<0>; // expected-error {{not superset}}
13