Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/Wattributes-5.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 // { dg-do compile } | |
2 // { dg-options "-Wattributes" } | |
3 | |
4 #define ATTR(list) __attribute__ (list) | |
5 | |
6 template <int> | |
7 struct A | |
8 { | |
9 int __attribute__ ((noinline)) | |
10 f (); // { dg-message "previous declaration here" } | |
11 }; | |
12 | |
13 template <int N> | |
14 int __attribute__ ((always_inline)) | |
15 A<N>::f () // { dg-warning "ignoring attribute .always_inline. because it conflicts with attribute .noinline." } */ | |
16 { return 0; } | |
17 | |
18 | |
19 template <int> | |
20 struct B | |
21 { | |
22 int __attribute__ ((always_inline)) | |
23 f (); | |
24 }; | |
25 | |
26 template <> | |
27 inline int __attribute__ ((always_inline)) | |
28 B<0>::f () | |
29 { return 0; } | |
30 | |
31 template <> | |
32 int __attribute__ ((noinline)) | |
33 B<1>::f () | |
34 { return 1; } |