aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ext/attr-used-1.C
blob: 6754c7ffb5090bb594d4308650187055ffe6badb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Attribute used on a member function or static data member
// of a template should cause them to be instantiated along
// with the class itself.

// { dg-final { scan-assembler "_ZN1AIiE1fEv" } }
// { dg-final { scan-assembler "_ZN1AIiE1tE" } }

template <class T> struct A
{
  void f() __attribute ((used));
  static T t __attribute ((used));
};

template <class T> void A<T>::f() { }
template <class T> T A<T>::t;

A<int> a;