blob: 8c63f9c2974ea473e73faf1953b07217ebf6787a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// PR c++/61500
struct X {
int i;
int j;
int foo(int X::* ptr);
template <int X::* ptr>
int bar();
};
int X::foo(int X::* ptr) {
int* p = &(this->*ptr); // OK.
return *p;
}
template <int X::* ptr>
int X::bar() {
int* p = &(this->*ptr); // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
return *p;
}
|