gcc/testsuite/g++.dg/cpp0x/gen-attrs-41.C
raw| 1 | // PR c++/45267 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-O" } |
| 4 | |
| 5 | template<typename T> struct Vector { |
| 6 | Vector(long long x); |
| 7 | inline Vector<T> operator<< [[gnu::always_inline]] (int x) const; |
| 8 | }; |
| 9 | long long bar (long long); |
| 10 | template<> inline Vector<int> Vector<int>::operator<<(int x) const { |
| 11 | return bar(x); |
| 12 | } |
| 13 | bool b; |
| 14 | int main() { |
| 15 | Vector<int> a(1); |
| 16 | if ((a << 2), b) { |
| 17 | a << 2; |
| 18 | throw 1; |
| 19 | } |
| 20 | } |