summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/visibility-1.C
blob: 40e742708bd6922b848d59242d22689b226dddf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Test visibility attribute on template member function
   instantiations. */

/* { dg-do compile } */
/* { dg-options "-fvisibility=hidden" } */
/* { dg-require-visibility "" } */
/* { dg-final { scan-not-hidden "_ZN7myClassIiE3maxEii" } } */

#define EXPORT __attribute__((visibility("default")))

template <class T>
class EXPORT myClass {
public:
  T max (T t1, T t2);
};

template <class T>
T myClass<T>::max (T t1, T t2) {
  return (t1 > t2 ? t1 : t2);
}

template class myClass<int>;