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