Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.old-deja/g++.mike/visibility-1.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Test visibility attribute on template member function | |
2 instantiations. */ | |
3 | |
4 /* { dg-do compile } */ | |
5 /* { dg-options "-fvisibility=hidden" } */ | |
6 /* { dg-require-visibility "" } */ | |
7 /* { dg-final { scan-not-hidden "_ZN7myClassIiE3maxEii" } } */ | |
8 | |
9 #define EXPORT __attribute__((visibility("default"))) | |
10 | |
11 template <class T> | |
12 class EXPORT myClass { | |
13 public: | |
14 T max (T t1, T t2); | |
15 }; | |
16 | |
17 template <class T> | |
18 T myClass<T>::max (T t1, T t2) { | |
19 return (t1 > t2 ? t1 : t2); | |
20 } | |
21 | |
22 template class myClass<int>; |