ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Linux Sisyphus mailing list <sisyphus@altlinux.ru>
Subject: Re: [sisyphus] GCC 3.3 vs GCC 3.4
Date: Mon, 11 Apr 2005 14:41:20 +0400
Message-ID: <20050411104120.GC29586@basalt.office.altlinux.org> (raw)
In-Reply-To: <200504111204.14017.serpiph@nikiet.ru>

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

Hi,

On Mon, Apr 11, 2005 at 12:04:13PM +0400, Epiphanov Sergei wrote:
> Есть программа 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.

$ g++ --version |fgrep g++
i586-alt-linux-g++ (GCC) 3.4.3 20050314 (ALT Linux, build 3.4.3-alt6)
$ g++ -c test.cpp
test.cpp:14: error: `Test' does not name a type
test.cpp: In function `int ins(const int&, const Test&)':
test.cpp:18: error: `ff' undeclared (first use this function)
test.cpp:18: error: (Each undeclared identifier is reported only once for each function it appears in.)
test.cpp: In function `int main(int, char**)':
test.cpp:28: error: `ff' undeclared (first use this function)
test.cpp:29: error: no matching function for call to `Test::Test(Test)'
test.cpp:7: note: candidates are: Test::Test(Test&)
test.cpp:6: note:                 Test::Test(int)

1. Определение класса должно завершаться символом ";".
2. Согласно /usr/share/doc/gcc-3.4/NEWS.html,
"G++ is now much closer to full conformance to the ISO/ANSI C++ standard.
This means, among other things, that a lot of invalid constructs which
used to be accepted in previous versions will now be rejected.  It is
very likely that existing C++ code will need to be fixed."

В данном случае речь идёт о том, что конструктор "Test::Test(Test &t)"
следует заменить конструктором "Test::Test(const Test &t)".


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2005-04-11 10:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-11  8:04 Epiphanov Sergei
2005-04-11  8:53 ` Dmitry Kazimirov
2005-04-11 10:41 ` Dmitry V. Levin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050411104120.GC29586@basalt.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=sisyphus@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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