Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Bug in msc 7.1 ?
Bug in msc 7.1 ? [message #25709] Mon, 08 March 2010 22:55 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
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

 
Read Message
Read Message
Previous Topic: Bugfix in spec file for Mageia 3
Next Topic: HelloWorld makefile
Goto Forum:
  


Current Time: Mon Apr 29 19:12:37 CEST 2024

Total time taken to generate the page: 0.02538 seconds