comparison gcc/testsuite/g++.dg/cpp0x/noexcept46.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // PR c++/86476 - noexcept-specifier is a complete-class context
2 // { dg-do compile { target c++11 } }
3
4 void f() noexcept(false);
5 void g() noexcept(true);
6 void h() noexcept;
7
8 struct B {
9 friend void f() noexcept(false);
10 friend void g() noexcept(false); // { dg-error "different exception specifier" }
11 friend void h() noexcept(false); // { dg-error "different exception specifier" }
12 };
13
14 struct C {
15 friend void f() noexcept(true); // { dg-error "different exception specifier" }
16 friend void g() noexcept(true); // { dg-error "different exception specifier" }
17 friend void h() noexcept(true); // { dg-error "different exception specifier" }
18 };
19
20 void o() noexcept(false);
21 void p() noexcept(true);
22 void q() noexcept;
23
24 struct D {
25 friend void o() noexcept(true); // { dg-error "different exception specifier" }
26 friend void p() noexcept(true);
27 friend void q() noexcept(true);
28 };