OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [noexcept02.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Test for noexcept-specification
2
// { dg-options "-std=c++0x" }
3
 
4
#define SA(X) static_assert(X, #X)
5
 
6
void f();
7
void f() noexcept(false);
8
void f() noexcept(1 == 0);
9
void f();
10
 
11
SA(!noexcept(f()));
12
 
13
void g() throw (int);           // { dg-error "previous declaration" }
14
void g() noexcept(false);       // { dg-error "different exception" }
15
void g();
16
 
17
void h() throw();
18
void h() noexcept;
19
void h() throw();
20
void h() noexcept;
21
 
22
template 
23
void g (T) noexcept(noexcept(T())); // { dg-error "previous declaration" }
24
template 
25
void g (T) noexcept(noexcept(T(0))); // { dg-error "different exception" }
26
 
27
template 
28
void f (T) noexcept(noexcept(T()) && noexcept(T()));
29
template 
30
void f (T) noexcept(noexcept(T()) && noexcept(T()));
31
template 
32
void f2(T a) noexcept (noexcept (f (a)));
33
 
34
struct A { A(); };
35
SA(noexcept(f(1)));
36
SA(!noexcept(f(A())));
37
SA(noexcept(f2(1)));
38
SA(!noexcept(f2(A())));
39
 
40
template 
41
void f3(Ts... ts) noexcept (noexcept (f(ts...)));
42
 
43
SA(noexcept(f3(1)));
44
SA(!noexcept(f3(A())));
45
 
46
template 
47
void f (T1, T2) noexcept(noexcept(T1(), T2()));
48
 
49
struct B { };
50
 
51
SA(noexcept(f3(1,B())));
52
SA(!noexcept(f3(1,A())));
53
SA(!noexcept(f3(A(),1)));
54
SA(!noexcept(f3(A(),A())));

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.