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