BUG: Fixed member template test to not produce a test program that crashes when it runs.
This commit is contained in:
parent
bddcf4ec97
commit
772b121a14
|
@ -86,14 +86,15 @@ template <class U>
|
||||||
class A
|
class A
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
U* ptr;
|
U u;
|
||||||
template <class V> U m(V* p) { return *ptr = *p; }
|
A(): u(0) {}
|
||||||
|
template <class V> V m(V* p) { return *p = u; }
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
A<int> a;
|
A<short> a;
|
||||||
short s = 0;
|
int s = 1;
|
||||||
return a.m(&s);
|
return a.m(&s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue