Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / noexcept63.C
blobcf048f56c2acbd4356402aac77781291c4b2d286
1 // PR c++/97966
2 // { dg-do compile { target c++11 } }
4 template <int>
5 struct S1 {
6   __attribute__((used)) S1() noexcept(noexcept(this->foo())) { }
7   void foo();
8 };
10 template <int>
11 struct S2 {
12   __attribute__((used)) void bar() noexcept(noexcept(this->foo())) { }
13   void foo();
16 template <int>
17 struct S3 {
18   void __attribute__((used)) bar() noexcept(noexcept(this->foo())) { }
19   void foo();
22 template <int>
23 struct S4 {
24   [[gnu::used]] void bar() noexcept(noexcept(this->foo())) { }
25   void foo();
28 template <int>
29 struct S5 {
30   void bar() noexcept(noexcept(this->foo())) __attribute__((used)) { }
31   void foo();
34 template <int>
35 struct S6 {
36   template <int>
37   struct N {
38     [[gnu::used]] void bar() noexcept(noexcept(this->foo())) { }
39     void foo();
40   };
43 void
44 g ()
46   S1<1> s1;
47   S2<1> s2;
48   S3<1> s3;
49   S4<1> s4;
50   S5<1> s5;
51   S6<1>::N<1> n;
54 // Make sure that we did emit the functions marked with attribute used
55 // even though they're not referenced in this TU.  (Well, the S1()
56 // constructor is.)
57 // { dg-final { scan-assembler "_ZN2S1ILi1EEC1Ev" } }
58 // { dg-final { scan-assembler "_ZN2S1ILi1EEC2Ev" } }
59 // { dg-final { scan-assembler "_ZN2S2ILi1EE3barEv" } }
60 // { dg-final { scan-assembler "_ZN2S3ILi1EE3barEv" } }
61 // { dg-final { scan-assembler "_ZN2S4ILi1EE3barEv" } }
62 // { dg-final { scan-assembler "_ZN2S5ILi1EE3barEv" } }
63 // { dg-final { scan-assembler "_ZN2S6ILi1EE1NILi1EE3barEv" } }