Home » Developing U++ » U++ Developers corner » Bug in msc 7.1 ?
Bug in msc 7.1 ? [message #25709] |
Mon, 08 March 2010 22:55  |
mdelfede
Messages: 1308 Registered: September 2007
|
Ultimate Contributor |
|
|
#include <Core/Core.h>
using namespace Upp;
struct pippo : Moveable<pippo>
{
int T;
};
Vector<pippo> pluto()
{
Vector<pippo> p;
p.Add();
return p;
}
CONSOLE_APP_MAIN
{
Vector<pippo>v = pluto();
}
gives this error :
z:\home\massimo\WINDOWS\upp\uppsrc\Core\Topt.h(154) : error C2523: 'pippo::~T' : destructor tag mismatch
z:\home\massimo\WINDOWS\upp\uppsrc\Core\Vcont.hpp(68) : see reference to function template instantiation 'void Upp::DestroyArray<T>(T *,const T *)'
being compiled
with
[
T=pippo
]
Z:\home\massimo\WINDOWS\SDK2003\Microsoft Visual C++ Toolkit 2003\include\xmemory(136) : while compiling class-template member function 'void Upp::V
ector<T>::Free(void)'
with
[
T=pippo
]
Z:\home\massimo\WINDOWS\upp\MyApps\TestVectx\TestVectx.cpp(12) : see reference to class template instantiation 'Upp::Vector<T>' being compiled
with
[
T=pippo
]
Changing the definition of struct pippo like that :
struct pippo : Moveable<pippo>
{
int _T; // <== note, now variable is _T
};
Solves the problem... sigh. It seems to me that M$ compiler makes some mixing between template parameters and variable names in structs....
As usual, GCC behaves right there.
Max
[Updated on: Mon, 08 March 2010 22:56] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 30 12:05:11 CEST 2025
Total time taken to generate the page: 0.00349 seconds
|