| 1 |
// PR c++/37177 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
#include <typeinfo> |
| 5 |
|
| 6 |
namespace N1 |
| 7 |
{ |
| 8 |
template<class T> bool foo(); |
| 9 |
} |
| 10 |
|
| 11 |
struct S |
| 12 |
{ |
| 13 |
template <class T> |
| 14 |
static bool foo(); |
| 15 |
|
| 16 |
template <class T> |
| 17 |
bool bar(); |
| 18 |
}; |
| 19 |
|
| 20 |
template<class T> bool foo(); |
| 21 |
|
| 22 |
int main() |
| 23 |
{ |
| 24 |
(void)(&S::bar<int>); |
| 25 |
decltype(&S::bar<int>) a; |
| 26 |
typeid(&S::bar<int>); |
| 27 |
|
| 28 |
(void*)(&S::foo<int>); |
| 29 |
(void)(&S::foo<int>); |
| 30 |
decltype(&S::foo<int>) b; |
| 31 |
typeid(&S::foo<int>); |
| 32 |
|
| 33 |
(void*)(&N1::foo<int>); |
| 34 |
(void)(&N1::foo<int>); |
| 35 |
decltype(&N1::foo<int>) c; |
| 36 |
typeid(&N1::foo<int>); |
| 37 |
|
| 38 |
(void*)(&foo<int>); |
| 39 |
(void)(&foo<int>); |
| 40 |
decltype(&foo<int>) d; |
| 41 |
typeid(&foo<int>); |
| 42 |
|
| 43 |
&foo<int> == 0; |
| 44 |
} |