aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-41.C
blob: 6e47a1e3d7541246a16cb89e36a9ba156995f936 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/45267
// { dg-do compile { target c++11 } }
// { dg-options "-O" }

template<typename T> struct Vector {
  Vector(long long x);
  inline Vector<T> operator<< [[gnu::always_inline]] (int x) const;
};
long long bar (long long);
template<> inline Vector<int> Vector<int>::operator<<(int x) const {
  return bar(x);
}
bool b;
int main() {
  Vector<int> a(1);
  if ((a << 2), b) {
    a << 2;
    throw 1;
  }
}