ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] GCC 3.3 vs GCC 3.4
@ 2005-04-11  8:04 Epiphanov Sergei
  2005-04-11  8:53 ` Dmitry Kazimirov
  2005-04-11 10:41 ` Dmitry V. Levin
  0 siblings, 2 replies; 8+ messages in thread
From: Epiphanov Sergei @ 2005-04-11  8:04 UTC (permalink / raw)
  To: Рассылка Sisyphus

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

Есть программа test.cpp, приложенная в аттаче.

Стоят GCC 3.3 и GCC 3.4. Даю команды:

$ GCC_VERSION=3.3 g++ -o test test.cpp
$ ./test
Res1: 7
Res2: 5
Res3: 0
Res4: 1
$ GCC_VERSION=3.4 g++ -o test test.cpp
test.cpp: In function `int main(int, char**)':
test.cpp:30: error: no matching function for call to `Test::Test(Test)'
test.cpp:7: note: candidates are: Test::Test(Test&)
test.cpp:6:	                              Test::Test(int)
$

Глюк в компиляторе 3.4? Программа - это выжимка работы класса QMap из Qt.

-- 
С уважением, Епифанов Сергей

[-- Attachment #2: test.cpp --]
[-- Type: text/x-c++src, Size: 533 bytes --]

#include <stdio.h>

class Test{
	public:
		Test(){ i_num = 0; }
		Test(int i){ i_num = i; }
		Test(Test &t){ i_num = t.i_num; }
		~Test(){}
		int num() { return i_num; }
	private:
		int i_num;
}

Test ff(0);
int ii = 0;

int ins( const int& i, const Test &t) {
	ff = t;
	return ( ii = i );
}

int main(int argc, char **argv){
	Test t(5);
	Test t1(7);
	printf( "Res1: %d\n", t1.num() );
	t1 = t;
	printf( "Res2: %d\n", t1.num() );
	printf( "Res3: %d\n", ff.num() );
	ins( 2, Test(1) );
	printf( "Res4: %d\n", ff.num() );
	return 0;
}

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-04-11 13:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-11  8:04 [sisyphus] GCC 3.3 vs GCC 3.4 Epiphanov Sergei
2005-04-11  8:53 ` Dmitry Kazimirov
2005-04-11 10:41 ` Dmitry V. Levin
2005-04-11 11:46   ` Epiphanov Sergei
2005-04-11 12:12     ` Andrey Rahmatullin
2005-04-11 12:24       ` Epiphanov Sergei
2005-04-11 12:40         ` Andrey Rahmatullin
2005-04-11 13:31           ` Epiphanov Sergei

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git