1 // PR c++/83394 - always_inline vs. noinline no longer diagnosed
3 // { dg-options "-Wattributes" }
5 #define ATTR(list) __attribute__ (list)
9 ATTR ((__noinline__)) operator int ();
12 ATTR ((__always_inline__))
13 A::operator int () // { dg-warning "ignoring attribute .always_inline. because it conflicts with attribute .noinline." }
21 operator char () const;
22 ATTR ((__always_inline__)) operator int () const;
25 B::operator char () const { return 0; }
28 B::operator int () const // { dg-warning "ignoring attribute .noinline. because it conflicts with attribute .always_inline." }
29 // { dg-warning "function might not be inlinable" "" { target *-*-* } .-1 }
39 ATTR ((__always_inline__)) operator short ();
41 ATTR ((__noinline__)) operator long ();
44 C::operator char () { return 0; }
47 C::operator short () // { dg-warning "ignoring attribute .noinline. because it conflicts with attribute .always_inline." }
48 // { dg-warning "function might not be inlinable" "" { target *-*-* } .-1 }
51 inline ATTR ((__noinline__))
56 ATTR ((__always_inline__))
57 C::operator long () // { dg-warning "ignoring attribute .always_inline. because it conflicts with attribute .noinline." }
65 int ATTR ((const)) foo (int, int);
66 int ATTR ((pure)) foo (int, int, int);
68 int ATTR ((const)) foo (int, int, int, int);
70 int foo (int, int, int, int, int);
82 D::foo (int, int) // { dg-warning "ignoring attribute .pure. because it conflicts with attribute .const." }
86 D::foo (int, int, int) // { dg-warning "ignoring attribute .const. because it conflicts with attribute .pure." }
90 D::foo (int, int, int, int) { return 0; }
93 D::foo (int, int, int, int, int) { return 0; }